LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read how to get help
Post Reply
rarsa
Level 1
Level 1
Posts: 30
Joined: Sun Jun 13, 2010 5:51 pm

LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by rarsa »

I am testing if I can upgrade to 19.3 and I found a problem with HDMI audio.

I have a multiboot system and HDMI works OK in Windows 10 and on Mint 18.3. I've been using this system for years and HDMI audio has worked in every Mint version I've used, and before that in Ubuntu, Puppy linux, fedora, and as far as I remember in every linux distribution I've tested.

I can hear audio properly through a headset plugged into the computer built in audio.

The HDMI device does not show in the System Audio settings.
If I run the Pulse Audio Volume Control (pavucontrol), I can see the the HDMI port but "unplugged"

I've searched high and low and tried many things to make it work to no avail. Here is what I have done:

If I run the commands to list the hardware: lspci, aplay and inxi I can see the device

If I run the speaker test, I can hear the sound comming from each speaker in the monitor.

Code: Select all

speaker-test --channels 2 --rate 48000 --device hw:1,3
I have tried changing the boot parameters to force audio.radeon=1 to no effect

I have added the following line to default.pa and the result is even worst. No sinks at all show in the volume settings, so I removed it again

Code: Select all

load-module module-alsa-sink device=hw:1,3
Here is my current kernel

Code: Select all

uname -a
Linux xxxx 5.0.0-32-generic #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I've ran the following command to get the full audio configuration output on 19.3

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
The output on the system where HDMI sound does not work is here code
https://termbin.com/k8r6

I ran the same command on the 18.3 install where it works OK. The ouput is here

https://termbin.com/wgcs


I compared both outputs and I couldn't see any material differences. The only one was that 19.3 loads a module called "module-switch-on-connect". Tested with that module commented out on default.pa. but the problem remains.

This is the only issue holding me from upgrading from 18.3 to 19. It is not urgent as I still have until 18.3 runs out of support but I'd like to have a solution before that.

I'm attaching a screenshot of what I can see in the volume settings and pavucontrol under 19.3

Thanks for any help
Attachments
Screenshot from 2020-04-21 00-34-50.png
Last edited by rarsa on Thu Apr 23, 2020 3:36 pm, edited 1 time in total.
rarsa
Level 1
Level 1
Posts: 30
Joined: Sun Jun 13, 2010 5:51 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged"

Post by rarsa »

I've continued researching and found this post:

viewtopic.php?t=295685

Surprisingly I noticed the same thing
EDIT - Just an addition - I noticed that if I open a program like Discord, or Clementine and set the PROGRAM'S specific output to the HDMI Audio, that programs audio output will work fine over HDMI! Yet it's doesn't seem to be working on the system as a whole?
Interestingly, testing with youtube. If I select the HDMI as output for Firefox, I can hear it. If I pause the video and start again, it reverts to the built-in audio.

I've tried with older kernels and I haven't found one that works. I guess I'll keep trying, at least now I have a workaround
Last edited by rarsa on Thu Apr 23, 2020 1:04 pm, edited 1 time in total.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged"

Post by MrEen »

Hi again rarsa.

Nice work finding something that works for you! Here's some more ideas to try to see if it improves things:

1. This might be the best; In pavucontrol, click on the check mark next to the HDMI (unplugged) device on the Output Devices tab to make it the default device. Even if you have to use the Playback tab to then chenge something, hopefully ALL output will continue on the same Port.

2. In /etc/pulse/default.pa also comment out this line which I think was causing your resumed audio to revert to the built-in audio:

Code: Select all

load-module module-suspend-on-idle
This may not be necessary after doing #1.

I'll look through those outputs in a little bit to see if I spot anything else noteworthy.

Good luck.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged"

Post by MrEen »

I may have found something that's causing your issue:
rarsa wrote:
Wed Apr 22, 2020 11:24 pm
I have tried changing the boot parameters to force audio.radeon=1 to no effect
Try this instead:

Code: Select all

radeon.audio=1
Unless you've typo'd more than once, you're using the wrong parameter. Although that parameter should not have been necessary for the last several years.

I now remember there have been a few occasions where new kernels have killed HDMI audio for Radeon users. The kernel you're using now is no longer supported so you might try upgrading to the latest 5.3 kernel to see if that fixes the issue. You could also drop down to the 4.15 kernel which is also still supported, and also may fix this.

I'm still looking through the outputs to see if I spot anything else.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged"

Post by MrEen »

If none of the above helps, I have an idea that may work.

Run sudo alsactl store followed by cat /var/lib/alsa/asound.state and paste the output here.
rarsa
Level 1
Level 1
Posts: 30
Joined: Sun Jun 13, 2010 5:51 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged"

Post by rarsa »

After continuing reading, I found that this seems to be an issue caused by a kernel bug fix.
The kernel developers point the finger at the device drivers developers to fix their drivers.

Meanwhile, I found a workaround


https://gist.github.com/bassmanitram/49 ... 7b8ab470fd

bear in mind that you will need to review the script to find your card. in my case I replaced

Code: Select all

card=$(aplay -l | grep "NVidia.*HDMI 1" -m 1)

with 

card=$(aplay -l | grep "HDMI 0" -m 1)
I found I don't need to restart pulse so I also commented out this line

Code: Select all

#pulseaudio -k 
And finally, I don't want HDMI as the default so I commented out

Code: Select all

#pacmd set-default-sink alsa_output.hw_${card_number}_${dev_number}
Bottom line, all this script does is run

Code: Select all

pacmd load-module module-alsa-sink device=hw:1,3
which corresponds to my Card and device.

If you know your card and device, you can try running this command with the proper parameters, before trying the script.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by MrEen »

So, the thing that "fixed" this:
rarsa wrote:
Thu Apr 23, 2020 3:35 pm
Bottom line, all this script does is run

Code: Select all

pacmd load-module module-alsa-sink device=hw:1,3
Is the same thing that broke all your sound:
rarsa wrote:
Wed Apr 22, 2020 11:24 pm
I have added the following line to default.pa and the result is even worst. No sinks at all show in the volume settings, so I removed it again

Code: Select all

load-module module-alsa-sink device=hw:1,3
Based on that info, you had a timing issue. The video card was too slow to startup, so PulseAudio sort of broke when trying to add the module you asked it to.

I'll bet you could have simply added pacmd load-module module-alsa-sink device=hw:1,3 to a startup script delayed by a few seconds such as this:

Code: Select all

bash -c "sleep 5 && pacmd load-module module-alsa-sink device=hw:1,3
rarsa
Level 1
Level 1
Posts: 30
Joined: Sun Jun 13, 2010 5:51 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by rarsa »

MrEen wrote:
Thu Apr 23, 2020 3:54 pm
Is the same thing that broke all your sound:
Based on that info, you had a timing issue. The video card was too slow to startup, so PulseAudio sort of broke when trying to add the module you asked it to.

I'll bet you could have simply added pacmd load-module module-alsa-sink device=hw:1,3 to a startup script delayed by a few seconds such as this:

Code: Select all

bash -c "sleep 5 && pacmd load-module module-alsa-sink device=hw:1,3
Thanks, that's exactly what I saw.

I decided not to use the script as my HW values don't change. In the end I just entered the command as a "Startup Application" that included that command and delayed by 5 seconds.

Wow, great minds think alike!

Thanks for looking into this.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by MrEen »

You're most welcome!

I hadn't heard much about Radeon HDMI audio trouble lately, but I do know Ubuntu had an issue with that many months ago.

Glad you've got it working! :D
rarsa
Level 1
Level 1
Posts: 30
Joined: Sun Jun 13, 2010 5:51 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by rarsa »

I am just trying the newly released Ubuntu 20.04 and the problem shows up also there. But the workaround also works.

This is a very "old computer", just that I overprovisioned when I built it 10 years ago (or more?), so it still feels quite powerful. * 6 Cores, 8 GB Ram, etc. So, yes, the video card is quite old. At some point it may make sense to upgrade the card.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by MrEen »

Wow. I'm a bit surprised the issue is still there with the 5.4 kernel in Ubuntu 20.04. It was such a stupid little change in the kernel that caused this, but I guess I shouldn't really be surprised with the audio issues the Ubuntu devs had troubles with lately.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by MrEen »

I found the original bugfix that caused these issues for Radeon users here. Specifically, this:
- ALSA: hda/hdmi - Read the pin sense from register when repolling
- ALSA: hda/hdmi - Consider eld_valid when reporting jack event
And all this because the stupid gnome sound settings thing was showing HDMI options when there was no HDMI connection active. i.e. It was was showing what the sound card was capable of playing to, just like pavucontrol does! And 10 months later there are issues again!
rarsa
Level 1
Level 1
Posts: 30
Joined: Sun Jun 13, 2010 5:51 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by rarsa »

Workaround update:

After using my solution for a few days, today it failed. I was investigating and found that I had connected a USB camera with a microphone and a USB headset. It seems that when I have these things plugged when I turn on, the Card and device reported for the HDMI change.

What I ended up doing is
Create a bash script file with this content:

Code: Select all

#!/bin/bash
$(aplay -l | grep HDMI | sed 's/^card \([0-9]\).*device \([0-9]\).*$/pacmd load-module module-alsa-sink device=hw:\1,\2/')
Made it executable

And created a startup application entry to execute that script.

Now it's working again.
User avatar
MrEen
Level 20
Level 20
Posts: 11876
Joined: Mon Jun 12, 2017 8:39 pm

Re: LinuxMint 19.3 No sound on HDMI. Device shows in pavucontrol as "unplugged" (WORKAROUND FOUND)

Post by MrEen »

Once again, nice work making your own workaround! :D

As an alternative, you could have forced the HDMI card to be card number 1, but it would have been about the same amount of work to get it working.
Post Reply

Return to “Hardware Support”