Linux HDMI audio problems
#1
Hey all,

I've been working on getting my XBMCbuntu installation up and running for the last couple of days, but the sound is consistently kicking my a*s. I have found plenty of forum posts (both here and elsewhere) about getting HDMI audio working in XBMC and Ubuntu, but none of them seem to fix my problem.

I have a mini-PC connected to a LCD TV via HDMI cable. Regardless of what settings I pick in the XBMC I never get sound on my videos. The navigation sounds are coming through on the analog output (I can hear them in my earphones when I plug them in). When I select analog in the audio output settings I can hear the videos on the earphones, but when setting it to HDMI I get nothing. There are no errors when playing the video then, just no sound.

I don't want to bombard the first post with log files and data so I'll just start it off with the basic aplay -l and aplay -L. Anyone able to offer any assistance?

Code:
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=NVidia
    HDA NVidia, ALC662 rev1 Analog
    Default Audio Device
front:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    Front speakers
surround40:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
dmix:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    Direct sample mixing device
dmix:CARD=NVidia,DEV=1
    HDA NVidia, ALC662 rev1 Digital
    Direct sample mixing device
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=1
    HDA NVidia, ALC662 rev1 Digital
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
hw:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=1
    HDA NVidia, ALC662 rev1 Digital
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=0
    HDA NVidia, ALC662 rev1 Analog
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=1
    HDA NVidia, ALC662 rev1 Digital
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
Reply
#2
Have you tried entering plughw:0,3 when you set it to custom?

I assume you are not using any passthough audio like DTS etc?
Reply
#3
Yes I've tried that one, also hw:0,3. I notice the hdmi tag is associated with 0,0 which is the analog device, but maybe that's a red herring.
Reply
#4
Setting "Audio Ouput" to "Analog" is almost always the correct setting for a direct-to-TV HDMI connection. Most TVs cannot decode digital audio (though many can pass it through to optical). It really doesn't matter because the sound is going to be downmixed to stereo through low-end TV speakers anyway. Set it to "Analog" and pick "hdmi (ALSA)" in the device list and run through all the HDMI option until it works.

Always test media first. You can always get menu sounds working later. If XBMC installed a file called ".asoundrc" in the XBMC user's home directory (use "ls -a" to look for it), then post it. You've probably seen this in other threads, but make sure there are no digital channels of any kind muted in alsamixer.
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#5
I've just tried setting the Output to Analog and tried the various other options in the Output Device list, but none are bringing sound out. I don't get errors when I choose the default (alsa) or hdmi (alsa) options, but I get "failed to initialise audio device" errors when I pick specific ones like "HDA Nvidia - hdmi - 3 (ALSA)".

I have checked alsamixer and have taken all the playback channels off mute (master, pcm, s/pdif, s/pdif default, s/pdif 1), but to no improvement. there was a .asoundrc file in my home folder that I put there myself while trying something, but it neither fixed it being there or by me removing it and reloading alsa.

Are there any more log files or config outputs that would point in the right direction?
Reply
#6
Yup. Remove or rename the .asoundrc file for now. Use "Custom" for the device and set it to the hdmi line from "aplay -L". In your case, "hdmi:CARD=NVidia,DEV=0".

If that doesn't work, post the output of the following commands:
Code:
lspci | grep -i audio

# this should play some sound, use ctrl+c to quit
speaker-test -D plughw:0,3

# I think this equates to the "hdmi (ALSA)" device listed in XBMC
speaker-test -D plug:hdmi
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#7
The output of the first command is:

Code:
00:07.0 Audio device: nVidia Corporation MCP72XE/MCP72P/MCP78U/MCP78S High Definition Audio (rev a1)

The two speaker-tests run, but produce no sound.

Code:
speaker-test 1.0.24.2

Playback device is plughw:0,3
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
Time per period = 5.480711
0 - Front Left
Time per period = 5.480934
0 - Front Left
Time per period = 5.482206
0 - Front Left
^C

Code:
speaker-test 1.0.24.2

Playback device is plug:hdmi
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
Time per period = 5.477993
0 - Front Left
Time per period = 5.482117
0 - Front Left
Time per period = 5.482748
0 - Front Left
Time per period = 5.483251
0 - Front Left
Time per period = 5.483372
0 - Front Left
Time per period = 5.483820
0 - Front Left
Time per period = 5.483630
0 - Front Left
^C
Reply
#8
A cheeky bump... anyone got anymore ideas?
Reply
#9
You didn't mention trying a custom device of "hdmi:CARD=NVidia,DEV=0". However, if those speaker tests don't work, you can try direct to hardware with "speaker-test -D hw:0,3", and ALSA's default HDMI with "speaker-test -D plug:hdmi".

Note that some mainboards require you to enable HDMI audio in the BIOS. So check that.
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#10
What mini PC are you using? I struggled for days trying to get HDMI digital audio working from my Acer Revo R3700, eventually I found out that you need to disable the onboard analogue audio and then the HDMI audio worked perfectly using plughw:0,3
Reply
#11
I'm using an emachines ER1401. I haven't tried turning off the onboard sound yet as there's only the one option and I assume it would kill all the sound from the machine. I'll give that a try.

@Plaguester - I did try both of those things and they didn't product any sound. This is all quite wierd as it was working perfectly in Windows before I wiped it to try XBMCbuntu. I've loaded up a couple of other Linux distro installs and they all seem to have the same problem.
OK, that didn't work. ALSA just reports there are no sound cards in the system Sad
Reply
#12
After changing the Audio Device to Custom and setting the custom device to "hdmi:CARD=NVidia,DEV=0" and starting a video, power cycle your TV (this will help rule out a handshake issue). Also, if you have one available, try a different cable. I know it sounds ridiculous, but HDMI cables have different versions.

You can also try hw:CARD=NVidia,DEV=3 and plughw:CARD=NVidia,DEV=3 as custom devices.
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply

Logout Mark Read Team Forum Stats Members Help
HDMI audio problems0