Headphone audio not working ASUS Rog Strix Z590-F / ALC4080

Have asked alsa-user, but also checking here in case anyone has recommendations.

I have a recent Asus ROG Strix Gaming motherboard (Z-590F).
The sound hardware is ALC4080.
hints and pin configuration are required for these cards I believe,
because currently

  • front audio headphone connector is labelled as Audio Pro 1
  • auto switching to front audio headphone connector when headphones
    plugged doesn’t work

My kernel is: Linux fedora 5.15.6-200.fc35.x86_64
Hardware is: ROG STRIX Z590-F GAMING WIFI
Alsa-info output at:
http://alsa-project.org/db/?f=131d4da535c4ec4545c74616f83f393f1c9152dd

Can someone assist with a patch for correct hints and pin
configuration, or point me to steps to work these out?

I just want to clarify, did the audio not work if you connect your speaker on the front panel of your PC case?

Are you have other OS (like Windows) to confirm if your front panel speaker working properly?

Also are you already connecting your front panel audio connector to audio pin on your motherboard 2.1.9 Front I/O connector - Manual?

Thanks Syaifur,
My case (BeQuiet Silentbase 802) has audio connectors (3.5mm I think) marked for headphones and microphone on the top front. The problem relates to the one of these connectors marked for headphones.

To answer your both other questions - I can confirm that the headphone socket/connector on the panel is correctly wired and working properly, because I do have Windows 10 installed also and the functionality is ‘as expected’ there. That is:

  • when plugging in headphones to front-panel connector, audio output switches to headphones
  • OS reports that ‘Headphones’ are in use

In LInux neither is true. Plugging headphones has no effect on output. I can get output from headphones through a device labelled ‘Audio Pro 1’ (incorrectly labelled).

I’m reasonably sure that this is an Alsa issue based on information from this Reddit post :https://www.reddit.com/r/linuxquestions/comments/p7xbna/no_headphone_sound_alc4080/

Hi, found same problem on openSuse forum and there looks like they found a workaround. But please be aware Fedora 35 already using Pipewire as sound server and from thus forum still using PulseAudio. Audio Front Ports No Sound ALC4080.

Update:

Actually, you could change default behavior of your jack audio with HDAJackRetask. In my laptop, I can change the behavior of my internal speaker not to mute when I plug in the headphone. So I can get both sound comes from laptop internal speaker and from headset.

But first, make sure your front speaker are detected by alsa. You could check it by plug in your headphone to front panel, then from terminal run alsamixer. It will show mixer in terminal mode.

Press F6 and select your appropriate sound card with arrow up/down then enter. Press F5 to show all available mixer.

Use arrow key left/right and find any volume slider that labeled with [MM] (MM for muted). Then press M on keyboard to toggle to [00] or unmute. If you’re sure you get the sound come to your headphone, take a note the name presented on the current volume slider. Let say Headphone.

Install alsa-tools. It will give you lot of GUI tools, one of them HDAJackRetask, open it.

On the top left select from drop down menu your appropriate sound card (same as when in amixer). Then on the top right. mark “Advanced Override”. It will give you extra option on main item list.

Find device with name same as you found in amixer, let’s say Headphone then mark with override.

The possible options to change are “Location”, “Device”, “Jack detection”, and “Channel”.

To get the behavior like internal speaker that always online, I change as picture bellow:

Click: Before

Click: After

Or you could experiment with other values.

Then “Apply” and “Install boot override” and reboot.

Warning: Please be careful and don’t forget to make a note on each steps.

2 Likes

Hello.

I think I have the same problem.

I have ASUS Rog Strix Z690-G which also have ALC4080.

On windows 10 its functional, but on fedora I only get sound from Line out, on gnome it appears as “Usb Speaker”(translated).

The reason that I am searching the forums it is that I do not have microphone sound input, and the only sound I get from microphone it is the same sound that I am hearing.

But when I saw your post i tried to check and the same thing happens.

When I plug in the front-panel It appears as “Heaphones” but the sound continues to come from Line out.

Tried the solution here but…

On alsamixer it is not the HDA Audio PCH but it is the USB Audio.

If I set Analog In to “0” it stops looping sound.

I did install alsa-tools and run hdajackretask, only appears the sound from GPU and no USB Audio.

I tried to change everything in PulseAudio Volume Control but sound continues to come out in line out, no microphone and no sound/mic from front panel.

lspci | grep Audio
00:1f.3 Audio device: Intel Corporation Device 7ad0 (rev 11)
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 HDMI Audio

lsusb | grep Audio
Bus 001 Device 002: ID 0b05:1996 ASUSTek Computer, Inc. USB Audio

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Audio [USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
Subdevices: 1/1
Subdevice #0: subdevice #0

pw-record --list-targets
Available targets ("*" denotes default): alsa_input.usb-Generic_USB_Audio-00.analog-stereo

  • 129: description=“USB Audio Estéreo Analógico” prio=2009

Alsa Info

I hope this helps to try to find a solution.

In my attempts to troubleshoot, I found this resource which looks very promising as a process to find a fix/patch:
https://asus-linux.org/blog/sound-2021-01-11/

However - I hit two problems in trying to follow it:

  1. it expects that the sound card should have a codec#0 file under /proc/asound/card/codec#0 . On my machine, only the GPU sound HDMI/DP has such an entry. The USB Audio card which is detected has a bunch of subdirectories like pcm0c/sub0, but these don’t in turn contain coded#0
  2. I tried hdajackretask and the only card it shows (per Hugo above) is the GPU sound.

Little update

First I tried

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 3: USB Audio [USB Audio #3]
Subdevices: 1/1
Subdevice #0: subdevice #0

If I run

speaker-test -Dhw:2,0 -c2
line out works
no sound from front panel

speaker-test -Dhw:2,1 -c2
front panel works
no sound from line out

But recording is my problem so following the same example I tried more steps

arecord -l

**** List of CAPTURE Hardware Devices ****
card 2: Audio [USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
Subdevices: 1/1
Subdevice #0: subdevice #0

To my surprise when I runned

arecord -f cd -t wav -d 5 -r 44100 -Dhw:2,2 test-mic.wav

The sound from the microphone was recorded.

Now I do not know how to change gnome or pipewire to make everything work.

Would you like to run this script? Copy-paste bellow script and save it as asaound.sh. Then run from terminal bash asaound.sh. Post the result you get from terminal and post it here.

#!/bin/bash
# asoundrc v0.1.0 20090101 markc@renta.net GPLv3
# asoundrc v0.2.0 20090320 quatro_por_quatro@yahoo.es GPLv3
#
# A simple script to create a particular default audio device regardless
# of what cards are loaded or in what order. It could be used anytime or
# placed in a ~/.bashrc script for a persistent setup every login.
#
# Usage: asoundrc [DEFAULT_CARD] > ~/.asoundrc

# use the first parameter as the card name, or else
# look for the sound card, discarding those that are only microphones
# when there are multiple cards, use the first one
if default_card="${1:-$(cat "$(for f in $(ls -1 /proc/asound/card[0-9]*/{midi,codec}* 2>/dev/null); do echo "${f%/*}"; done \
| sed -e '\|^[\[:blank:]\]$|d' -e 'q')/id" 2>/dev/null)}"; then
   echo "Using sound card: ${default_card}" >&2 
   cat /proc/asound/card[0-9]*/id | \
   gawk --assign default_card="${default_card}" \
'{print "pcm."$1" { type hw; card "$1"; }\nctl."$1" { type hw; card "$1"; }" }
END {print "pcm.!default pcm."default_card"\nctl.!default ctl."default_card}'
else
   echo "Warning: No sound cards found." >&2
fi

Maybe we could customized it with asound configuration.

This is what I got:

Using sound card: HDMI
pcm.PCH { type hw; card PCH; }
ctl.PCH { type hw; card PCH; }
pcm.HDMI { type hw; card HDMI; }
ctl.HDMI { type hw; card HDMI; }
pcm.Audio { type hw; card Audio; }
ctl.Audio { type hw; card Audio; }
pcm.!default pcm.HDMI
ctl.!default ctl.HDMI

From the link you share, you could find the appropriate card with go to cd /proc/asound. In there you’ll find card0, card1, card<number>. Inside each those card, there a file name id. Open it with cat /proc/asound/card0/id or cat /proc/asound/card1/id or cat /proc/asound/card<number>/id. Use the folder that have id you looking for.

Hi, first please try this one bellow. Place it in your user home directory and give it name .asoundrc, don’t forget the dot part.

# Place this in /home/yourusername/.asoundrc

pcm.FHeadphone {
    type hw
    card Audio
    device 1
}

ctl.FHeadphone {
    type hw
    card Auido
    device 1
}

pcm.!default pcm.FHeadphone
ctl.!default pcm.FHeadphone

Plug in your headphone to appropriate place. Log out your pc then login again. After that play any music. If you could hear the sound, it’s good. If no, no need to continue to test bellow configuration.

Same as before, place in /home/yourusername/.asoundrc.

pcm.FrontPanel {
        type asym
        playback {
                pcm {
                        type hw
                        card Audio
                        device 1
                    }
        }
        capture {
                pcm {
                        type hw
                        card Audio
                        device 2
                    }
        }
}

ctl.FrontPanel {
    type hw
    card Audio
}

pcm.!default pcm.FrontPanel
ctl.!default ctl.FrontPanel

Same as before, logout your account and login again then try to play a music. If this second configuration didn’t work, use the first one.

Thank you Syaifur.

I did tried your solution but it did not work.

I think it is pipewire related and after a little reading I found this way:

I made a .config/pipewire folder in my home partition

mkdir ~/.config/pipewire

Copied pipewire.conf to the new folder

cp /usr/share/pipewire/pipewire.conf ~/.config/pipewire/pipewire.conf

Edited the file ~/.config/pipewire/pipewire.conf

In context.objects added this in the end before the end of brackets ] :

{ factory = adapter
args = {
factory.name = api.alsa.pcm.source
node.name = “alsa-source”
node.description = “Supreme FX 4080 Mic”
media.class = “Audio/Source”
api.alsa.path = “hw:2,2”
}
}
{ factory = adapter
args = {
factory.name = api.alsa.pcm.sink
node.name = “alsa-sink”
node.description = “Supreme FX 4080 FP Headphones”
media.class = “Audio/Sink”
api.alsa.path = “hw:2,1”
audio.channels = 2
audio.position = “FL,FR”
}
}

Saved the file

I assumed Sink as an output and Source as an input.

Executed

systemctl --user restart pipewire

And then all the things started to work.

Front panel microphone and Line In are together and both are working.

The sound was already working in Line Out but now it is also working in front panel.

I noticed that removing and connecting sometimes it does not refresh and then just run:

systemctl --user restart pipewire

This trick did work for me but I do not know if it will work for you David.

2 Likes

Interesting. Could you give some favor to try to change your pipewire configuration hw:2,2 and hw:2,1 to hw:Audio,2 and hw:Audio,1? Is it still work?

In asoundrc we can replace the card number by using card name so regardless the the position of the card order, it still work (like an arbitrary search). We can find the name from command aplay -l for sink and arecord -l.

Yes it works indeed.

But USB audio in my case is card number 2.

A thing I noticed if you start the computer without cable being plugged in pipewire stops to work and then I need to reboot computer because a simple restart to the service does not work.

And I noticed I copy pasted wrong is not

systemctl --user restart pipewire

but

systemctl --user restart pipewire.service

Thank you. It’s for @dchalmers, so he only need to guess the device number from 0 to 3.

Above command are same. If we not specified the type (after dot), systemctl will execute the .service type.

But I think the second command are a good practice since there also .target and .socket .

Did you means that the pipewire configuration not working if the heaphone not plugged during the boot?

By the way, if you like to thinker, check this file /usr/share/alsa/cards/USB-Audio.conf (this file that make me come to .asoundrc) then check /usr/share/alsa/ucm2/USB-Audio/Realtek.

It really depends, best is to check first what is running :
systemctl --user status pipewire.* #this shows all at once
Restart all of them at once:
systemctl --user restart pipewire.*
More details:
man systemctl

Thanks for useful information. I will give these configurations a try and report back.
It sounds like this solves only for having headphones plugged in a boot or manually switching to the appropriate configuration.
To solve for switching to appropriate sink when headphones are plugged in, will we need acpi_listen? (audio - Detecting headphone connection/disconnection in Linux - Unix & Linux Stack Exchange)
Ultimately it feels like we need to work with pipewire and alsa downstream to see if this can be made to work ‘out of the box’.

With asoundrc there type plug for plugged in trigger.

For finding which card for your front headphone jack, you could use steps by @bojador above here.

Bellow I recreate ~/.asoundrc above base on that (need logout and login again).

pcm.FrontPanel {
    type asym
    playback {
        type plug
        slave.pcm {
            type hw
            card 2
            device 1
        }
        slave.channels 2
    }
    capture.pcm {
        type plug
        slave.pcm {
            type hw
            card 2
            device 2
        }
    }
}

Yesterday, I forgot to share the best sources I can get about creating ~/.asoundrc:

  1. Alsa Opensrc Org - Independent ALSA and linux audio support site
  2. Asoundrc - AlsaProject
1 Like

Thanks Syaifur - that is very helpful I will try.
Just to confirm - I can follow Hugo’s instructions to create a Sink which appears in Pipewire, which does help to solve one of my problems (that my devices aren’t descriptively labelled - my Headphones just appear as ‘USB Audio Pro 1’ (at least in the KDE Sound widget).
Now that I have a good handle on which device actually IS my front headphone jack, I will look the around plug stuff to see if I can get plug detection working and report back.
Thinking about this, I realise that solving this entirely so that it works ‘as expected’ (i.e how it works in Windows) will involve multiple parts to a solution:

  • correct labelling of the devices (useful names like ‘Headphones’)
  • detection of plug events
  • switching of default sink on plug event
  • muting of speak sinks on plug event
  • switching everything back on ‘unplug’ event