alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
366 stars 177 forks source link

Cant't open mixer and no sound , helem (MIXER,'Front Mic Boots Valume',0,1,0) appears twice or more #205

Closed WolsYang closed 1 year ago

WolsYang commented 2 years ago

I had try the way in this issue, but not work for me : (

helem (MIXER,'Master Playback Volume',0,1,0) appears twice or more cannot load mixer controls: Invalid argument#47

In default I only can play sound with Back port

Here is my computer audio port look like. codec ALC888-VD ALC888-VD
position Back Front
Function 0:Line Out, 1:MIC 0:Line Out, 1:MIC
Port Num 2 2
HW:dev 0:0 0:2
/sys/class/cound hwC0D0 hwC0D1

OS:Ubuntu 20.04.2LTS $ uname -r

5.13.0-051300-generic

$ amixer

ALSA lib simple_none.c:1544:(simple_add1) helem (MIXER,'Front Mic Boots Valume',0,1,0) appears twice or more
amixer: Mixer default load error: Invalid aggument

$ aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC888-VD Analog [ALC888-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC888-VD Analog [ALC888-VD 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

$ amixer -c 0 controls

numid=18,iface=CARD,name='Front Line Out Front Phantom Jack'
numid=16,iface=CARD,name='Front Mic Jack'
numid=76,iface=CARD,name='Front Mic Jack',index=1
numid=41,iface=CARD,name='HDMI/DP,pcm=3 Jack'
numid=47,iface=CARD,name='HDMI/DP,pcm=7 Jack'
numid=53,iface=CARD,name='HDMI/DP,pcm=8 Jack'
numid=78,iface=CARD,name='Headphone Front Jack'
numid=79,iface=CARD,name='Headphone Surround Jack'
numid=19,iface=CARD,name='Line Out Surround Phantom Jack'
numid=17,iface=CARD,name='Rear Mic Jack'
numid=77,iface=CARD,name='Rear Mic Jack',index=1
numid=15,iface=MIXER,name='Master Playback Switch'
numid=14,iface=MIXER,name='Master Playback Volume'
numid=64,iface=MIXER,name='Headphone Playback Switch'
numid=66,iface=MIXER,name='Headphone Playback Switch',index=1
numid=63,iface=MIXER,name='Headphone Playback Volume'
numid=65,iface=MIXER,name='Headphone Playback Volume',index=1
numid=62,iface=MIXER,name='PCM Playback Volume'
numid=12,iface=MIXER,name='Front Mic Boost Volume'
numid=7,iface=MIXER,name='Front Mic Playback Switch'
numid=6,iface=MIXER,name='Front Mic Playback Volume'
numid=74,iface=MIXER,name='Front Mic Boost Volume',device=1
numid=69,iface=MIXER,name='Front Mic Playback Switch',device=1
numid=68,iface=MIXER,name='Front Mic Playback Volume',device=1
numid=2,iface=MIXER,name='Front Playback Switch'
numid=1,iface=MIXER,name='Front Playback Volume'
numid=4,iface=MIXER,name='Surround Playback Switch'
numid=3,iface=MIXER,name='Surround Playback Volume'
numid=11,iface=MIXER,name='Capture Switch'
numid=73,iface=MIXER,name='Capture Switch',device=1
numid=10,iface=MIXER,name='Capture Volume'
numid=72,iface=MIXER,name='Capture Volume',device=1
numid=5,iface=MIXER,name='Loopback Mixing'
numid=67,iface=MIXER,name='Loopback Mixing',device=1
numid=42,iface=MIXER,name='IEC958 Playback Con Mask'
numid=48,iface=MIXER,name='IEC958 Playback Con Mask',index=1
numid=54,iface=MIXER,name='IEC958 Playback Con Mask',index=2
numid=43,iface=MIXER,name='IEC958 Playback Pro Mask'
numid=49,iface=MIXER,name='IEC958 Playback Pro Mask',index=1
numid=55,iface=MIXER,name='IEC958 Playback Pro Mask',index=2
numid=44,iface=MIXER,name='IEC958 Playback Default'
numid=50,iface=MIXER,name='IEC958 Playback Default',index=1
numid=56,iface=MIXER,name='IEC958 Playback Default',index=2
numid=45,iface=MIXER,name='IEC958 Playback Switch'
numid=51,iface=MIXER,name='IEC958 Playback Switch',index=1
numid=57,iface=MIXER,name='IEC958 Playback Switch',index=2
numid=13,iface=MIXER,name='Rear Mic Boost Volume'
numid=9,iface=MIXER,name='Rear Mic Playback Switch'
numid=8,iface=MIXER,name='Rear Mic Playback Volume'
numid=75,iface=MIXER,name='Rear Mic Boost Volume',device=1
numid=71,iface=MIXER,name='Rear Mic Playback Switch',device=1
numid=70,iface=MIXER,name='Rear Mic Playback Volume',device=1
numid=21,iface=PCM,name='Capture Channel Map'
numid=20,iface=PCM,name='Playback Channel Map'
numid=81,iface=PCM,name='Capture Channel Map',device=2
numid=80,iface=PCM,name='Playback Channel Map',device=2
numid=46,iface=PCM,name='ELD',device=3
numid=59,iface=PCM,name='Playback Channel Map',device=3
numid=52,iface=PCM,name='ELD',device=7
numid=60,iface=PCM,name='Playback Channel Map',device=7
numid=58,iface=PCM,name='ELD',device=8
numid=61,iface=PCM,name='Playback Channel Map',device=8

$ pactl list modules

Card #0
    Name: alsa_card.pci-0000_00_1b.0
    Driver: module-alsa-card.c
    Owner Module: 7
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x81410000 irq 132"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "2284"
        device.product.name = "Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series High Definition Audio Controller"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    Profiles:
        input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
        output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 1200, available: yes)
        output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: yes)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: yes)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5965, available: yes)
        output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: yes)
        output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 865, available: yes)
        output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: yes)
        output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 865, available: yes)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: yes)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: yes)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: yes)
        output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: yes)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: yes)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo
perexg commented 1 year ago

I think it's a kernel issue. The RFC patch:

https://lore.kernel.org/alsa-devel/20230130082118.3267980-1-perex@perex.cz/

perexg commented 1 year ago

Final proposed patch: https://lore.kernel.org/alsa-devel/20230131094215.3545993-1-perex@perex.cz/

It would be nice, if you can test this one.

WolsYang commented 1 year ago

Final proposed patch: https://lore.kernel.org/alsa-devel/20230131094215.3545993-1-perex@perex.cz/

It would be nice, if you can test this one.

Thank you perexg !!

Unfortunately, I don't have that machine now.

If I have any new updates, I'll that you know immediately.

perexg commented 1 year ago

@FlanOfHarmony ?

FlanOfHarmony commented 1 year ago

Thank you for such a quick patch!

To test it I need to build a version of the kernel with your patch right? I never compiled and installed a custom kernel before, so I’ll look into it and take my chance this week-end!

FlanOfHarmony commented 1 year ago

So I kinda forgot to perform the test and I apologize, but I just tested on my 6.1.18-200 kernel (I guess your commit is merged in this one?) and I can now lauch alsamixer without the error. Some bars were quite low and now that I’ve put them to 100%, I can now enjoy a way more decent sound.

The issue should be considered fixed, but I was wondering how do I switch from the ALC1220 sound card at the back to the front one? Looking at alsamixer and pavucontrol, when I plug my headphones on the front panel it detects it and selects ’headphones’ with a plugged in mention, but there’s no sound. I tried fiddling with the different controls to mute/unmute different things (especially the front bar), but I just can’t get any sound from the front panel.

perexg commented 1 year ago

This hardware may require a custom UCM configuration - https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2/HDA/DualCodecs . It would be better to discuss things there. Don't forget to attach output from alsainfo.sh --no-upload .

WolsYang commented 7 months ago

Unfortunately, I don't have that machine now.

If I have any new updates, I'll that you know immediately.

I have the same machine now.

But no luck, still got same error.

wols@wols:~$ uname -a
Linux wols 6.5.0-21-generic #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb  9 13:32:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
wols@wols:~$ sudo dmesg | grep snd
[sudo] password for wols: 
[   14.716855] snd_hda_intel 0000:00:1b.0: Applying patch firmware 'fixDual'
[   15.227749] snd_hda_intel 0000:00:1b.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   15.436575] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC888-VD: line_outs=2 (0x1b/0x14/0x0/0x0/0x0) type:line
[   15.436598] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   15.436607] snd_hda_codec_realtek hdaudioC0D0:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   15.436613] snd_hda_codec_realtek hdaudioC0D0:    mono: mono_out=0x0
[   15.436620] snd_hda_codec_realtek hdaudioC0D0:    inputs:
[   15.436626] snd_hda_codec_realtek hdaudioC0D0:      Front Mic=0x19
[   15.436633] snd_hda_codec_realtek hdaudioC0D0:      Rear Mic=0x18
[   15.509226] snd_hda_codec_realtek hdaudioC0D1: autoconfig for ALC888-VD: line_outs=2 (0x1b/0x14/0x0/0x0/0x0) type:line
[   15.509250] snd_hda_codec_realtek hdaudioC0D1:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   15.509257] snd_hda_codec_realtek hdaudioC0D1:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   15.509264] snd_hda_codec_realtek hdaudioC0D1:    mono: mono_out=0x0
[   15.509268] snd_hda_codec_realtek hdaudioC0D1:    inputs:
[   15.509274] snd_hda_codec_realtek hdaudioC0D1:      Front Mic=0x19
[   15.509280] snd_hda_codec_realtek hdaudioC0D1:      Rear Mic=0x18
[   15.540398] snd_hda_intel 0000:00:1b.0: control 2:0:0:Front Playback Volume:0 is already present
[   15.540504] snd_hda_intel 0000:00:1b.0: control 2:0:0:Front Playback Switch:0 is already present
[   15.540572] snd_hda_intel 0000:00:1b.0: control 2:0:0:Surround Playback Volume:0 is already present
[   15.540638] snd_hda_intel 0000:00:1b.0: control 2:0:0:Surround Playback Switch:0 is already present
[   15.540702] snd_hda_intel 0000:00:1b.0: control 2:0:0:Loopback Mixing:0 is already present
[   15.540763] snd_hda_intel 0000:00:1b.0: control 2:0:0:Front Mic Playback Volume:0 is already present
[   15.540828] snd_hda_intel 0000:00:1b.0: control 2:0:0:Front Mic Playback Switch:0 is already present
[   15.540912] snd_hda_intel 0000:00:1b.0: control 2:0:0:Rear Mic Playback Volume:0 is already present
[   15.540977] snd_hda_intel 0000:00:1b.0: control 2:0:0:Rear Mic Playback Switch:0 is already present
[   15.541043] snd_hda_intel 0000:00:1b.0: control 2:0:0:Capture Volume:0 is already present
[   15.541105] snd_hda_intel 0000:00:1b.0: control 2:0:0:Capture Switch:0 is already present
[   15.541165] snd_hda_intel 0000:00:1b.0: control 2:0:0:Front Mic Boost Volume:0 is already present
[   15.541228] snd_hda_intel 0000:00:1b.0: control 2:0:0:Rear Mic Boost Volume:0 is already present
cat /boot/config-$(uname -r) |grep SND_HDA_CTL_DEV_ID
# CONFIG_SND_HDA_CTL_DEV_ID is not set

cat /etc/modprobe.d/alsa-base.conf | tail -1
options snd-hda-intel ctl_dev_id=1
# Set to zero to avoid alsamixer error, but still got "is already present" in dmesg
wols@wols:~$ pactl list cards 
Card #0
    Name: alsa_card.pci-0000_00_1b.0
    Driver: module-alsa-card.c
    Owner Module: 7
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x81610000 irq 134"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "2284"
        device.product.name = "Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series High Definition Audio Controller"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    Profiles:
        input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
        output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 1200, available: yes)
        output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: yes)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: yes)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5965, available: yes)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: yes)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: yes)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: yes)
        output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: yes)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: yes)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: yes)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: yes)
        output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: yes)
        output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo+input:analog-stereo
FlanOfHarmony commented 7 months ago

Well the ticket got closed as completed so I didn't bother to post here, but with the latest updates (no idea which ones, I just realized by ramdomly testing after a very long time passed by where I didn't retry) I can now output the sound easily to the front jack by selecting the right sound profile and the right audio output after that, without creating any custom file or anything. Which distro are you using?

WolsYang commented 7 months ago

Well the ticket got closed as completed so I didn't bother to post here, but with the latest updates (no idea which ones, I just realized by ramdomly testing after a very long time passed by where I didn't retry) I can now output the sound easily to the front jack by selecting the right sound profile and the right audio output after that, without creating any custom file or anything. Which distro are you using?

I am using Ubuntu 22.04 which kernel is 6.5.0-21-generic

FlanOfHarmony commented 7 months ago

I’m using fedora with kernel 6.7.6. In my audio settings if I select the "Pro audio" audio profile, I can then select "Built-in Audio 4" which outputs to the front jack.

If I do pactl list cards, it finds successfully two cards (#40 and #41), and for each of these cards I have a bigger list of profiles that you, in particular I have some "pro audio" profiles.

I don’t have the technical skill to help you further. Maybe some of the technical people maintaining the repo can find the diff between our two configs.