Can't get HDMI audio to work for ATI HD 5450 with default radeon driver despite enabling radeon.audio=1

Latest response

I've been trying to get HDMI audio working for my ATI HD 5450 using the default "radeon" kernel drivers.

I have a vanilla install of RHEL except for getting the latest updates from yum (and have also tried Fedora 23, Ubuntu 16.04 and 17.04, and possibly others I can't remember).

I've been scouring the net for an answer but no luck yet.

This article provided some useful info but I still can't get any sound: http://forums.fedoraforum.org/showthread.php?p=1786436#post1786436

I've added the "radeon.audio=1" argument to the GRUB2 config with grubby.

sudo grubby --args="radeon.audio=1" --update-kernel /boot/vmlinuz-3.10.0-514.el7.x86_64

Confirmed with grubby that it's been applied:

$ sudo grubby --info=ALL
index=0
kernel=/boot/vmlinuz-3.10.0-514.el7.x86_64
args="ro crashkernel=auto rd.lvm.lv=linux/rhel-root rd.lvm.lv=linux/swap rhgb quiet LANG=en_AU.UTF-8 radeon.audio=1"

It has taken effect in /boot/grub2/grub.cfg:

        linux16 /vmlinuz-3.10.0-514.el7.x86_64 root=/dev/mapper/linux-rhel--root ro crashkernel=auto rd.lvm.lv=linux/rhel-root rd.lvm.lv=linux/swap rhgb quiet LANG=en_AU.UTF-8 radeon.audio=1

I restarted and can see with modprobe that the argument has been applied to the radeon driver:

$ sudo modprobe -c radeon | grep -i audio
options radeon audio=1
options radeon audio=1

However still no audio. No sound from speaker-test. No sound from CD. No sound from the GNOME speaker test in System Preferences.

I installed pavucontrol but nothing is muted. I tried stereo and 5.1 but no improvement.

I checked the official documentation for the radeon driver and it says HDMI audio is supported for Evergreeen cards since kernel 3.3, and RHEL 7.3 has kernel 3.10:

https://www.x.org/wiki/RadeonFeature/#index1h2

$ uname -a
Linux mediapc-rhel.localdomain 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Any ideas? That's about the extent of my knowledge on how to assess the issue so all suggestions, no matter how simple, very welcome.

Responses

I've tried a number of options with speaker-test but to no avail.

  116  aplay -L
  118  speaker-test -Dhdmi:HDMI -c 2
  119  speaker-test -Dpulse -c 2
  120  speaker-test -Dhdmi -c 2
  122  speaker-test -Dhdmi:HDMI -c 2 -r 44100
  123  speaker-test -Dpulse -c 2 -r 44100
  124  speaker-test -Dpulse -c 2 -r 44100 -l 2

Note output of aplay:

$ aplay -Lnull
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
hdmi:CARD=HDMI,DEV=0
    HDA ATI HDMI, HDMI 0
    HDMI Audio Output

Also note that when I try to output to "hdmi" or "hdmi:HDMI" it tells me the device is busy (I assume because the Pulse audio server has it tied up?):

$ speaker-test -Dhdmi:HDMI -c2 -r44100 -l1

speaker-test 1.1.1

Playback device is hdmi:HDMI
Stream parameters are 44100Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

Also note that I have had this soundcard working before, on both Windows and Linux, but it was some time ago. I think I last had it working in Ubuntu 14.04, but I was using the ATI Catalyst fglrx drivers at the time I think. It still currently works fine in Windows. I have it plugged-in to a Yamaha HTR-4066 receiver. It's a HP MicroServer (N36L).

lspci can see the device:

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series]

Worth noting is that I am outputting video through this same HDMI port without issue.

I've been following this guide for some of the above but couldn't find anything that improved the situation:

https://wiki.gentoo.org/wiki/Radeon#Feature_support

However I don't understand a lot of the earlier bits relating to enabling kernel options etc.

I've been working through this article:

https://help.ubuntu.com/community/RadeonDriver

dmesg turned up this error. Not sure of its relevant, but could HDMI-A-1 be the HDMI Audio driver?

[ 4353.981883] [drm:radeon_dvi_detect [radeon]] *ERROR* HDMI-A-1: probed a monitor but no|invalid EDID

Full output:

$ dmesg | egrep 'drm|radeon'
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-514.el7.x86_64 root=/dev/mapper/linux-rhel--root ro crashkernel=auto rd.lvm.lv=linux/rhel-root rd.lvm.lv=linux/swap rhgb quiet LANG=en_AU.UTF-8 radeon.audio=1
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-514.el7.x86_64 root=/dev/mapper/linux-rhel--root ro crashkernel=auto rd.lvm.lv=linux/rhel-root rd.lvm.lv=linux/swap rhgb quiet LANG=en_AU.UTF-8 radeon.audio=1
[    4.404921] [drm] Initialized drm 1.1.0 20060810
[    4.528345] [drm] radeon kernel modesetting enabled.
[    4.541978] [drm] initializing kernel modesetting (CEDAR 0x1002:0x68F9 0x1043:0x0374 0x00).
[    4.542003] [drm] register mmio base: 0xFE8E0000
[    4.542005] [drm] register mmio size: 131072
[    4.543042] radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used)
[    4.543047] radeon 0000:01:00.0: GTT: 1024M 0x0000000020000000 - 0x000000005FFFFFFF
[    4.543050] [drm] Detected VRAM RAM=512M, BAR=256M
[    4.543053] [drm] RAM width 64bits DDR
[    4.543720] [drm] radeon: 512M of VRAM memory ready
[    4.543723] [drm] radeon: 1024M of GTT memory ready.
[    4.543741] [drm] Loading CEDAR Microcode
[    4.543894] [drm] Internal thermal controller without fan control
[    4.577766] [drm] radeon: dpm initialized
[    4.577932] [drm] GART: num cpu pages 262144, num gpu pages 262144
[    4.580756] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
[    4.596834] [drm] PCIE GART of 1024M enabled (table at 0x000000000025E000).
[    4.597009] radeon 0000:01:00.0: WB enabled
[    4.597015] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000020000c00 and cpu addr 0xffff8800ceae2c00
[    4.597020] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000020000c0c and cpu addr 0xffff8800ceae2c0c
[    4.597779] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c418 and cpu addr 0xffffc90000c1c418
[    4.598593] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    4.598596] [drm] Driver supports precise vblank timestamp query.
[    4.598600] radeon 0000:01:00.0: radeon: MSI limited to 32-bit
[    4.598720] radeon 0000:01:00.0: irq 27 for MSI/MSI-X
[    4.598733] radeon 0000:01:00.0: radeon: using MSI.
[    4.598765] [drm] radeon: irq initialized.
[    4.626820] [drm] ring test on 0 succeeded in 1 usecs
[    4.626828] [drm] ring test on 3 succeeded in 2 usecs
[    4.815116] [drm] ring test on 5 succeeded in 1 usecs
[    4.815194] [drm] UVD initialized successfully.
[    4.815502] [drm] ib test on ring 0 succeeded in 0 usecs
[    4.815538] [drm] ib test on ring 3 succeeded in 0 usecs
[    5.488221] [drm] ib test on ring 5 succeeded
[    5.489064] [drm] Radeon Display Connectors
[    5.489067] [drm] Connector 0:
[    5.489069] [drm]   HDMI-A-1
[    5.489071] [drm]   HPD1
[    5.489074] [drm]   DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 0x644c 0x644c
[    5.489076] [drm]   Encoders:
[    5.489078] [drm]     DFP1: INTERNAL_UNIPHY1
[    5.489080] [drm] Connector 1:
[    5.489081] [drm]   DVI-I-1
[    5.489083] [drm]   HPD4
[    5.489086] [drm]   DDC: 0x6460 0x6460 0x6464 0x6464 0x6468 0x6468 0x646c 0x646c
[    5.489088] [drm]   Encoders:
[    5.489090] [drm]     DFP2: INTERNAL_UNIPHY
[    5.489092] [drm]     CRT1: INTERNAL_KLDSCP_DAC1
[    5.489093] [drm] Connector 2:
[    5.489095] [drm]   VGA-1
[    5.489098] [drm]   DDC: 0x6430 0x6430 0x6434 0x6434 0x6438 0x6438 0x643c 0x643c
[    5.489099] [drm]   Encoders:
[    5.489101] [drm]     CRT2: INTERNAL_KLDSCP_DAC2
[    5.578301] [drm] fb mappable at 0xD045F000
[    5.578308] [drm] vram apper at 0xD0000000
[    5.578310] [drm] size 4325376
[    5.578313] [drm] fb depth is 24
[    5.578315] [drm]    pitch is 5632
[    5.578509] fbcon: radeondrmfb (fb0) is primary device
[    5.602794] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
[    5.606214] [drm] Initialized radeon 2.43.0 20080528 for 0000:01:00.0 on minor 0
[ 4353.923604] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 84
[ 4353.952175] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 44
[ 4353.981883] [drm:radeon_dvi_detect [radeon]] *ERROR* HDMI-A-1: probed a monitor but no|invalid EDID
[ 4354.017349] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 171
[ 4354.045865] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 232
[ 4353.981883] [drm:radeon_dvi_detect [radeon]] *ERROR* HDMI-A-1: probed a monitor but no|invalid EDID

This might very well be relevant, as EDID is what tells the system whether or not the device on the other end of the HDMI connection is even capable of accepting sound, and ifit is, what audio formats it might accept.

You might want to look for files named /proc/asound/cardN/eld* and see what's in them. On my system, /proc/asound/card0 is the HDAudio chip integrated in the motherboard, and /proc/asound/card1 is the audio output of my NVIDIA GPU. In other words, for the purpose of HDMI audio output, the GPU will appear as an extra HDAudio sound card, so the "primary" sound card will not be involved at all.

When I connect the GPU's HDMI output to my TV, this is what I see in /proc/asound/card1/eld#0.0:

monitor_present         1
eld_valid               1
monitor_name            SONY TV

connection_type         HDMI
eld_version             [0x2] CEA-861D or below
edid_version            [0x3] CEA-861-B, C or D
manufacture_id          0xd94d
product_id              0x7001
port_id                 0x200
support_hdcp            0
support_ai              0
audio_sync_delay        0
speakers                [0x1] FL/FR
sad_count               1
sad0_coding_type        [0x1] LPCM
sad0_channels           2
sad0_rates              [0xe0] 32000 44100 48000
sad0_bits               [0xe0000] 16 20 24

That is, my TV will accept only two-channel PCM audio with three specific sample rates and bits-per-sample values.

If the equivalent information has not been received from your HDMI display device, then the behavior will depend on the driver. It might behave like a speaker connector with the speakers unplugged, i.e. it will accept the audio output but won't actually produce sound; or it might report to the sound system that the audio capability is not available.

Thanks Matti. That is very interesting.

So I found my video card as /proc/asound/card0. The output looks fine mostly except it's missing the monitor_name, and the edid_version field has an error/warning. But as far as audio encoding goes it gives a very detailed description of the formats available.

From eld#0.0:

monitor_present         1
eld_valid               1
monitor_name
connection_type         HDMI
eld_version             [0x2] CEA-861D or below
edid_version            [0x0] no CEA EDID Timing Extension block present
manufacture_id          0x0
product_id              0x0
port_id                 0x0
support_hdcp            0
support_ai              0
audio_sync_delay        0
speakers                [0x5f] FL/FR LFE FC RL/RR RC RLC/RRC
sad_count               6
sad0_coding_type        [0x1] LPCM
sad0_channels           8
sad0_rates              [0x1ee0] 32000 44100 48000 88200 96000 176400 192000
sad0_bits               [0xe0000] 16 20 24
sad1_coding_type        [0x2] AC-3
sad1_channels           6
sad1_rates              [0xe0] 32000 44100 48000
sad1_max_bitrate        640000
sad2_coding_type        [0x7] DTS
sad2_coding_type        [0x7] DTS
sad2_channels           7
sad2_rates              [0x6e0] 32000 44100 48000 88200 96000
sad2_max_bitrate        1536000
sad3_coding_type        [0xa] E-AC-3/DD+ (Dolby Digital Plus)
sad3_channels           8
sad3_rates              [0xc0] 44100 48000
sad4_coding_type        [0xb] DTS-HD
sad4_channels           8
sad4_rates              [0x1480] 48000 96000 192000
sad5_coding_type        [0xc] MLP (Dolby TrueHD)
sad5_channels           8
sad5_rates              [0x1480] 48000 96000 192000

For what it's worth, the ati drivers are listed as installed in yum:

$ yum list *ati*
...
xorg-x11-drv-ati.x86_64                            7.6.1-3.20160215gitd41fccc.el7             @anaconda/7.3     

I switched to init 3 to try using speaker-test directly on the hdmi device. It now let me run speaker-test directly against the hdmi:HDMI device but still no sound.

  143  speaker-test -Dhdmi:HDMI
  144  speaker-test -Dhdmi
  145  speaker-test -Dhdmi -c2 -l1 -r44100
  146  speaker-test -Dhdmi:HDMI -c2 -l1 -r44100
  147  speaker-test -Dhdmi:HDMI -c2 -l4 -r44100

The only point to note is that in earlier tests it didn't like the default option of one channel. It returned an error, something about it being an invalid parameter option (I was in init 3 so no copy/paste and didn't output anywhere). It ran the test with -c2 but still no sound.

I also tried enabling all of the codecs under Advanced in pavucontrol but that didn't help at all (I tried them all at once, then all individually). PCM was always ticked as it's locked on.

I'm thoroughly out of ideas...

I tried a monitor instead of the TV but no improvement, and notice the edId_version is still reporting the same despite different screen (but same home cinema receiver)

monitor_present         1
eld_valid               1
monitor_name
connection_type         HDMI
eld_version             [0x2] CEA-861D or below
edid_version            [0x0] no CEA EDID Timing Extension block present
manufacture_id          0x0
product_id              0x0
port_id                 0x0
support_hdcp            0
support_ai              0
audio_sync_delay        0
speakers                [0x5f] FL/FR LFE FC RL/RR RC RLC/RRC
sad_count               6
sad0_coding_type        [0x1] LPCM
sad0_channels           8
sad0_rates              [0x1ee0] 32000 44100 48000 88200 96000 176400 192000
sad0_bits               [0xe0000] 16 20 24
sad1_coding_type        [0x2] AC-3
sad1_channels           6
sad1_rates              [0xe0] 32000 44100 48000
sad1_max_bitrate        640000
sad2_coding_type        [0x7] DTS