Skip to content

sof errors on Lenovo Yoga C940 with cpu Cannon Lake i9-9880H [BUG] #2020

Closed

Description

@aleksfadini

Sound is working erratically

 dmesg | grep sof-audio-pci
[    4.570817] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.571127] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.571142] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.571357] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.765849] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.770549] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    4.813221] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[    4.813223] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.815551] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[    4.815554] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[    4.939261] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:4:2-66a5a
[    4.939263] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:11:0 Kernel ABI 3:12:0
[    4.939550] sof-audio-pci 0000:00:1f.3: firmware boot complete
[    4.944470] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:11:0 Kernel ABI 3:12:0
[    4.944474] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp3 Tx not handled
[    4.945672] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec0_in not handled
[    4.945674] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp2 Tx not handled
[    4.946676] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec1_in not handled
[    4.946680] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp1 Tx not handled
[    4.947568] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec0_out not handled
[    4.947570] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Analog CPU Playback not handled
[    4.948487] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec1_out not handled
[    4.948488] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Digital CPU Playback not handled
[    4.948490] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec2_in not handled
[    4.948491] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Alt Analog CPU Playback not handled
[    4.948494] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec2_out not handled
[    4.948496] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Analog CPU Capture not handled
[    4.949477] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp1_out not handled
[    4.949479] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Digital CPU Capture not handled
[    4.950620] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp2_out not handled
[    4.950622] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Alt Analog CPU Capture not handled
[    4.951550] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp3_out not handled
[    4.964808] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[   12.078072] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   12.213026] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   33.018026] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   33.148565] sof-audio-pci 0000:00:1f.3: firmware boot complete
[ 1063.565722] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[ 1063.699750] sof-audio-pci 0000:00:1f.3: firmware boot complete
[ 1305.411469] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[ 1305.545349] sof-audio-pci 0000:00:1f.3: firmware boot complete

Integrated microphone not working at all.
Tried a few fixes that worked fron Yoga c940 IceLake but not working for the Cannon Lake version.
Been trying for months.

Environment
* Kernel: Linux 5.6.4-arch1-1 #1 SMP PREEMPT Mon, 13 Apr 2020 12:21:19 +0000 x86_64 GNU/Linux

* SOF: arch linux, sof-firmware 1.4.2-1

Similar report:
https://bugzilla.redhat.com/show_bug.cgi?id=1772498

Activity

  1. plbossart commented on Apr 15, 2020

    @plbossart
    Member

    @aleksfadini the errors in the dmesg log are misleading, ignore them.

    Can you please provide a link to the results of alsa-info ?

    Also please try and capture at the hw level

    arecord -Dhw:0,6 -c4 -r48000 -fS32_LE -d 10 mytest.wav
    aplay -Dhw:0,0 mytest.wav

    And please list what you have in /usr/share/alsa/ucm and /usr/share/alsa/ucm2.

    Thanks!

  2. aleksfadini commented on Apr 16, 2020

    @aleksfadini
    Author

    Thank you for looking into this.
    In reverse order:

     ls /usr/share/alsa/ucm
    sof-skl_hda_card
    
     ls /usr/share/alsa/ucm2
    broadwell-rt286  chtnau8824  GoogleNyan    SDP4430
    broxton-rt298    chtrt5645   HDA-Intel     skylake-rt286
    bytcht-cx2072x   chtrt5650   kblrt5660     sof-hda-dsp
    bytcht-es8316    codecs      PandaBoard    tegraalc5632
    bytcr-rt5640     DAISY-I2S   PandaBoardES  USB-Audio
    bytcr-rt5651     DB410c      PAZ00         VEYRON-I2S
    cht-bsw-rt5672   DB820c      platforms
    
    

    Hw capture:

    
    $ arecord -Dhw:0,6 -c4 -r48000 -fS32_LE -d 10 testFile.wav
    Recording WAVE 'testFile.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Channels 4
    arecord: set_params:1349: Channels count non available
    
    $ aplay -Dhw:0,0 testFile.wav
    Playing WAVE 'testFile.wav' : Signed 24 bit Little Endian in 3bytes, Rate 88200 Hz, Stereo
    aplay: set_params:1343: Sample format non available
    Available formats:
    - S16_LE
    - S24_LE
    - S32_LE
    
    

    alsa-info attached
    alsa.txt

  3. plbossart commented on Apr 16, 2020

    @plbossart
    Member

    ok, let's retry, looks like you only have 2 mics. We should be able to verify this with the following command:

    amixer -Dhw:0 info
    You should see something in there that list cfg-dmic:2 ?

    arecord -Dhw:0,6 -c2 -r48000 -fS32_LE -d 10 testFile.wav
    aplay -Dhw:0,0 testFile.wav

  4. aleksfadini commented on Apr 17, 2020

    @aleksfadini
    Author

    Thanks a lot for following up!
    You are correct about 2 mics:

    $ amixer -Dhw:0 info
    Card hw:0 'sofhdadsp'/'LENOVO-81TE-LenovoYogaC940_15IRH-LNVNB161216'
      Mixer name	: 'Realtek ALC298'
      Components	: 'HDA:8086280b,80860101,00100000 HDA:10ec0298,17aa381b,00100103 cfg-dmics:2'
      Controls      : 51
      Simple ctrls  : 21
    

    Recording and playing both worked!
    What does it mean?

    I apologize if that means I did not configure pulse right.
    Apparently changing the volume through pulse (via polybar) crashes the system, and apps that usually work with mic do not seem to detect the microphone (gnome record, zoom, skype). Could you help me find a solution?
    I installed arch on 4 other new machines and the same setup with pulse works out of the box.
    Also, when I use bitwig (a music production software) somehow the cpu gets clogged immediately, where on other machines it has very little load. Jack, cadence or qjackctl do not seem to work.

    To get any sound, I am adding this to my /etc/modprobe.d/alsa-base.conf:
    options snd_hda_intel enable=1 index=1
    Which might do nothing because I also blacklisted these modules in blacklist.conf:

    blacklist snd_hda_intel 
    blacklist snd_soc_skl
    

    As suggested in the arch wiki https://wiki.archlinux.org/index.php/Lenovo_Yoga_c940
    And I'm using this in my /etc/pulse.default.pa:

    
    load-module module-alsa-sink device=hw0,0 channels=4
    load-module module-alsa-source device=hw:0,6 channels=4
    

    Pulseaudio calls the speakers "Cannon Lake PCH cAvs Speakers". Alsamixer on terminal shows bars with names of "PGA1.0 1", "PGA2.0 1","PGA3.0 1", "PGA4.0 1", "PGA7.0 1", "PGA8.0 1","PGA9.0 1". (sof-hda-dsp, Realtek ALC298). I don't understand any of this (why skip PGA 5 and 6?? what are those?)

    The Lenovo Yoga c940 has 4 speakers, 2 of which seem to be the only working in Linux. I just learned now that it has "only" 2 mics... Why 2? Why "only"?
    Sorry for the excess of information, but i've been tinkering for a couple of months trying to figure this out. I'm very confused. Any help is appreciated immensely!

    PS If we solve this I'd be happy to update the arch wiki, which is not current and refers to a different CPU model.

  5. plbossart commented on Apr 17, 2020

    @plbossart
    Member

    ok, so the good news is that your hardware and drivers work fine, it's only PulseAudio configuration issues.

    I think your /etc/pulse/client.pa should be:
    load-module module-alsa-sink device=hw0,0 channels=2
    load-module module-alsa-source device=hw:0,6 channels=2

    You may have 4 speakers but the PCM device only supports 2, the 4 speakers are handled by the HDaudio codec.
    And likewise since you have 2 mics you should not configure the PCM device to work with 4...

    Those steps should be unnecessary if UCM was used? Can you confirm which version of alsa-lib you have, you need 1.2.2.1 to handle ucm2 and share the pulseaudio -vvv log (without the default.pa modified)? You may have to set autospawn=no to make this work.

  6. added
    bugSomething isn't working
    ICLApplies to Icelake platform
    CFLApplies to Coffee Lake platform
    and removed
    ICLApplies to Icelake platform
    on Apr 21, 2020
  7. aleksfadini commented on May 6, 2020

    @aleksfadini
    Author

    Thank you for following up. I have been trying to learn more about this for 15 days and I'm still clueless.

    My alsa-lib is 1.2.2-1 (from arch current repo).
    I reinstalled pulseaudio, so I have the default etc/pulse/default.pa and no client.pa (although I also tried to configure default.pa as you suggested and did not help).

    Pulse spawning is set to no.

    This is my pulseaudio -vvv:

     pulseaudio -vvv
    I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
    D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
    D: [pulseaudio] core-util.c: RealtimeKit worked.
    I: [pulseaudio] core-util.c: Successfully gained nice level -11.
    I: [pulseaudio] main.c: This is PulseAudio 13.0
    D: [pulseaudio] main.c: Compilation host: x86_64
    D: [pulseaudio] main.c: Compilation CFLAGS: Not yet supported on meson
    D: [pulseaudio] main.c: Running on host: Linux x86_64 5.6.10-arch1-1 #1 SMP PREEMPT Sat, 02 May 2020 19:11:54 +0000
    D: [pulseaudio] main.c: Found 16 CPUs.
    I: [pulseaudio] main.c: Page size is 4096 bytes
    D: [pulseaudio] main.c: Compiled with Valgrind support: no
    D: [pulseaudio] main.c: Running in valgrind mode: no
    D: [pulseaudio] main.c: Running in VM: no
    D: [pulseaudio] main.c: Running from build tree: no
    D: [pulseaudio] main.c: Optimized build: yes
    D: [pulseaudio] main.c: All asserts enabled.
    I: [pulseaudio] main.c: Machine ID is 6f8b9236222f4bd73ed166e65e4f4696.
    I: [pulseaudio] main.c: Session ID is 1.
    I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
    I: [pulseaudio] main.c: Using state directory /home/aleks/.pulse.
    I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-13.0/modules.
    I: [pulseaudio] main.c: Running in system mode: no
    E: [pulseaudio] pid.c: Daemon already running.
    E: [pulseaudio] main.c: pa_pid_file_create() failed.
    

    The problems that I have are:
    1- mic not working
    2- changing volume through i3/hotkey/polybar freezes the whole system (same config works on other 4 machines). If I press vol up or down three times in a row, mouse disappears (what's that!?) and audio keeps rising or lowering to max or min according to key pressed multiple times.
    3- jackdbus cannot start, with various options I get something similar to this:

    tail -f ~/.log/jack/jackdbus.log
    Wed May  6 14:10:04 2020: creating alsa driver ... hw:sofhdadsp,0|hw:sofhdadsp,0|1024|2|44100|0|2|nomon|swmeter|-|32bit
    Wed May  6 14:10:05 2020: configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 2 periods
    Wed May  6 14:10:05 2020: ALSA: final selected sample format for capture: 32bit integer little-endian
    Wed May  6 14:10:05 2020: ERROR: ALSA: cannot set period size to 1024 frames for capture
    Wed May  6 14:10:05 2020: ERROR: ALSA: cannot configure capture channel
    Wed May  6 14:10:05 2020: Released audio card Audio0
    Wed May  6 14:10:05 2020: ERROR: Cannot initialize driver
    Wed May  6 14:10:05 2020: ERROR: JackServer::Open failed with -1
    Wed May  6 14:10:05 2020: ERROR: Failed to open server
    Wed May  6 14:10:05 2020: Saving settings to "/home/aleks/.config/jack/conf.xml" ...
    

    I am really clueless, everything works on other new machines, but this is a yoga Lenovo with 8 cores i9880h processor and I got this precisely for music production... I tried many things (including hdajackretask) but I'm not sure. I'm ok giving up on the 4 speakers to use only 2, but I need to fix the problems that entail changing volume and making jack work. In my experience something seems off from the kernel/alsa side of things.
    Thank you for looking into this.

  8. juimonen commented on May 7, 2020

    @juimonen

    @aleksfadini your pulseaudio is still auto-spawning....

    1. check that /etc/pulse/client.conf has autospawn = no

    2. If you your system is using systemd you might also need to:
      systemctl --user stop pulseaudio.socket && systemctl --user stop pulseaudio

    then you should be able to start pulseaudio and get logs...

    to make things as before, replace word "stop" with "start" in the above command

    This is how it works at least in ubuntu 20.04.

  9. aleksfadini commented on May 8, 2020

    @aleksfadini
    Author
    1. checked, autospawn is off even in /etc/pulse/client.conf
    2. that's just turning off the pulseaudio service in systemd. I did it, and it turned it off. At that point I have the same jack issues, same mic issues, but obviously pulse is killed so changing the volume in pulsemixer doesnt freeze anything, because there is no pulseaudio active. And fyi, systemd works the same on every distro obviously.

    Why did you say my pulseaudio is still auto-spawning? I don't think it is. I can kill it and it stays killed looking at the processes.

  10. juimonen commented on May 8, 2020

    @juimonen

    @aleksfadini so this was to help you get the pulseaudio logs, if someone was asking those. In your previous comments you have pulse logs, which don't say anything because pulseaudio is not starting properly as it is detecting previous running instance and bailing out.

    Disabling pulse will not make your audio system work, it will just help to create some pulse/ucm related logs as you can start it properly from command line (that's what I meant with "working" in my comment).

  11. added
    HDAApplies to HD-Audio bus for codec connection
    on May 13, 2020
  12. 3 remaining items

  13. kv2019i commented on Jun 3, 2020

    @kv2019i
    Collaborator

    @aleksfadini Could you take these out:

    load-module module-alsa-sink device=hw0,0 channels=4
    load-module module-alsa-source device=hw:0,6 channels=4

    The log has no other errors than:

    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:0,0 channels=4"): initialization failed.
    E: [pulseaudio] module.c: Failed to load module "module-alsa-source" (argument: "device=hw:0,6 channels=4"): initialization failed.

    Other than that, in this log, it states you have a headset connected and pulseaudio routes capture to that:
    D: [pulseaudio] module-alsa-card.c: Jack 'Mic Jack' is now plugged in
    D: [pulseaudio] device-port.c: Setting port [In] Headphones2 to status yes
    D: [pulseaudio] device-port.c: Setting port [In] Mic to status yes

    So you it will record from the headset, not the integrated digital microphone. If you don't in fact have a headset connected, alsa-info output would be useful. The related ALSA mixer control is "Headphone Mic Jack".

  14. juimonen commented on Jun 3, 2020

    @juimonen

    @aleksfadini I have pretty similar device x1 yoga (probably with i7) and stock ubuntu 20.04 and for me internal mic and sounds seems to work out of the box... I'm not sure about the differences to arch linux..

  15. aleksfadini commented on Jun 21, 2020

    @aleksfadini
    Author

    @kv2019i
    I took out those two lines (although they were recommended in the arch linux page https://wiki.archlinux.org/index.php/Lenovo_Yoga_c940#Audio) and still have all the issues. Never had a headset connected.
    What log can I provide to investigate this?

  16. danielcherubini commented on Jun 22, 2020

    @danielcherubini

    I’m the author of that arch c940 page. I have just this week started to have issues again. I’m not sure what’s going on, so I defaulted back to using Intel audio drivers. I’ll try and debug it this week. But if what I’m reading above is correct then the alsa config in pulseaudio has stopped working.

    What’s weird is in pulse audio preferences I can see the volume bars moving, meaning sound is getting to pulse, but probably not to alsa. So either I upgraded alsa and created an issue, or something else.

  17. aleksfadini commented on Jun 22, 2020

    @aleksfadini
    Author

    Hi Daniel, thank you for the write up of the arch c940 page (it really helped!).
    First off, my c940 is the 15' with i9 CoffeLake processor, so some things were always different. But yes, this week everything became worse even on other machines. I have no idea if it is sof, alsa, the kernel or pulseaudio but it's a whole mess.
    Could you explain how are you using Intel audio drivers exactly?

    I can provide any logs that any of you guys who understand this need. Let me know.

  18. danielcherubini commented on Jun 23, 2020

    @danielcherubini

    I rolled back Alsa and its other packages back to 2.2.2 and everythings working again

    sudo pacman -U /var/cache/pacman/pkg/alsa-lib-1.2.2-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/alsa-plugins-1:1.2.2-2-x86_64.pkg.tar.zst /var/cache/pacman/pkg/alsa-topology-conf-1.2.2-2-any.pkg.tar.zst /var/cache/pacman/pkg/alsa-ucm-conf-1.2.2-1-any.pkg.tar.zst /var/cache/pacman/pkg/alsa-utils-1.2.2-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/lib32-alsa-lib-1.2.2-1-x86_64.pkg.tar.zst

  19. kv2019i commented on Jun 24, 2020

    @kv2019i
    Collaborator

    @danielcherubini Can you post your "alsa-info" output as well? On @aleksfadini 's machine, it seems Mic is reported to be connected, so Pulseaudio will by default record from there (and not the integrated digital mic):

    https://github.com/thesofproject/sof/files/4484793/alsa.txt
    ...
    control.16 {
    iface CARD
    name 'Mic Jack'
    value true

    We can't really fix this in SOF driver&firmware, so for this specific problem, I'd recommend filing to ALSA bugtracker where the codec driver issues are tracked.

    For @danielcherubini , the new problems you've seen, that sounds like something else. I know Jaroslav from Fedora has done many cleanups to UCM code , so I'd suspect some regression with those changes and the Pulseaudio version in Arch. If you reproduce the problem, we'd need reproduce steps, alsa-info output, pulseaudio verbose log and kernel log to analyze.

  20. kv2019i commented on Dec 8, 2020

    @kv2019i
    Collaborator

    @aleksfadini Is this issue still occuring for you? Based on the last updates, the remaining issue is in the codec driver and better handled in ALSA bugtracker/list.

  21. aleksfadini commented on Dec 8, 2020

    @aleksfadini
    Author

    @kv2019i Yes, still having the same issues. Would you know how how/where I can report the issues properly?

  22. kv2019i commented on Dec 8, 2020

    @kv2019i
    Collaborator

    @aleksfadini Based on comment @danielcherubini made, there was some Arch specific issue with ALSA and/or Pulseaudio and it was resolved by rolling back the versions. Your issue does sound similar as we've already verified that audio works at the kernel/driver level, so this is likely to be a Arch specific issue.

    Have you tried a recent Fedora or Ubuntu live image?

  23. aleksfadini commented on Dec 8, 2020

    @aleksfadini
    Author

    @kv2019i I can definitely try that, just to rule out Arch specific issues. Will do.

  24. plbossart commented on Jun 10, 2021

    @plbossart
    Member

    no update in 6+ months, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CFLApplies to Coffee Lake platformCommunityend-user or distro-reported issuesHDAApplies to HD-Audio bus for codec connectionbugSomething isn't workinguserspace

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions