Luna (moonlight) can't change audio output to HiFiBerry Digi+ (S/PDIF output)

I have a HiFiBerry Digi+

This outputs sounds over S/PDIF to my amp.

When I stream games to the Pi via Luna there isn’t an option to choose audio device, so on the projector there is no sound (I assume the sound is going via HDMI the default ALSA device).

I how do I install aplay to check the audio devices as I’m getting on command not found on OSMC.

https://www.hifiberry.com/guides/configure-osmc-for-hifiberry/

Notes:
To get the HiFiBerry Digi+ working in OSMC you have to edit config.txt adding the following line:

dtoverlay=hifiberry-digi-overlay

Also an update in January/February required this to be adjusted too:
dtparam=audio=off

sudo apt-get update
sudo apt-get install alsa-utils

Thanks Sam. These are the audio devices:

osmc@Lounge:~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HifiBerry Digi HiFi wm8804-spdif-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0

Within luna settings>select audio device
It only lists sysdefault

It seems to be loaded:

osmc@Lounge:~$ lsmod Module Size Used by 8021q 22147 0 garp 7622 1 8021q stp 2430 1 garp llc 6031 2 stp,garp snd_soc_wm8804_i2c 2006 1 snd_soc_wm8804 9849 1 snd_soc_wm8804_i2c snd_soc_hifiberry_digi 4116 0 snd_soc_bcm2835_i2s 7455 2 snd_soc_core 194702 3 snd_soc_wm8804,snd_soc_bcm2835_i2s,snd_soc_hifiberry_digi snd_pcm_dmaengine 5958 1 snd_soc_core snd_pcm 115748 3 snd_soc_wm8804,snd_soc_core,snd_pcm_dmaengine evdev 13192 1 snd_timer 25966 1 snd_pcm bcm2835_thermal 2541 0 snd 78090 3 snd_soc_core,snd_timer,snd_pcm i2c_bcm2708 5828 0 bcm2835_gpiomem 4026 0 bcm2835_wdt 4081 0 uio_pdrv_genirq 3885 0 uio 10428 1 uio_pdrv_genirq fuse 107913 1 ipv6 448428 42

Looking under \luna-master\resources\lib\model\audiodevice.py

This is probably the file which needs adjusting to recognise the soundcard, currently it contains:

class AudioDevice: def __init__(self): self.name = None self.handler = ''

That’s fine.

You turned ALSA off for snd-bcm2835, so you will only have one device now. You may need to configure asound.conf manually.

I don’t have a HifiBerry for Pi2/3 so can’t test this for you. This is beyond the scope of the OSMC forum. Maybe you will have more joy on the HifiBerry forum as other distributions use ALSA in a more involved way than

Thanks Sam, it might be a luna issue - will report back with any solutions.