HDMI audio on an old Geforce 9300 motherboard

I cannot get HDMI audio to work in Lakka on this XFX MI-9300-7AS9 motherboard, which is a Geforce 9300 chipset with onboard Nvidia GPU. Analog audio works fine, HDMI audio works in Windows, and if I use speaker-test from SSH while Lakka is running it does produce the test noises. To clarify, HDMI audio does work via the speaker-test command line utility while Lakka is running, but with any game I try there is no audio.

I cannot change the audio device from Lakka’s GUI, I have seen that in other cases on different hardware, but I can do so by editing the config manually which is how I confirmed analog to be working. I used the aplay command to list audio devices, I tried the ones marked as digital or HDMI, none worked, I could only get analog to work.

Oh and none of this was using the most recent Lakka version which I just found out about when I came to post this.

Please try to provide Lakka system and audio logs. Thank you.

Started messing with it again, saving logs and such, and then I tried the newest Lakka messing around again and surprise audio started working. But there’s a catch, it doesn’t work on a fresh power-on or reboot, it only works when I quit and restart Lakka, either from the GUI or using the command line.

Sorry that these logs are across versions, but since quitting/restarting fixes audio I can no longer get a log of it not working, I don’t know if/where Lakka stores logs by default.

Log when audio doesn’t work: http://pastebin.com/Y8z12hDk Here’s a snippet of that:

RetroArch [INFO] :: Found joypad driver: "udev".
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/confmisc.c:768:(parse_card) cannot find card 'HDMI'
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/conf.c:4771:(snd_config_expand) Evaluate error: No such device
ALSA lib /home/kivutar/Lakka/build.Lakka-Generic.x86_64-devel/alsa-lib-1.1.0/src/pcm/pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM hdmi:CARD=HDMI,DEV=0
RetroArch [ERROR] :: ALSA: Failed to initialize...
RetroArch [ERROR] :: Failed to initialize audio driver. Will continue without audio.

Log when audio works: http://pastebin.com/AbJupeFy

Audio device list from aplay:


Lakka:~ # aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=NVidia
    HDA NVidia, ALC1200 Analog
    Default Audio Device
sysdefault:CARD=NVidia
    HDA NVidia, ALC1200 Analog
    Default Audio Device
front:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    Front speakers
surround21:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
    HDA NVidia, ALC1200 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output

I can run speaker-test (while Lakka is running or not) and get the test noises:


Lakka:~ # speaker-test -Dhdmi:CARD=NVidia,DEV=0 -c 2


speaker-test 1.1.0


Playback device is hdmi:CARD=NVidia,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 524288
Period size range from 32 to 262144
Using max buffer size 524288
Periods = 4
was set period_size = 131072
was set buffer_size = 524288
 0 - Front Left
 1 - Front Right
Time per period = 5.467491
 0 - Front Left
 1 - Front Right
^CTime per period = 3.535923

Sorry I know this is getting a bit messy and confusing now. It might be interesting to solve this problem, but in reality if doing a simple quit/restart from the GUI continues to work that’s not a big hassle.

Did you modify the configuration file manually ? If yes try to put default value to audio_device with audio_device = “”

You should be able to switch audio device with the GUI. Just go to Setting Tab > Audio > Audio Device and select your audio device with left or right.

Something I forgot to mention that might be important, I don’t do Lakka installations, I bring the same USB to different devices and test them, more like just seeing what works and what doesn’t, I don’t sit and play the games much :). So maybe device selection gets “stuck” because the entry from the last PC does not appear in the device list on the next PC?

Anyway that is sort of a side issue I guess, I probably shouldn’t have mentioned it. Not being able to select an audio device from the GUI is for me a common issue I’ve seen in the last 3 stable versions and on multiple different PCs, and it occurs anytime, sometimes it lets you change it once, sometimes it’s stuck right from first boot. Usually the audio works, it just doesn’t let me change the device.

Yes if you changed often PC, you should put audio device to null before closing otherwise it will be “stucked”.

Ok, thanks.

On the other issue, anyone have ideas why I have to quit/restart Lakka to get the HDMI audio going? As I said it’s not a big inconvenience, but if anyone has suggestions I’ll try them.

You can’t change audio device “on the fly” when you are playing game you need to stop the core and launch it again so that he can output to the new audio device. But you shouldn’t have to quit /restart to get the HDMI audio working.

When you start Lakka in a new PC, first change audio device and then play your games. You should try to put it back to null before you stop Lakka so that next time you can change audio device when you are on a new PC otherwise it will be “stucked” as it can’t find the audio device.

Sorry this got all confused :). I’m not actually changing it on the fly. I am also not changing PCs in this case, I have multiple USB drives I use to play around with Lakka on different hardware, and I’ve left this latest version plugged into this same motherboard the entire time as I’ve tried to resolve this HDMI audio issue.

Anyway, this HDMI audio issue is probably a weird quirk we won’t be able to explain or solve, which is OK as I can just do the quit/restart with each boot up. Maybe I can even come up with a script or something to do it for me.

Thanks.