Asus Rog Strix G512LV speakers do not work, headset works fine

Hello,

I have an ASUS ROG Strix G512LV. I recently installed Fedora 35 and found that the speakers are not working. The headset is working correctly (notice that it’s plugged in a combojack). I also notice that the volume control detects the speaker when I play something (I see the KDE volume control go up and down) but there is no sound at all.

I read a post where someone said that adding the line: options snd_hda_intel model=asus-zenbook makes it work and it does, but then, the headset’s microphone stops working, it’s not even detected. I’ve tested a few other model values without luck.

You could read here. Especially this comment here and here.

If you stiil having trouble, feel free to ask here again.

I feel a bit lost about how to config pipewire. Please look at some outputs I have:

lspci | grep Audio
00:1f.3 Audio device: Intel Corporation Comet Lake PCH cAVS
01:00.1 Audio device: NVIDIA Corporation TU106 High Definition Audio Controller (rev a1)
aplay  -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC294 Analog [ALC294 Analog]
  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
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC294 Analog [ALC294 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
pw-record --list-targets
Available targets ("*" denotes default): alsa_input.pci-0000_00_1f.3.analog-stereo
*       43: description="Built-in Audio Analog Stereo" prio=2009

Now, this command produces sound successfully in the headset: speaker-test -Dhw:0,0 -c2, but the speakers do not work.

Hi, please try this github-gist, on the top right there a download button. Extract it and place it under /home/<yourusername>/.config/pipewire/pipewire.conf.

After that, close all window and leave only the terminal. Run systemctl restart --user pipewire and systemctl restart --user wireplumber.

Unfortunately, it does not work. Interestingly this created a new speaker device in the audio devices, but still have no sound in neither of those options.

If you check the downloaded file, at bottom, there a line:

# This for your speaker.
    { factory = adapter
        args = {
            factory.name           = api.alsa.pcm.sink
            node.name              = "alsa-sink"
            node.description       = "Speaker"
            media.class            = "Audio/Sink"
            api.alsa.path          = "hw:0,0"
            audio.channels         = 2
            audio.position         = "FL,FR"
        }
    }

Notice with api.alsa.path = "hw:0,0" and audio.channels = 2, It’s based on your speaker-test -Dhw:0,0 -c2(I just realized it for your headset, I must be not read your comment above).

Try again with unplug your headset. And test with speaker-test find which hw:X,Y number your speaker. Change the downloaded pipewire.conf accordingly.

You could also continue with run wpctl status and find part with:

Audio
 ├─ Devices:
 │      40. Built-in Audio                      [alsa]
 │      41. Built-in Audio                      [alsa]
 │  
 ├─ Sinks:
 │    44. Built-in Audio Pro                  [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   45. Built-in Audio Pro                  [vol: 1.00]
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

Find on the tree Audio > Sinks. Make a note the number, on above example the number is 44. Then run wpctl set-default 44

I tested all the combinations for hw:X,Y but none of them produces sound in the speakers.

This is the output for the wpctl status:

Audio
 ├─ Devices:
 │      39. TU106 High Definition Audio Controller [alsa]
 │      40. Built-in Audio                      [alsa]
 │  
 ├─ Sinks:
 │      41. TU106 High Definition Audio Controller Digital Stereo (HDMI) [vol: 1.00]
 │  *   42. Built-in Audio Analog Stereo        [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   43. Built-in Audio Analog Stereo        [vol: 0.68]
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:
        75. Firefox                                                     
             57. output_FR       > HDA Intel PCH:playback_FR
             71. output_FL       > HDA Intel PCH:playback_FL

Video
 ├─ Devices:
 │  
 ├─ Sinks:
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

I’m also giving a shot to this guide

From your link and since you only have one analog sound card, from hdajackretask there should be mention Headphone and Internal Speaker, can you find it? I suspect the internal speaker are currently have Connectivity as Jack? Here my setup if you can find the internal speaker from that app.


If it need change the pin, I never have experience because usually it need to compare with Windows driver pin.

This is what I have

4bb11422e9de491637f90c539ed01b0c9b2bfd9a.png
6ffb673ebe3f88e6fb4ba8c9adda1c9503e74530.png

It’s beyond my knowledges. But if you want to continue, I’ll happily to give my thoughts.

I manage to make everything work, I’ll give you some details about what I did:

First, I knew that by default the headset was working just fine.

Second, I knew that if I created a file under /etc/modprobe.d/alsa-base.conf with the following: options snd-hda-intel model=asus-zenbook I was able to make the speakers work.

So, I decided to create a dump of the codecs (with the headphones plugged) before and after I applied the asus-zenbook.

To create the dump I booted my pc and did the following (as root):

  1. echo 1 |sudo tee /sys/module/snd_hda_codec/parameters/dump_coef
  2. cat /proc/asound/card0/codec#0 > lin_codec_auto-dump

Then I modified the /etc/modprobe.d/alsa-base.conf and added the line options snd-hda-intel model=asus-zenbook and repeated the proccess above:

  1. echo 1 |sudo tee /sys/module/snd_hda_codec/parameters/dump_coef
  2. cat /proc/asound/card0/codec#0 > lin_codec_asus_zenbook-dump

Then I commented the line I added in /etc/modprobe.d/alsa-base.conf to leave everything as it originally was, then rebooted.

I performed a vimdiff between the 2 files vimdiff lin_codec_auto-dump lin_codec_asus_zenbook-dump and found the following:

The Coeff for the Node 0x20 were different:

Coeff 0x0f: 0x7774 | Coeff 0x0f: 0x7778
Coeff 0x40: 0x8800 | Coeff 0x40: 0x0800

The default connection for Nodes 0x21 and Node 0x17 were different

Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
...
  Connection: 3
     0x02 0x03* 0x06

vs

Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
...
  Connection: 3
     0x02 0x03 0x06*
Node 0x21 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
...
  Connection: 2
     0x02* 0x03

vs

Node 0x21 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
...
  Connection: 2
     0x02 0x03*

To fix the Coeff I used these commands:

hda-verb /dev/snd/hwC0D0 0x20 0x500 0x0f
hda-verb /dev/snd/hwC0D0 0x20 0x400 0x7778

hda-verb /dev/snd/hwC0D0 0x20 0x500 0x40
hda-verb /dev/snd/hwC0D0 0x20 0x400 0x0800

And suddenly the speakers started to work and if I connect the headset it works perfectly (both mic and headphones)

But I still have 2 issues:

  1. If I play something, for example, a video on youtube and I execute those commands the speaker works but once I close the tab and reopen to play something else I have to execute those commands again.

  2. I have to execute those commands after every reboot.

1 Like

Source: kernel.org - More Notes on HD-Audio Driver

From above docs, I think there are 2 posible ways that maybe you want to try:

  1. By adding the verbs you changed to file /sys/class/sound/hwC0D0/init_verbs. (please find the part HD-Audio Reconfiguration).

  2. Creating kernel patch (please find part Early Patching).

    By default, Fedora kernel look like already allowed us to create custom patch for hd-audio.

    [testcase@fedora sections]$ cat /boot/config-5.15.12-200.fc35.x86_64 | grep CONFIG_SND_HDA_PATCH_LOADER
    CONFIG_SND_HDA_PATCH_LOADER=y
    

Unfortunately, the early patching does not work. I can see they are updated in the /sys/class/sound/hwC0D0/init_verbs but it doesn’t work. Another thing I notice is that if I set the verbs while playing something it works but as soon as I pause and replay I lose the speaker’s audio, did some debugging and found that pipewire is resetting the verbs everytime I pause and play something.

May be it’s time to report it to bugzilla.

Btw we are lucky here since the maintainer for Alsa firmware here in Fedora (look like) also the maintainer of upstream Alsa firmware.