You are not logged in.

#76 2020-02-09 17:44:16

tbw
Member
Registered: 2017-01-01
Posts: 9

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

V1del wrote:

Check your mixer controls (alsamixer -c0 ), they will usually feature a auto mute control or so. Or make pulse create proper profiles by renaming the ucm2 folder which should also contain rules to properly switch.

Yep thanks a lot, turning Auto-Mute Mode to enabled in alsamixer did the trick.

Offline

#77 2020-02-09 23:39:47

ElderBladex
Member
Registered: 2019-12-20
Posts: 11

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

I recently upgraded from 5.4.15 to 5.5.2 and now the audio stopped working. I get "dummy output" as the sound device.

First, I restarted pulseaudio which didn't work. I went here and followed the updated wiki instructions and installed sof-firmware, updated /etc/pulse/default.pa with

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

And added the blacklist modules.

I rebooted the machine and increased the master channel with alsamixer which still didn't fix it. The output device is now sof-hda-hsp, but there is still no sound, In pavucontrol, I do see output when a play a sound file or youtube video, there's just no audio.

I've tried unmuting with

$ amixer sset Master unmute

and.... in middle of this post I realized the master volume was still muted as indicated by "MM" label at the bottom of the master channel for card 0 - sof-hda-dsp. Selecting it and pressing "M" as described in the wiki changes it to 00 and unmuted it. Everything is working now.

Offline

#78 2020-02-10 23:27:06

tbw
Member
Registered: 2017-01-01
Posts: 9

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

Last issue I'm encountering... impossible to use my headphone's built-in microphone (it used  to work before the updated). It just does not seem to be recognized. Any ideas?

Offline

#79 2020-02-11 07:48:54

amada
Member
Registered: 2019-12-15
Posts: 3

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

After many, many painstaking hours of troubleshooting  todayI wanted to present my findings here, because I was surprised to find that we were creating our own suffering a bit with some of the solutions being passed around in this thread which led me on a few wild goose chases over the last months. Once I began to really study how pulseaudio and alsa interacted, the problem became much clearer for me. Anyone who wants to know in depth what's going on here should look over this post.

To start, I was having the headphone jack problems described above. Auto-mute enabled in alsamixer would fix it, but it kept getting unset. This is because (on my system) pulseaudio will constantly try to update the mixer and undo your settings, even if you set them with sudo alsactl store.

I did know, however, that when using the legacy UCM configurations headphone switching worked as expected. You can still get those configs from thesofproject's own alsa-ucm-conf forked github repo. That being said, my goal then was to see if I could somehow get pulseaudio to correctly load the newer ucm2 profile, and hopefully have the smooth handling of sink changes that the legacy ucm1 had.

One thing that wasn't obvious when I first started this deserves a bit of clarification. Lets look at these lines that are on the wiki to add to your default.pa:

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

(I used hw:0,6 because that's the ID of the 48khz sample rate dmic0, but it makes no difference whether we use hw:0,7 or hw:0,6).

When you do this, you are manually telling pulseaudio to load the alsa driver, which also means that it isn't looking at ucm config at all. You are essentially overriding it, or rather, you are adding your own manual sink and source to pulseaudio's pool. How did I find this out? After looking over the pulseaudio logs when these lines were not present in my default.pa, I noticed that while the sof-hda-dsp ucm2 conf file was being detected, pulseaudio could not read it. When I looked deeper into why this was the case, I was noticing that it couldn't parse fields from the sof-hda-dsp ucm2 conf that were clearly there when I looked manually.

I then noticed the biggest difference between ucm and ucm2 is that ucm2 utilizes a new control flow mechanism syntax (if-else statement based) that I'm guessing is intended to provide a more elegant way of handling a variety of card setups. The essential properties of the devices it defined were within the control flow brackets, and those fields were exactly what pulseaudio was complaining was missing. At that moment I realized that Pulseaudio 13.0 does not fully implement ucm2. This seemed to align with remarks I saw in some mailing lists on my research, but on the master branch as well most of the commits on alsa-ucm.c for completing ucm2 support have been made in the days since the 13.0 release, and await the release of 14.0.

THE FIX

My solution right now is to use the skl_hda_dsp_generic ucm1 profile provided from sof's legacy ucm repo. Thanks for these instructions tbw.

tbw wrote:

Moved the current /usr/share/alsa/ucm2 folder to /usr/share/alsa/ucm2-moved. If you don't do that, looks like pulse goes looking by default in the ucm2 folder, and this doesn't work as explained by amada

mv /usr/share/alsa/ucm2 /usr/share/alsa/ucm2-moved

Synchronized the legacy repository mentioned by amada in /usr/share/alsa/ucm

mkdir /usr/share/alsa/ucm
git clone --single-branch --branch sof_ucm1 https://github.com/thesofproject/alsa-ucm-conf.git
mv alsa-ucm-conf/ucm/* /usr/share/alsa/ucm

After doing this, this one line is all that's necessary for /etc/pulse/default.pa (you can remove the load-module module-alsa-sink line if you already added it):

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

Next, edit /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf and change the following section (for me, lines 106-111):

[Element Speaker]                   
required-any = any                  
switch = mute                       
volume = merge                      
override-map.1 = all                
override-map.2 = all-left,all-right

to read:

[Element Speaker]                   
required-any = any                  
switch = off                     
volume = merge                        
override-map.1 = all                
override-map.2 = all-left,all-right

This gives me the use of the built in dmic, functioning headset/line-in mic, proper headphone switching, and full frequency response. Yay.

(For transparency, I'm using the dev version of ubuntu focal, which has a similar userland to what is in arch right now. Alsa 1.2.1.2 and pulseaudio 13.0, and I'm using my own 5.5.2 kernel as well as sof 1.4.2)

Last edited by amada (2020-02-16 16:22:24)

Offline

#80 2020-02-13 22:55:13

tbw
Member
Registered: 2017-01-01
Posts: 9

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

amada wrote:

My solution right now is to use the skl_hda_dsp_generic ucm1 profile provided from sof's legacy ucm repo

Thanks a lot for researching this out. Do you think you could provide a little more detail on how to use this generic profile?

EDIT : this is how I did it and it ends up working pretty well. Sometimes my headphone's mic are not recognized but usually they are (don't know why the behavior is not consistent)

  • Moved the current /usr/share/alsa/ucm2 folder to /usr/share/alsa/ucm2-moved. If you don't do that, looks like pulse goes looking by default in the ucm2 folder, and this doesn't work as explained by amada

    mv /usr/share/alsa/ucm2 /usr/share/alsa/ucm2-moved
  • Synchronized the legacy repository mentioned by amada in /usr/share/alsa/ucm

    mkdir /usr/share/alsa/ucm
    git clone --single-branch --branch sof_ucm1 https://github.com/thesofproject/alsa-ucm-conf.git
    mv alsa-ucm-conf/ucm/* /usr/share/alsa/ucm

And then rebooted

Of course, you still need to adjust default.pa and analog-output-speaker.conf as mentioned in amada's post

Last edited by tbw (2020-02-13 23:42:54)

Offline

#81 2020-02-16 10:26:21

ZeroLinux
Member
Registered: 2011-10-07
Posts: 157

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

amada wrote:

This gives me the use of the built-in dmic, functioning headset/line-in mic, proper headphone switching, and full frequency response. Yay.

I tried to follow this guide but fail in one moment (and that's why  didn't work) mentioned by tbw

tbw wrote:
mv /usr/share/alsa/ucm2 /usr/share/alsa/ucm2-moved

Now it works perfectly!
Thank you amada for the idea and twb for the addition how to implement it! Really it is the best solution. I enjoy it constantly. Especially full frequency response.

Offline

#82 2020-02-17 13:07:54

mireofthedeep
Member
Registered: 2020-02-17
Posts: 1

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

Joined to give thanks to all who worked on this, especially amada and tbw.

My system is Lenovo ThinkPad X1 Carbon (7th Gen), with Intel(R) Core(TM) i7-8565U CPU.

* uname -a :: 5.5.4-arch1-1
* sof-firmware 1.4.2-1
* intel-ucode 20191115-3

No sound or microphone in kde plasma 5 after installing alsa-utils, alsa-firmware, and pulseaudio-alsa, (and sof-firmware which I've never before had to know about).

After following Amada's instructions: sound works from speakers, headphones work as expected, microphone works. Big thanks!

[Edit]
Also 4 speakers work, but not completely.
Had to `alsamixer`, there F6 and select `sof-hda-dsp`. That opens several channels that one can control.
Master on, Speaker Mute -> 2 Bottom speakers only, but with bass.
Master on, Speaker on -> 2 speakers work, but no bass!

Seems like this 4 speaker setup doesn't come very easily - anyone got it to work?

[Edit 2]
Err.. Perhaps 4 speakers works "as intended"?
In `alsamixer` the Muted Speaker's volume still controls something - like low frequency loudness perhaps. Quite interesting..  Anyone with more insight?

"For the newest generation of the Lenovo ThinkPad X1 Carbon (7th Gen) and ThinkPad X1 Yoga (4th Gen), Lenovo partnered with Dolby Laboratories to develop a premium sound experience. To achieve this premium sound, Dolby combined a pair of down-firing full-range drivers with a pair of upward firing tweeters. Just like a HiFi speaker, the two-way speaker design was chosen for maximum efficiency of the speaker drivers across the audible range. The full-range drivers are powered by a smart-amplifier to deliver 2W of audio, maximizing the loudness and low-frequency performance of the laptop. The tweeters are designed to provide an additional 1W of high-frequency audio which is essential for our perception of sound localization. This was achieved by applying Dolby-tuned digital filters to the tweeters to optimize the output for sounds above 6kHz. This tuning maximizes the tweeter performance in a frequency range where humans are sensitive to localization cues and prevents the speaker driver from being overdriven with excessive mid-range energy which can produce distortion and damage the speakers."

Last edited by mireofthedeep (2020-02-17 20:35:02)

Offline

#83 2020-02-17 22:21:42

juphu2Va
Member
Registered: 2019-05-16
Posts: 36

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

It might sound like a stupid question, but: What package is responsible for making it work again out of the box?

  • sof-firmware?

  • linux?

  • pulseaudio?

Offline

#84 2020-02-17 23:14:07

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,203

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

Right now, none of these, either manually download the old ucm files as described by amada, use my ugly but seems to work fix of lying about ucm2 files by renaming  /usr/share/alsa/ucm2 to  /usr/share/alsa/ucm. (Though I agree actually using old ucm files is likely the more proper course of action here)

It should eventually be fixed by a pulseaudio/alsa-lib update when they actually start to properly look at ucm2 paths.

Last edited by V1del (2020-02-17 23:14:33)

Offline

#85 2020-02-18 18:36:23

amada
Member
Registered: 2019-12-15
Posts: 3

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

mireofthedeep wrote:

Joined to give thanks to all who worked on this, especially amada and tbw.

My system is Lenovo ThinkPad X1 Carbon (7th Gen), with Intel(R) Core(TM) i7-8565U CPU.

* uname -a :: 5.5.4-arch1-1
* sof-firmware 1.4.2-1
* intel-ucode 20191115-3

No sound or microphone in kde plasma 5 after installing alsa-utils, alsa-firmware, and pulseaudio-alsa, (and sof-firmware which I've never before had to know about).

After following Amada's instructions: sound works from speakers, headphones work as expected, microphone works. Big thanks!

[Edit]
Also 4 speakers work, but not completely.
Had to `alsamixer`, there F6 and select `sof-hda-dsp`. That opens several channels that one can control.
Master on, Speaker Mute -> 2 Bottom speakers only, but with bass.
Master on, Speaker on -> 2 speakers work, but no bass!

Seems like this 4 speaker setup doesn't come very easily - anyone got it to work?

[Edit 2]
Err.. Perhaps 4 speakers works "as intended"?
In `alsamixer` the Muted Speaker's volume still controls something - like low frequency loudness perhaps. Quite interesting..  Anyone with more insight?

Hi, you got it right. You want to make sure that Speaker is muted yet that it's turned all the way up, and that bass speaker is unmuted, only in this way do you get all four speakers firing correctly. The edits provided to the analog-output conf file above are to preserve these levels.

Not exactly sure why it is like this, but my hunch is it has to do with the hda-common topologies having an awkward mapping to the audio codec that the X1C7 uses. In this case, the full functionality is supported but it has a bad user-facing interface.

1. speaker muted and bass speaker muted = speakers off
2. muted speaker turned to 0 + bass speaker on = bass speakers only
3. speaker unmuted and turned to 100 = treble speakers only
4.  speaker muted and turned to 100 + bass speaker on = all four speakers

The hda-common topology is a generic profile made to fit a range of different audio codecs supported by sof. it could be the case that a topology is made specifically for realtek ac285 in the future (as you see, in sof-tplg there are codec-specific topologies). But since the feature set is supported in full I'm guessing it is saved for polishing after the sof team finishes their targets for core functionality.

Hope that clears it up.

Offline

#86 2020-02-19 07:22:14

rangoon
Member
From: New Zealand
Registered: 2020-02-14
Posts: 4

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

Hey there, great work on this.

I'm a freshie and have gathered all of the files I need, added the SOF firmware. I don't quite understand the quoted edit below exactly and can you explain a bit more precisely what the default.pa should look like after its edited? Sorry for the hassle.

When I look into that file there is a lot in the section I think you're quoting for me to add the line into, not sure where exactly to stick it :-)

amada wrote:

After doing this, this one line is all that's necessary for /etc/pulse/default.pa (you can remove the load-module module-alsa-sink line if you already added it):

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

Mine looks like this in the area I think you're suggesting I stick the fixed up load-module line:
## Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink


Third time lucky, the first two tries, I lost the sound icon on the task bar and tried all sorts of things to recover to no avail, reinstalled Arch again today and now have the shakes hoping I don't make a poop of it again :-)

Cheers

Rangoon

Last edited by rangoon (2020-02-19 07:23:41)


Gamer | Dad | Coffee Drinker | Kiwi | The Right Kind of Crazy

Offline

#87 2020-02-19 08:35:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,203

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

All that should be necessary is to add that single line there. Double check with

arecord -l

that you actually also need hw:0,6 and not a different subdevice.

Offline

#88 2020-02-21 01:34:22

Götz
Member
Registered: 2009-02-16
Posts: 30

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

PulseAudio 13.99.1 (14.0 RC1) was released last week with the UCM2 updates:
https://lists.freedesktop.org/archives/ … 31609.html


What I hear, I forget. What I say, I remember. What I do, I understand.  –Tao Te Ching/Laozi

Offline

#89 2020-02-22 11:07:47

bgoner
Member
Registered: 2020-02-22
Posts: 2

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

Hey,
  Spent last 2 days trying to make the mics work - no success. Not sure if I have to post here as I'm using ubuntu 18.04, but seems like you guys have gone the deepest in the rabbit hole across all online threads.

After I do the first post + #9 comment modifications, arecord -l returns "no soundcards found"
Without modifications I was using my earbuds with mic - both working perfectly.
Another temporary decision could be a super small usb mic: https://www.aliexpress.com/item/32973953613.html

Do you think I should persue trying the mic to work at all on:

Linux 5.3.0-40-generic #32~18.04.1-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
x1 carbon 7 gen - 10th Gen Intel® Core™ i7-10710U

This is my first Linux experience, probably won't be able to do the witchcraft you guys do here - custom kernels and stuff.

lspci

00:00.0 Host bridge: Intel Corporation Device 9b51
00:02.0 VGA compatible controller: Intel Corporation Device 9bca (rev 04)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Device 02f9
00:14.0 USB controller: Intel Corporation Device 02ed
00:14.2 RAM memory: Intel Corporation Device 02ef
00:14.3 Network controller: Intel Corporation Device 02f0
00:15.0 Serial bus controller [0c80]: Intel Corporation Device 02e8
00:15.1 Serial bus controller [0c80]: Intel Corporation Device 02e9
00:16.0 Communication controller: Intel Corporation Device 02e0
00:1d.0 PCI bridge: Intel Corporation Device 02b0 (rev f0)
00:1d.4 PCI bridge: Intel Corporation Device 02b4 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Device 0284
00:1f.3 Audio device: Intel Corporation Device 02c8
00:1f.4 SMBus: Intel Corporation Device 02a3
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device 02a4
00:1f.6 Ethernet controller: Intel Corporation Device 0d4f
03:00.0 Non-Volatile memory controller: Intel Corporation SSD Pro 7600p/760p/E 6100p Series (rev 03)
05:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:01.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:02.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:04.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
07:00.0 System peripheral: Intel Corporation JHL6540 Thunderbolt 3 NHI (C step) [Alpine Ridge 4C 2016] (rev 02)
2d:00.0 USB controller: Intel Corporation JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] (rev 02)

when I l look in dmesg result at the end I can find:

[   25.382012] sof-audio-pci 0000:00:1f.3: error: load fw failed ret: -110
[   25.382035] sof-audio-pci 0000:00:1f.3: error: status = 0x0000002c panic = 0x00000000
[   25.382042] sof-audio-pci 0000:00:1f.3: error: failed to reset DSP
[   25.382043] sof-audio-pci 0000:00:1f.3: error: failed to boot DSP firmware -110
[   25.382044] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -110

dmesg|grep sof

[    1.918246] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.918248] software IO TLB: mapped [mem 0x41f74000-0x45f74000] (64MB)
[   22.113587] uvcvideo 1-8:1.2: Entity type for entity Microsoft Extended Controls Uni was not initialized!
[   22.258847] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   22.258853] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   22.258977] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   22.263433] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   22.267673] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   22.267674] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   22.313875] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   22.313877] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   25.382012] sof-audio-pci 0000:00:1f.3: error: load fw failed ret: -110
[   25.382035] sof-audio-pci 0000:00:1f.3: error: status = 0x0000002c panic = 0x00000000
[   25.382042] sof-audio-pci 0000:00:1f.3: error: failed to reset DSP
[   25.382043] sof-audio-pci 0000:00:1f.3: error: failed to boot DSP firmware -110
[   25.382044] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -110

arecord -l      <without mods>

card 0: PCH [HDA Intel PCH], device 0: ALC285 Analog [ALC285 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Cheers

Last edited by bgoner (2020-02-22 11:17:25)

Offline

#90 2020-02-22 11:25:19

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,403
Website

Re: [SOLVED] Fix for microphone on Lenovo X1 Gen 7

Please open a new topic (and use code tags). Missed that you're using Ubuntu, that being the case, please ask on the Ubuntu forums, we only support Arch.

This topic is marked as solved and OP hasn't posted in it since last year. If there is useful information in this topic which isn't yet documented on the wiki, then I encourage everyone involved to rectify that.

Closing.

Last edited by WorMzy (2020-02-22 18:43:46)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB