Pisound for analog Inputs on RPI in Kodi/OSMC

Hi there,

I am newbie to all things RPi. I have done lots of reading and am constantly learning by doing.

I just ordered my Pisound as an AD/DA Converter for my RPi 3B+ media player.
OS is OSMC (Debian Jessie based) running Kodi.
The RPi is up and running. Even though I am a musician I want to use it strictly for Hi-Fi and Video.
Its connected to two Klein&Hummel O98 Speakers (analog out) and a TV (HDMI) .
What I want to do:

  • Build Media Player for streaming Audio and Video from NAS
  • Stereo Input for turntable ( I will take care of the phono preamp myself)
  • Input selection by hardware button / app / or dedicated remote control
  • Quality DA
  1. Will Pisound work with OSMC/Kodi?
  2. How is input selection done? Or is it mixed?
  3. Can volume be set by kodi (remote app or dedicated remote control)?
  4. What software do I need for controling and configuring - something like Pavucontrol maybe?

I apologize for any stupid questions in advance and appreciate any help.

Best regards
Daniel

Hey, it does work with OSMC / Kodi, and Pavucontrol was necessary to get it working, see Pisound + Kodi?

Pisound appears to the OS as an ALSA capture and playback device (usually hw:1,0, specifying hw:pisound should work too), so it should be usable with all modern Linux audio applications.

I haven’t used OSCM / Kodi much, so I can’t comment on 2 and 3. :slight_smile:

That was fast…:-)…Thank you

I have read your linked thread. It was pretty much the only one I found mentioning Pisound and Kodi.
Thnaks for your answers over there as well…:slight_smile:

I just found a screenshot of Pavucontrol and it looks like the input devices tab is a mixer.
If so I would only have to mute the analog inputs when not in use.
I hope this can be implemented in the yet to be determined remote control.

Best regards
Daniel

Pavucontrol won’t work with Kodi - it uses ALSA. You can use alsamixer instead to do anything pavucontrol can do.

To control mute/volume etc. you can use the amixer command from the command line though I wouldn’t bother. I never use Kodi for volume control as it will mess with the audio - I just use the remote on my amp. Much better.

Be aware thet although you have an unmuted input it won’t produce any sound unless you actually use it with arecord or similar.

Pavucontrol does work with Kodi, I have tried that myself. If Pavucontrol is not installed, I think this option is not shown in the settings. Also, Pisound volume for input / output can only be controlled using the analog potentiometers, there is no hardware or software controls accessible for that in amixer.

Sorry yes Kodi is fine with pulseaudio. The problem will be using it on something like OSMC or LibreElec, which are very minimal distros.

Forgot about the lack of alsa settings. My bad you’re correct. I use a couple of cards for the Pi and get confused…

Hi there,

thanks for all your answers.
It has been a while since my Pisound arrived but only yesterday I found some time to get started with it.
As mentioned in my first post I wanted to use it with OSMC.
The first problem arose while installing the driver package.
Pisound software wants at least linux kernel version 4.14.19. OSMC is on 4.14.13.
Again - I am new to this and only tried a few things (apt-get update, apt-get upgrade, apt-get dist-upgrade). None of those updated the linux kernel. Thus I tried it the hard way and did a rpi-update. A safe way to shoot the system down. Kernel updated - Kodi not working…:joy:
Now I am on Raspbian. Pisound works (and sounds great) as does Kodi.

Regarding the audio inputs.
I realized that the inputs need an application to be active as mentioned by dmooney.
What would be the most efficient software to have them active and just routing the inputs to the outputs?

Thanks for all your help…

Best regards
Daniel

You could do:

arecord -D hw:pisound -f S16_LE -c2 -r 48000 | aplay -D hw:pisound

to forward Pisound input audio to output. In case output is already in use by some software, this may give’device is busy’ error. Depending on the audio backend used, it may be possible to make the backend mix the audio stream, or using ALSA dmix plugin: Sound Mixing with the ALSA Dmix Plugin Instead of a Sound Server · Marc André Tanner

This works nicely. Thank you.
My goal eventually is to be able to select either the analog inputs or kodi as source using the pisound button.
Further when using the analog inputs I want to be able to start recording them to my NAS with the pisound button.
If understand correctly, I could either use alsa to change the routing depending on what I want to hear or I could just use pulsesound as a sound server and do the same thing from within there.
Which way would be preferable with regard to sound quality?

In terms of sound quality, both should be equal. Maybe with pulseaudio it would be possible to avoid gaps and clicks when changing the routing, as ALSA utilities would have to be temporarily stopped. Another option is to use jack server for that.

When writing to storage, you may want to find some utility to encode to mp3 or flac at the same time, since raw wave files can quickly take up large amounts of space.

So the next thing to do would be to determine to either use pulseaudio or jack as sound server and then to configure asound.conf or asoundrc.conf to use it as default device…?.. Like this…?

pcm.default pulse
ctl.default pulse

The pulse audio driver should be activated already…
Is that correct so far?
I am sorry for all the noob questions…

I will stick to pulseaudio. Jack seems to be overkill for my purposes.
It should be possible with Pulse to mix the two streams from the analog input and from kodi.
I only need to find a way to keep the analog inputs of pisound active. Does anybody know a little program that will just activate and monitor the audio inputs? Kind of like arecord but routing being managable by pulseaudio. Is there an equivalent for arecord that does this?

Can anyone please provide a little assistance on this? I’m trying to route pisound input to output through ALSA, which is already targeted by pianoteq and so Im getting the “device or resource busy” error, but I don’t know enough about how to achieve the suggestions of “making the backend mix the audio stream, or using ALSA dmix plugin” and the linked article didn’t particularly clarify things enough for me.
Struggling a little bit here to make it work.

hmm, seems like on boot, .asoundrc gets deleted by something. so frustrating.

What OS distribution are you running?

raspian os 64 bit

My discovery was: yes, .asoundrc kept getting deleted, but asound.conf was persistent, so I went with that. (though the dmix+loopback combo wound up having underruns or too much latency and I couldnt find settings that balanced it well enough in the middle, so I just went and set up qjackctl. (this time, fresh install, the server wasnt failing every time so now its working and happy with low latency. Wish I could say why, for any of the above.)
Idk. Im learning.