4

I just set up pc with MSI mag z590. it has Realtek® ALC4080 Codec. The headset jack which placed the front panel does not work. I search for old questions. I found this closest question. Unfortunately, there is no answer. A headset is defined on my sound settings but the sound does not come. my kernel 5.11.0-43-generic and ubuntu ver 20.04 LTS. I can get sound with a Bluetooth headset.

  • 1
    With your motherboard and the front panel connector for the JAUD1, did it ever work? If not, check your wiring. If you are getting sound out of the rear speaker jacks, then there shouldn't be any configuration to make the front jack work. I would definitely check the wiring. https://download.msi.com/archive/mnu_exe/mb/E7D08v1.0_v2.0.pdf page 35 – Terrance Dec 31 '21 at 01:02
  • Even if this is not your first time building a PC, the front panel wiring can be complicated because it's not always consistent between motherboards and cases. Make sure that everything is wired correctly. – Nmath Dec 31 '21 at 05:12
  • the Front JAUD1 is wired. when I plug in my headset, it is selectable from sound settings. – Burak Esen Dec 31 '21 at 16:04
  • I would still check the wiring. Those things are crazy touchy, and it's way too easy to get the wrong wire to the wrong pin. If your headset is selectable, then it sounds like it is not an OS problem. You can try to eliminate that by booting to a Live USB and testing that way. – Terrance Dec 31 '21 at 22:06
  • I'm sure that it is wired where it should be. I think alc4080 is not supported or somehow the computer tries to run with the wrong driver. – Burak Esen Jan 01 '22 at 20:04
  • It very well could be running the wrong driver. There is no information out there for the ALC4080 chipset, not even on Realtek's site, unless there is a driver of another version that is compatible, but I can't seem to find one for you. Anyway, if you run sudo lshw -C sound it will show both the product chipset as well as the driver it is loading for it. – Terrance Jan 02 '22 at 02:57
  • It looks like they kind of group all audio drivers into one: https://www.realtek.com/en/component/zoo/category/pc-audio-codecs-high-definition-audio-codecs-software – Terrance Jan 02 '22 at 03:09
  • result 1-sudo lshw-C sound *-usb:1
    description: Audio device product: USB Audio vendor: Generic physical id: 5 bus info: usb@1:5 version: 0.03 capabilities: usb-2.00 audio-control configuration: driver=snd-usb-audio maxpower=100mA speed=480Mbit/s
    – Burak Esen Jan 02 '22 at 04:20
  • result 2-sudo lshw-C sound *-multimedia description: Audio device product: Intel Corporation vendor: Intel Corporation physical id: 1f.3 bus info: pci@0000:00:1f.3 version: 11 width: 64 bits clock: 33MHz capabilities: pm msi bus_master cap_list configuration: driver=snd_hda_intel latency=32 resources: irq:16 memory:92510000-92513fff memory:92000000-920fffff – Burak Esen Jan 02 '22 at 04:20
  • Until the day the new driver is written, I will manage with solutions that I can use the rear inputs. I hope they are working properly I don't have the proper equipment to try right now. – Burak Esen Jan 02 '22 at 04:28
  • This thread provides a manual switching solution - tested it to work:

    https://bbs.archlinux.org/viewtopic.php?id=272523

    – stason Mar 31 '22 at 03:41

2 Answers2

3

Update: Once my Ubuntu has updated the alsa package to version 1.2.8 (check with the command alsaucm --version) I was able to make my card work just by installing alsa-ucm-conf version 1.2.10 with the instructions they provided in this README. Remember to run the tar xvzf command from the instructions with sudo. Once you are done, reboot, enjoy!

I had the same issue and fixed it with the latest alsa UCM configuration. The alsa UCM configuration comes from the alsa-ucm-conf package. Updates to the alsa-ucm-conf package will wipeout the modifications you are doing here, so make backups and keep notes of what worked so you can easily restore your changes after eventual updates to alsa-ucm-conf. My fix is very similar to the other one that's listed here, however it manages to avoid the need to install a new version of alsa-lib. Other people landing here should know that it also depends on the motherboard you have, but I'll cover that as well. The ALC4080 chipset appears as a USB Audio device, so keep that in mind.

Now look at the file ucm2/USB-Audio/USB-Audio.conf specifically at the If.realtek-alc4080 block (delimited by the outside braces). If you see your motherboard in the comments, great! You can just use the block as is and skip the next step.

If you don't see your motherboard, don't worry, we'll still get it working. Run the following command:

    lsusb

You'll need to extract from there the id of your USB Audio card. It's different on every motherboard. Here's what mine looks like:

    Bus 001 Device 002: ID 42ab:4a5c ASUSTek Computer, Inc. USB Audio

So mine is 42ab:4a5c. Remember to look for the line that contains "USB Audio". If you see multiple lines with USB Audio, you might have some USB headset or audio device, unplug it then try again.

Now edit /usr/share/alsa/ucm2/USB-Audio/USB-Audio.conf on your system (save a backup before doing it to be on the safe side) and add the entire If.realtek-alc4080 block from ucm2/USB-Audio/USB-Audio.conf including the If.realtek-alc4080 text to your USB-Audio.conf file.

If you're motherboard is not listed, replace the entire line starting with Regex "USB(..." with Regex "USB<your usb id from lsusb>". So for my motherboard it would be Regex "USB42ab:4a5c"

Then copy ALC4080.conf and ALC4080-HiFi.conf to /usr/share/alsa/ucm2/USB-Audio/Realtek/ALC4080.conf and /usr/share/alsa/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf respectively.

What you are doing copying these files is basically providing alsa with the configuration necessary to understand how to communicate with the ALC4080 chipset.

Now we have to figure out if your alsa's libraries can understand these configuration files. These steps are necessary because the syntax used in these files is "new" syntax (syntax 6 apparently) which only newer alsa libs can understand (I don't know exactly which version). Lets try to load this new configuration and see if it works.

    alsaucm -i
    open USB-Audio
    listcards

The command alsaucm -i takes you to the interactive mode of alsaucm. Then with open USB-Audio you are telling it to try and load configuration for USB Audio. If at this point you get errors, we'll need to edit the configuration files to take out the syntax it cannot understand. If you get no errors and see some nice output after running listcards, congratulations, restart and try out your Audio capabilities.

If however you get errors, you'll need to edit /usr/share/alsa/ucm2/USB-Audio/Realtek/ALC4080.conf and replace everything with

    Comment "USB-audio on Realtek ALC4080"
    SectionUseCase."HiFi" {
        File "/USB-Audio/Realtek/ALC4080-HiFi.conf"
        Comment "HiFi 2.0 Channels"
    }
    # SectionUseCase."HiFi 5+1" {
    #   File "/USB-Audio/Realtek/ALC4080-HiFi.conf"
    #   Comment "HiFi 5.1 channels"
    # }
    # SectionUseCase."HiFi 7+1" {
    #   File "/USB-Audio/Realtek/ALC4080-HiFi.conf"
    #   Comment "HiFi 7.1 channels"
    # }

This is my attempt at translating to the old syntax style. You also need to edit /usr/share/alsa/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf and remove the 2 lines that start with Variant."HiFi.....

Now, if you've been paying attention you've probably noticed that ALC4080 has 3 operating modes. These operating modes are describe in my motherboard manual, the 3 operating modes are either 2.0 channels, or 5+1 or 7+1. In future versions of the alsa-ucm-conf these will work separately. But right now we'll have to hardcode one of those modes. In case you are just using your headset, you can skip changing the PlaybackChannels and move to the validation step below. In case you are using 5+1 you'll need to replace the PlaybackChannels 2 line with PlaybackChannels 6 and if you are using 7+1, then you'll have to replace it with PlaybackChannels 8. You can also do this by commenting/uncommenting lines (a comment starts with #) as it was done in the new ALC4080.conf above. You may also comment/uncomment the appropriate section for you in ALC4080.conf above if you want to see the appropriate title, although it is not strictly necessary. Unfortunately I don't know this format well enough to provide a solution for all 3 modes of operation. So if you want to switch between them, you'll need to edit these files appropriately and restart your computer.

Now let's try again to validate the configuration. Run these again

    alsaucm -i
    open USB-Audio
    listcards

You should not get any errors and upon running listcards you should see a card listed, probably called "Generic USB Audio". This should finally work now. Restart and check to see if it works.

  • Tried this, but still it gives me errors: ALSA lib parser.c:2021:(parse_master_file) Incompatible syntax 6 in USB-Audio.conf and ALSA lib main.c:1412:(snd_use_case_mgr_open) error: failed to import USB-Audio use case configuration -22 – Nicholas Redi Dec 13 '23 at 08:56
  • do alsaucm --version to see version. If you have version 1.2.7 or above it should probably be easier than the instructions above. This is because, from what I gather from the Alsa project changelogs it seems like syntax 6 is supported by this version and up. In this case, all you need to do is install a more recent alsa-ucm package like 1.2.9 or 1.2.10. Search for your MoBo in the changelogs. – Tudor Sidea Dec 14 '23 at 15:16
  • alsaucm --version reports 1.2.8 version and I confirm I can see my MoBo (MSI MAG Z690 Tomahawk Wifi) in the changelogs related to this version. – Nicholas Redi Dec 15 '23 at 08:48
  • @NicholasRedi it should work for you then. I think your issue is different and probably the instructions on this page won't help. Probably try to play around with switching Audio Profiles from your Audio section in System Settings or from your System Tray. I use headsets, so I need the "HiFi 2.0 channels" profile. If i'd be using a nicer setup with more jacks, I'd probably need "HiFi 5.1 channels" or even "HiFi 7.1 channels". Take a look at your mobo manual to see all the different audio setups that you can have with the ALC4080. – Tudor Sidea Dec 16 '23 at 10:08
  • Thanks! It worked for me. Despite my mobo (ROG STRIX B650-A GAMING WIFI) was not listed in the comments section, it had the same ID (0b05:1a52) as ASUS ROG Strix X670E-F and Z790-E Gaming Wifi. I'm a lucky man. – felipsmartins Mar 11 '24 at 01:31
2

I had and fixed the the same issue, and tl;dr you're probably better off waiting for the latest alsa version to make it into a stable ubuntu repo than trying to fix it now.
If you want to fix it now, here's what I did:

  • First, you can rule out wiring & codec issues by playing audio directly through aplay (source):

    aplay -D plughw:Audio,1 /usr/share/sounds/alsa/Front_Left.wav
    
  • Once you have verified that, you can look at the latest USB-Audio config in the alas-ucm-conf repo for your board. lsusb | grep -i audio will also help you find the exact USB ID and match it to the regex there, as will various related GH issues

  • Then you have to somehow get the latest config + a version of alsa-lib that can parse it.
    The former is easy - just clone the repo, checkout master or 1.2.7.2, and run the following from the root of the repo:

    git clone https://github.com/alsa-project/alsa-ucm-conf && cd alsa-ucm-conf
    # git checkout 1.2.7.2 if you don't want master
    # take a a backup
    sudo mv /usr/share/alsa/ucm2 /usr/share/alsa/ucm2_bak/
    # link ucm2 config to the shared config dir
    sudo ln -s `pwd`/ucm2 /usr/share/alsa/ucm2
    
  • Installing a version of alsa-lib that can actually parse the config is more tedious, which is why I recommend waiting. Probably best to build from source (not what I did, see 1).

  • Finally, once you have both the config and a version of the library that can parse it:

    alsaucm reload
    pulseaudio -k && pulseaudio -D
    

Hope that all helps.

1: Instead of building from source, I didn't know what I was doing, so I naively added bookworm to my /etc/apt/sources.list so I could get alsa-utils 1.2.7.1, which somehow broke my DNS resolver so I strongly recommend not doing this. Again, probably installing from source is the way to go but I haven't seen any advice on how to do so.

micimize
  • 121
  • Had the same problem with a GigaByte B6501 Aoris Ultra, and Arch linux. Luckily Arch has the latest version of alsa libs, so I just needed to replace my ucm2 directory with the copy from github. Thanks for great instructions! – M Conrad May 04 '23 at 23:06