Possible to send Kodi sound through HDMI with DAC installed?

This might be a bit of a niche usage, but I wonder if anyone else has found a way to enable what I’m looking for.

I’m running OSMC on a Pi 3B with an IQaudio DAC+. The HDMI output is connected to our TV, and the IQuadio audio outputs are connected to our 2-channel stereo. The stereo is solely for listening to music sent through upmpdcli, which is installed on OSMC.

On Kodi 18, once I had installed the overlay for the DAC+, I was able to set the audio output in Kodi to HDMI, so that anything played through Kodi came through the HDMI audio to the TV, but upmpdcli could send audio to the stereo.

On Kodi 19, I’m finding that installing the overlay for the DAC+ in Kodi means that the only audio output options available are to the DAC+, and HDMI sound output is not an option.

Has anyone found a way in Kodi 19 to do what I’m attempting? (Kodi audio output through HDMI, other audio output from the Pi through a separate DAC).

What do you see in aplay -l and aplay -L?

Full debug logs would be useful as well.

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

aplay -L
Discard all samples (playback) or generate zero samples (capture)
IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
Default Audio Device
IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
Default Audio Device
IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
Direct sample mixing device
IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
Direct sample snooping device
IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
Direct hardware device without any conversions
IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
Hardware device with all software conversions

Log file - with a few seconds of TV audio coming through the DAC+:

Did you try with dtparam=audio=on instead of dtparam=audio=on?

dtparam=audio=on in /boot/config-user.txt did the trick thanks!

I don’t remember needing to alter that setting in previous versions, so I wonder if the defaults have changed. I wrongly assumed that that setting only affected the 3.5mm output on the pi.

Thanks for your help!

I would have assumed you put it there when you added the overlay for the iq-audio, didn’t you?

I added the overlay through My OSMC, so I guess it was added by that step.

I only manually edited the config file to correct the overlay line - MyOSMC had added:

when it should read:

Now that I have upmpdcli playing through the correct output, I just need to remember which incantation got the hardware volume control working last time I had to install it…

I am currently on the testing version that has already correct the -overlay topic but wasn’t aware of the audio=off addition. I will check that with the team

Thanks for your help - everything is working perfectly now.

It amazes me that a Pi 3B has enough power to be playing a movie on the TV through Kodi, while upmpdcli running in the background is playing music through the DAC output. Of course I wouldn’t normally want to do both at the same time, but I tried it while I was troubleshooting and it handled it without any trouble.

For anyone else doing something similar, the lines I changed in /etc/mpd.conf to send the mpd audio through the DAC rather than HDMI were:

audio_output {
        type            "alsa"
        name            "My ALSA Device"
        device          "hw:1,0"        # HDMI is hw:0,0    DAC is hw:1,0    on my setup
        mixer_type      "hardware"      
        mixer_device    "hw:1"  #  this selects the DAC mixer
        mixer_control   "Digital"       # I found this name by running 'amixer -c 1'
#       mixer_index     "0"             # optional
1 Like

I’ve made a further change and the dtparam=audio=off setting should be omitted in the next update.

Thanks Sam.

Just in case anyone else tries to do what I was doing, I ran into some problems after rebooting the Pi. Kodi seemed to be making the default audio device the iqAudio DAC rather than the HDMI output, which was stopping upmpdcli from being able to use the DAC for its own output.
I changed a line in ~/.kodi/userdata/guisettings.xml to include:

 <setting id="audiooutput.audiodevice">ALSA:sysdefault:card=vc4hdmi,DEV=0</setting>

and that seems to have fixed things - no idea whether that’s the correct approach though!

It’ll do :wink:

Alternatively you could have stopped the service and adjusted via Kodi.