Snapclient setup on Ubuntu #944
-
Dear community! I'm setting up multi-room audio for the first time using Snapcast, with a Raspberry Pi running Mopidy as a front-end for Snapserver. I'm having some hickups still on the client side, for which at the moment I'm using my laptop running Ubuntu 20.04 LTS. I thought maybe someone with more experience on the inner workings of Snapcast could help out? Basically, my trouble is, if I have some program open on my laptop which might be possibly using the audio device for sound output, the audio piped through Snapcast is not able to connect to the sound device, even if there's no audio playing from any other process at the moment. A typical scenario would be that I have my Firefox open on my computer, try to play some music from Mopidy, but nothing is going through, and snapclient is giving me:
What seems to work at this point, is to close Firefox, start playing music, and then open up Firefox again. Knowing, that in general it is possible to have multiple programs outputting sound open on a given computer, I would imagine this is also the case with Snapclient. Could somebody help me out here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Only one process may output directly to an ALSA device at a time. You can technically use ALSA dmix to get around that but it doesn't play nicely with snapclient so that's not a good idea here. However, Ubuntu 20.04 should (I.e. It's the default) be setup so programs output to pulseaudio rather than ALSA directly. And one of the main benefits of going through pulseaudio is that it allows multiple processes to access the sound device. Can you configure snapclient to use pulseaudio instead? |
Beta Was this translation helpful? Give feedback.
-
I would guess the reason that doesn't work is the service runs as user |
Beta Was this translation helpful? Give feedback.
Only one process may output directly to an ALSA device at a time. You can technically use ALSA dmix to get around that but it doesn't play nicely with snapclient so that's not a good idea here.
However, Ubuntu 20.04 should (I.e. It's the default) be setup so programs output to pulseaudio rather than ALSA directly. And one of the main benefits of going through pulseaudio is that it allows multiple processes to access the sound device. Can you configure snapclient to use pulseaudio instead?