-
-
Notifications
You must be signed in to change notification settings - Fork 91
HDMI audio is not working even after hdmi_drive=2 usercfg #34
Comments
Hi there, In case of my Xubuntu install, I had to setup the audio output to HDMI manually. You can do this by forcing PulseAudio to use HDMI out by default. First, you need to check out the available audio sinks. Open up a local terminal (
The output should bring out a list like this:
The currently selected/active audio output sink is marked with the asterisk(*). In this example, I have the 3,5mm analog audio output jack selected. The HDMI audio output is index To swap that one to HDMI, you need to i.e. edit PulseAudio's global default options manually, which I did in my case. Edit the file
Search through the file for a line like this, should be at the bottom of the file:
Usually that is commented out i.e. like this:
Uncomment the line and add in the correct index name of your preferred audio sink, in the case of HDMI output, it is:
Then, try restarting the PulseAudio service. First kill it with: Then check if it's still there: Then restart it: Now, run the audio output sink test again:
If the asterisk has moved from PulseAudio, being what it is, also has a nasty habit of "forgetting" the user's settings. Should PulseAudio forget your preference, see that the line you just added to
Then kill pulseaudio, re-edit Speaking of a nice desktop experience... -- even old versions of Raspbian have a HDMI/analog choice switch that seems to work, unlike the one in Ubuntu. This has been the case for quite a while, I've been running Ubuntu on the RPi4B since v. 18.04 64-bit Server was in unofficial development. My PulseAudio's GUI on the RPi4B doesn't even let me choose any other audio output but the analog one(!). Would be "kinda nice" to have that HDMI/analog selection switch in the panel, but that's just me. Maybe in 2035. The next likely audio woe you'll encounter after you've got the output set up correctly is likely the crackling audio output, especially with load-heavy applications such as video playback on the browser. For that one, you need to apply the I hope this fixed two issues at once. Cheers. |
@pseudofunizer i tried your solution, but it didn't work for me... pulseaudio still defaults back to Edit: Using Ubuntu-Mate*** |
@R3Z1H Did you get it to work between reboots though? Also, have you run the latest Also, have you made sure that the HDMI audio output works in i.e. a Raspbian/PiOS ? That could eliminate some possibilities, such as the HDMI cabling or some other component in the chain being unfit for audio transmission... In any case, does this command show you the two different indexes, one marked with an asterisk(*) like I said in my example?
If you see the entries for index 0 and 1 in the list, then at least you've got both the HDMI and the analog listed. There's a proposal there;
(In your case, it would be In my Xubuntu install, just by typing in |
@pseudofunizer yes I did everything, except I don't understand what u mean by "enabling prerelease version"... I downloaded Ubuntu Server image, then ran Wimpy's Desktopify script.. I did update & upgrade everything.. So every time I boot, I have to manually set the proper sound output to be able to hear from HDMI.. As you mentioned this can be done by running NOTE: just tried using crontab to run that command, but doesn't work for some reason 🙁 |
There's something stuck in between the cogwheels there. When logged in as your typical username, go to your home directory with There should be a
Change that to
and try rebooting? The rationale here is that stuff under Anyway, try that and see what happens. Cheers. P.S. There's this article from 2017: https://ubuntu-mate.community/t/better-control-for-startup-applications/11484 In the abovementioned, it says to look for P.P.S. Sometimes the ALSA audio layer and PulseAudio can be pushing and pulling to their individual directions and thus conflicting with each other, Raspis have always suffered of that -- that's what you get when you have overlapping code-spaghetti and thus, you get what you pay for with Linux. :o) All joking aside, those previous directions ought to get you a few steps further. Once I got my setup tweaked, it's been working ever since from one reboot to another -- (however I do recommend you look up the crackling audio fix once you get the output issue itself sorted out, see #55 if you experience any audio crackling, esp. during web video playback.) Happy tweaking and good luck! |
@pseudofunizer i did what you said, edit But as you suggested, the solution that is working for me now is to add you were right about crontab not working due to PulseAudio resetting the profile after user login. thanks for the solution.. |
Hey, I came up with another possible solution that doesn't require any login scripts, but if the solution you came up with works, well, insert the old saying "don't fix it if it ain't broken" 😄 When I was working on a duplicate of the install that I had, and had to configure the HDMI output on that one. This was all I needed on Xubuntu. Edit the
The idea there is that you set both the That worked for me, after that all users at that endpoint had the HDMI selected as the default. Let me know if that was of any help. Cheers. P.S. I've also noted that often when there's a update related to the kernel or kernel headers, the PulseAudio configuration might become reset altogether, so keep that in mind whenever doing i.e. apt-updating. I'm currently running kernel v.5.8.1002-raspi on Desktopified Xubuntu 20.04.1LTS -- success (and the name of the audio sinks, tbh) may vary between kernel updates (I've noticed that at least on a couple of occasions now...). Add to that the difference between xwindow managers. Oh well. Such is life. |
Desktopify version : master branch at commit
Issue: HDMI audio is not working.
Extra details: Using Ubuntu 20.04. Also I’m using BerryBoot (berry boot link) to boot Ubuntu (Ubuntu image link) off a usb stick if that is relevant.
Description: I can confirm that /boot/firmware/usercfg.txt has the line
hdmi_drive=2
, which should have enabled the HDMI audio. I’m fine with either HDMI audio or audio from 3.5 mm audio jack so any help is appreciated.The text was updated successfully, but these errors were encountered: