OSMC, Kodi, PulseAudio & Snapcast

Okay, first some background. I have a Vero 4k+ acting exclusively as my main mediacenter by all my AV equipment etc. I have a second instance of OSMC running from my retired RPi3 media center. This unit now acts as my main Mopidy instance, and occasionally I will still use it for media center things (PiP etc).

I have 8 independent speaker zones in my house. They are all currently set to play as a slave off of whatever is playing from the main Mopidy box.

Enter Snapcast. I have (after days of 4 letter words and a ton of beer), gotten the Snapcast Server (also running the Client) going and working well on my retired RPi3 OSMC instance. The issue I was running into was that Kodi’s ALSA necessities was fighting with SnapCasts and the audio sounded like crapola as a result. Successfully disabling the mediacenter service fixed this.

Now this isnt too big of an issue in this particular room, since it is rare that I will need to run Kodi from that OSMC instance. Those times I do, I most likely will not need to be playing music too, so no foul.

However, onto my 3rd RPi. This one is located in my detached garage ManCave. This Pi does need to be able to run Kodi and play music from SnapCast at the same time, so disabling the mediacenter service really is a no go here.

I understand that I should be able to fix this conflict by having either Kodi or the SnapClient on this particular RPi utilize PulseAudio and the other ALSA. I spent literally days and hours trying unsuccessfully to get the SnapClient to output audio utilizing Pulse. So I was looking for some advice on how I can get Kodi to output audio strictly though the HDMI jack utilizing PulseAudio. Does anyone have any advice?

PS: If you have a similar setup to me and can walk me step by step how to get just a SnapClient outputting audio through Pulse, I’m all ears. I was using this guide and for the life of me, could never get SnapClient to use Pulse. GitHub - skalavala/Multi-Room-Audio-Centralized-Audio-for-Home: This Github Repository provides details on setting up a centralized audio system for your home using nothing but Raspberry Pi's and Old Speakers.

This isn’t a good idea. It will break passthrough.

I intentionally avoid building against PulseAudio because it can cause problems. PulseAudio does have an ALSA interface which you should be able to use however.

Sam

Ah okay, thanks! I’d ideally like to maintain passthrough, but as a secondary media center mainly for streaming sports, I can live without it if there is no other way.

So if I am understanding correct, you are saying to use PA’s ALSA interface to handle Kodi audio via HDMI? This arrangement would resolve the “fight” between Kodi and Snapcast for the primary ALSA instance which was causing distorted audio when running the mediacenter service and Snapcast simultaneously?

EDIT- I take it this is the pulseaudio-alsa that this wiki is referring to? PulseAudio - ArchWiki

Linux audio really is a web of confusion for me.

Yes — or set one to PCM and one to HDMI