Bug 216606

Summary: Inverted pin configuration for sound / ALSA over SN6140
Product: Drivers Reporter: lori.tomasetti
Component: Sound(ALSA)Assignee: platform_other
Status: NEW ---    
Severity: high CC: shestakovicha
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: All from 6.0.2 to 6.1.3 Subsystem:
Regression: No Bisected commit-id:
Attachments: sudo alsa-info scripts results

Description lori.tomasetti 2022-10-19 08:16:00 UTC
Created attachment 303033 [details]
sudo alsa-info scripts results

The problem is related to this specific Codec: Conexant SN6140.

The issue here is the following: the speaker and headsets works normally in Windows 11, but over my Arch distro they are inverted; inverted this way, if i plug in the jack audio the speakers start working normally but if i don't have any jack inserted the audio is not coming out from the speaker but i suppose over the jack. I have tried changing OS, and i have tested it on: Ubunutu 22.04 LTS, with kernel version 5.15, here the bug is a bit different since the audio normally comes out of the speaker but really low, and if i plug in the headphones the audio comes out only from the speaker but at a much higher volume.

I tried the following stuff in order to solve the problem:

1) Installed sof-firmware, without this no audio card was found,
2) Ensured that in alsamixer the Automute was disabled,
2) Recompiled the kernel in order to have the flag: CONFIG_SND_HDA_PATCH_LOADER=y in order to try to apply the inversion of the pin as explained here: https://www.kernel.org/doc/html/v6.0/sound/hd-audio/notes.html#early-patching but even like this no significant result was found, moreover the file in: /sys/class/sound/hwC0D0/user_pin_configs was not edited after the command was lunched.
3) Created a file in the /etc/modprobe.d directory in order to set snd-hda-intel model=generic, but the problem still remained.
4) As explained here https://thesofproject.github.io/latest/getting_started/intel_debug/introduction.html#pci-devices-introduced-after-2016 i created a file in the /etc/modprobe.d directory in order to set options snd-intel-dspcfg dsp_driver=1, in this case the audio problem was fixed but i was not more able to use the microphone, so it was not a solution for the problem.
5) Tried to manually change the configuration with the hdajackretask software but the tool seems to be not effective since the /sys/class/sound/hwC0D0/user_pin_configs and /sys/class/sound/hwC0D0/init_pin_configs were not different after the editing and after the reboot.

It's the first time that i have encounter a bug like this, so if you want me to execute more test i'm happy to help, the alsa-info script was launched and is attached to this bug report. This is also the result from inxi -Fzxx.


System:
  Kernel: 6.0.2-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    Desktop: GNOME v: 42.5 tk: GTK v: 3.24.34 wm: gnome-shell dm: GDM
    Distro: Arch Linux
Machine:
  Type: Laptop System: HUAWEI product: CREF-XX v: M1010
    serial: <superuser required>
  Mobo: HUAWEI model: CREF-XX-PCB v: M1010 serial: <superuser required>
    UEFI: HUAWEI v: 1.20 date: 07/27/2022
CPU:
  Info: 14-core (6-mt/8-st) model: 12th Gen Intel Core i7-12700H bits: 64
    type: MST AMCP arch: Alder Lake rev: 3 cache: L1: 1.2 MiB L2: 11.5 MiB
    L3: 24 MiB
  Speed (MHz): avg: 2613 high: 2700 min/max: 400/4679:4700:3500 cores:
    1: 2700 2: 2700 3: 2700 4: 2700 5: 2700 6: 2700 7: 2700 8: 2700 9: 2700
    10: 2700 11: 973 12: 2700 13: 2700 14: 2700 15: 2700 16: 2700 17: 2700
    18: 2700 19: 2700 20: 2700 bogomips: 107560
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel Alder Lake-P Integrated Graphics vendor: Huawei
    driver: i915 v: kernel arch: Gen-12.2 ports: active: eDP-1 empty: DP-1,
    DP-2, DP-3, HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:46a6
  Device-2: Quanta FHD Camera type: USB driver: uvcvideo bus-ID: 3-7:2
    chip-ID: 0408:1061
  Display: wayland server: X.org v: 1.21.1.4 with: Xwayland v: 22.1.3
    compositor: gnome-shell driver: X: loaded: modesetting
    alternate: fbdev,intel,vesa dri: iris gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: BOE Display 0x092f res: 2520x1680 dpi: 189
    diag: 407mm (16")
  Message: Wayland GBM/EGL data currently not available.
Audio:
  Device-1: Intel Alder Lake PCH-P High Definition Audio vendor: Huawei
    driver: sof-audio-pci-intel-tgl bus-ID: 00:1f.3 chip-ID: 8086:51c8
  Sound API: ALSA v: k6.0.2-arch1-1 running: yes
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.59 running: yes
Comment 1 lori.tomasetti 2022-10-19 08:29:15 UTC
I forgot to mention that connection the headphones over the Bluetooth works without any problem.