[19.10] Problem with my sound

Hello,

So I have just upgraded to 19.10 some days ago and I have ever since been fighting with the sound!

I have 2 audio cards: a HDMI one via my Radeon RX550 and the regular one (onboard) which is a Family 17h.

The problems I have is that: sometimes the sound works and sometimes it does not. Some application will have sound and some others will not. I am mostly focussing on: Firefox(youtube), Audacious(mp3) and SMplayer(videos).

For SMPlayer to work I need to set the Output driver for audio (Options -> Preferences -> Audio tab) from "user defined" and I need to change it back to pulse (alsa_output.pci.0000_0c_00.3.analog-stereo). Problem #1: this configuration does not stay in place and will fall back to "user default" which will cause it not to play audio.

So when SMPlayer is set to that alsa_output and that sound DOES work from it Firefox refuses to play youtube audio. For youtube to now work I need to go back under Control Center -> sound and then reselect "Monitor of Family 17h HD Audio Controller Analog stereo" in the "Input" tab and in the "Output" tab.

That SMPlayer audio problem is also has the same cause than Audacious come to think about.

Lastly, another annoyance with 19.10 is that I have a Daskeyboard ultimate with a volume control on it and it ALWAYS worked perfectly. Now this does not seem to be the case anymore. Sometimes I have audio playing and just moving the audio control from my keyboard does show the big audio icon alongside the volume increasing or decreasing but it doesn't actually do anything.

Finally, sometimes it can take several minutes for the sound to kick in. As in: I have selected the right audio output and doing other things that are not audio related for 2 minutes will just have the audio kick in for NO REASON.

Again, none of this was happening before in the last ... 4 years.

Anybody else having issues w/ their audio??

EDIT: I also needed to specify that after having "fixed" this problem by selecting the right device under the "Output" tab of sound that, leaving my computers for a 30+ minutes period and coming back that HDMI audio selection is automatically resellected under "Output" and hence "audio is not working again".

EDIT2: It is exactly at this point that my volume control on my keyboard stops being "effective" in the sense that moving the wheel up or down will just end up showing the icon on screen instead of actually uppering or lowering down the volume.

@ DLS

if interested you can force the index of your detected sound devices.

Assuming you always use onboard (analog) and not HDMI Assuming you have both intel devices

create a file lets call it /etc/modprobe.d/intel.conf as I leave
/etc/modprobe.d/alsa-base.conf alone.

with contents
options snd_hda_intel id=PCH index=0
options snd_hda_intel id=HDMI index=1

or a one liner of
options snd_hda_intel index=1

its 1 because alsa without any .asoundrc or modprobe file will defaults to choosing hdmi as default IMHO

That solution sounds like it would do the trick however none of my cards are intel:

$ arecord -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
usbstream:CARD=HDMI
    HDA ATI HDMI
    USB Stream Output
sysdefault:CARD=Generic
    HD-Audio Generic, ALC887-VD Analog
    Default Audio Device
front:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Front speakers
dmix:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Direct sample mixing device
dmix:CARD=Generic,DEV=2
    HD-Audio Generic, ALC887-VD Alt Analog
    Direct sample mixing device
dsnoop:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Direct sample snooping device
dsnoop:CARD=Generic,DEV=2
    HD-Audio Generic, ALC887-VD Alt Analog
    Direct sample snooping device
hw:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Direct hardware device without any conversions
hw:CARD=Generic,DEV=2
    HD-Audio Generic, ALC887-VD Alt Analog
    Direct hardware device without any conversions
plughw:CARD=Generic,DEV=0
    HD-Audio Generic, ALC887-VD Analog
    Hardware device with all software conversions
plughw:CARD=Generic,DEV=2
    HD-Audio Generic, ALC887-VD Alt Analog
    Hardware device with all software conversions
usbstream:CARD=Generic
    HD-Audio Generic
    USB Stream Output

$ cat /proc/asound/cards                                                                                                                                                                                    
 0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfce60000 irq 87
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfcd00000 irq 89

Can you please tell me where I can find those "snd_hda_intel" equivalents values?

Ok first hdmi is showing as index=0

can you post your results for lsmod
or
lsmod | grep realtek
lsmod | grep snd

and I think we have same card!
Imgur

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC887-VD Digital [ALC887-VD Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0

proc states you have intel!

Now to be nicer. Change PCH to Generic
full reboot and see if that works.

Do you only wish to have one device (HDMI/onboard) to output sound?

I had issues previously (on 16.04, different computer) and it was due to the power state of the monitor coming up as a different HDMI, so sometimes the sound went off because it was outputting to the wrong output.

I'd suggest installing pavucontrol (PulseAudio Volume Control), since you can disable the one you don't use (onboard in my case)

image

If in the case of HDMI, select the correct output.

image

pavucontrol can be seen as a more detailed version of the built-in Sound preferences in :control_center: Control Center.

I actually have this board:

	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: TUF X470-PLUS GAMING

Which makes things ever odder.

$ lsmod | grep realtek                                                   
snd_hda_codec_realtek   114688  1
snd_hda_codec_generic    81920  1 snd_hda_codec_realtek
ledtrig_audio          16384  2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_codec         131072  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           90112  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd                    86016  23 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi
realtek                20480  1

$ lsmod | grep snd

snd_hda_codec_realtek   114688  1
snd_hda_codec_generic    81920  1 snd_hda_codec_realtek
ledtrig_audio          16384  2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_codec_hdmi     61440  1
snd_hda_intel          49152  7
snd_hda_codec         131072  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           90112  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              20480  1 snd_hda_codec
snd_pcm               106496  5 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  1 snd_seq_midi
snd_seq                69632  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              36864  3 snd_seq,snd_pcm
snd                    86016  23 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi
soundcore              16384  1 snd

$

Nice! All of your assumptions were correct and I believe that you are also dead on the money when referring to the difference in power states. That would be qualified.

I have not only discovered a new utility today but I have also installed pavucontrol and have disabled the HDMI profile per your suggestion, let's see how that holds the road.

On a less positive note, the volume knob on my keyboard is still not supported by this change but we'll see after reboot/time I suppose?

1 Like

Volume up/down keys/knobs should work again after starting a new session (log out or reboot). Sometimes already running programs can be a bit funky when the audio profiles suddenly change. Same thing if you can't change using the volume control applet (until restart).

And that surely fixed it in terms of volume knob.

However I am still having this "fight" in between both of my audio controllers. Actually it seems that after having rebooted Pulse Audio's Configuration are back to both being enabled even though I had disabled HDMI.

Hence, of course, when my screensaver kicks back in I loose my sound again.

Seems odd the screensaver would cause a disabled profile to enable again - unless of course the screen (or system) went to sleep, or there's some other configuration file lingering.

Try blacklisting the driver - that'll prevent the kernel from loading the sound card at all.

  1. Edit /etc/modprobe.d/snd-blacklist.conf as root

  2. Add the line - using your output above I would guess:

    blacklist snd_hda_codec_realtek
    
  3. Reboot or run:

    sudo modprobe -r snd_hda_codec_realtek
    

According to your motherboard's spec sheet, it's a Realtek® ALC887-VD2, sosnd_hda_codec_realtek sounds like the one.

1 Like

Wanting the keep the Realtek/onboard and disable the HDMI I presume this is what I should be disabling under /etc/modprobe.d/snd-blacklist.conf

?

Ah yes, sorry, that should be the one. I got confused by disabling the opposite. :sweat_smile:

Or you confused me as using current millenium technology :smiley:

This bug doesn't occur with the mainline kernel.
If you want a workaround without blacklisting modules, here's the solution.

Automating it by editing /etc/pulse/defaut.pa doesn't work for me so I made a little script.
In short:

1 - List your outputs.
Open a terminal, type pactl list short sinks
This will list your outputs. For instance,
3 alsa_output.pci-0000_02_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz
2 - Set the right output as default.
In order to make this output the default one, type pactl set-default-sink 3.
Replace "3" with the number at the beginning of the line of your desired output when typing pactl list short sinks.

3 - The script:
#!/bin/bash
pactl set-default-sink 1
pactl set-sink-volume 1 100%

Just replace "1" with the number of your output and "100%" with the desired volume. I added the volume setting as only setting the default soundcard would give me low volume as startup.

4- Adding the script on launch.
Save it and make it executable (chmod +x yourfile) or in the permissions tab of the file properties.
Go to your startup applications, add a new one, give it a name and browse to your script as a command.
[Edit] Switches to the wrong sound card again if I turn off and on monitors so assigned it a keyboard shortcut to make it easier.

Hope this helps.

1 Like

Hello,

I had a similar problem on wednesday as I installed Ubuntu 19.10.
Also two sound card, one of it is a on AMD Radeon RX 560 Series.
I wasn't able to set the analog output as default. Because I had very extreme mouse lagging (cursor was "jumping" sometimes) I decided to go back to Ubuntu 19.04.
It's not Mate, I know. But the same base.
Just to let you know. :slight_smile:
Hopefully there will be an update until Januar 2020 (end of version19.10)

1 Like