-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lenovo patches #1442
Lenovo patches #1442
Conversation
Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes, in particular in the context in which this code is being used. So, replace the following form: sizeof(struct sof_ipc_ctrl_data) + sizeof(struct sof_ipc_ctrl_value_chan) * le32_to_cpu(mc->num_channels) with: struct_size(scontrol->control_data, chanv, le32_to_cpu(mc->num_channels)) and so on... This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Mark Brown <[email protected]>
add two units min_volume_step and max_volume_step to the snd_sof_control struct, for the min and max step of the volume_table. Signed-off-by: Zhu Yingjiang <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Mark Brown <[email protected]>
The driver currently passes the volume ramp type and length topology tokens to firmware, but the min and max volume are not set. This patch provides a correction to convert the information from the topology file and pass the linear volume min/max value to the firmware to improve transitions. Signed-off-by: Zhu Yingjiang <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Mark Brown <[email protected]>
Currently sof pga element supports only 1 kcontrol and you can't create for example a mixer element with combined volume slider and mute switch. So enable sof pga to have more than 1 kcontrol associated with it. Also check for possible NULL tlv pointer as switch element might not have it. Signed-off-by: Jaska Uimonen <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Move code around to enable token parsing in control load. Signed-off-by: Jaska Uimonen <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Currently sof doesn't support acpi leds with mute switches. So implement acpi leds following quite shamelessly existing HDA implementation by Takashi Iwai. Mute leds can be enabled in topology by adding led and direction token in switch control private data. Signed-off-by: Jaska Uimonen <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
sof_parse_tokens() returns a value that is checked on every call except for LED tokens, fix with explicit test. Detected with cppcheck warning: sound/soc/sof/topology.c:973:6: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, ^ Fixes: 5d43001 ("ASoC: SOF: acpi led support for switch controls") Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
When LEDS_TRIGGER_AUDIO is m and SND_SOC_SOF is y, sound/soc/sof/control.o: In function `snd_sof_switch_put': control.c:(.text+0x587): undefined reference to `ledtrig_audio_set' control.c:(.text+0x593): undefined reference to `ledtrig_audio_set' Reported-by: Hulk Robot <[email protected]> Fixes: 5d43001 ("ASoC: SOF: acpi led support for switch controls") Signed-off-by: YueHaibing <[email protected]> Acked-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Will these also enable the speaker mute LED? Not working currently with sof-dev@4e76b4a and firmware 1.3. |
@tokyovigilante AFAIK speaker mute led is going through alsa HDA path, so in that sense not related to sof. So speaker mute led should work if kernel has proper config, see for example: dmic is different path (not behind HDA) so we need to handle it in sof. However it obeys the same kernel led config as HDA path. |
Thanks for clarifying @juimonen, I have the ThinkPad-specific and LED_TRIGGER* configs enabled but will enable the rest and try again. |
@tokyovigilante and if you are using like ubuntu with pulseaudio & gnome UI, and trying to mute from those, you would need pulseaudio ucm hw volume patch and proper UCM configs. So without userspace changes something like:
If you want the whole chain to work from UI, you need (this is what I use in my X1): |
I'm using Fedora 31 with Sway/Waybar. I have a keymapping for XF86AudioMute to call I'm using the sof-dev kernel branch, UCM from https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC (renamed for my Yoga's model number as per ALSA) and Pulseaudio 13.0 from the Fedora repos. I note the sof-dev kernel selects the |
Have just tried building the topology from your branch above, dmesg output looks ok, but Pulseaudio won't load the UCM correctly against that topology. dmesg:
pulseaudio -v
|
@tokyovigilante so not sure about the UCM you are using... I just got my X1 last Thursday so all my changes are still in https://github.com/juimonen/alsa-ucm-conf-1/tree/lenovo_test. So let's say we are in the middle of upstreaming here.... You could just copy the X1 related ucm from my branch and try with it. You might need to change the path also inside the conf file if you need to change the file name (I needed to do the same). Pulseaudio 13 won't have the ucm hw volume patch, so if you mute from pulseaudio it is just user space sw volume, nothing is sent to alsa -> no mute led toggling. And the hda-generic-4ch should work also with leds, I think. |
@tokyovigilante also see that you have this in your kernel config: |
I do have that kconfig yes. I think you are right I'm missing the volume control support in pulseaudio. I'll try a git build from your tree and see if that works, HW volume control would be nice too. Otherwise I might wait for all the changes to settle down and percolate through to upstream and release. |
I was unable to get your UCM config working with the version of Pulseaudio in your tree, which seems a bit old?
compared to Also, the UCM files look quite verbose compared to upstream, which are only about 5 days old. I had an idea the SOF team were working on making them less verbose in general with more autoconfiguration. Also the 5.4-rc5 sof-dev kernel has renamed the devices to |
@tokyovigilante yes so these are for ubuntu LTS release which has still pulse v11.1 and kernel 5.0.8 So yes I'm kind behind with some of the stuff what guys are doing in upstream, for example renaming the cards was kind of surprise and happened very fast. And unfortunately upstream is not testing the "full" use cases like I'm currently.
So I am the "SOF ucm team" currently :) but I'm trying first to get all needed use cases working. I agree with you that the device differentiation has to be solved somehow better if we have 20 variants. I have to check what pulse/ucm combination will do if we have "not found" items in the "main" file like sofhdadsp. So could we have for e.g. the lenovo bass speaker and so on there without affecting dell devices? So put all variation there and just let some devices ignore those. I wonder what's the issue with the UCM and pulseaudio from my repo you mentioned? As said I have it working in X1. I'm sorry I can't just now install fedora as I have only 1 device, but these should not actually too much care about the flavor of distribution... Anyway you should be able to take the latest pulseaudio v13 version from: |
I can't recall who's in charge of this branch? @bardliao ? |
@juimonen Oh sure I wasn't complaining at all, obviously SOF itself is pretty new and the whole stack is in flux. I'm just stuck needing an up-to-date kernel for some other HW support and it's a bit hard to know as an end-user what the best SW and UCM versions are. I'll give your UCM another crack if these are to to be the canonical ones. Thanks for the link to PA v13, I don't need to run the latest version just for the sake of it but even the UCM format itself seems to be in flux. Thanks for drinking from the metaphorical firehose on our behalf anyway! Will update everything post up some logs. |
@juimonen Have rebuilt with PA v13 from your link and your UCM files modified to point at sof-hda-dsp and it is now working well, thanks! The mute LED is still not working but I assume I'd need a kernel with your patches also? |
@plbossart Yes, it's me. |
@tokyovigilante if you have latest topic/sof-dev kernel that should have muteled related patches. And make sure you have the audio led configs enabled in your kernel config.
|
Interestingly the speaker mute LED does work with the sof-dev kernel and using alsamixer to toggle the speaker volume on and off, so as you suggest must be a PA issue. The mic mute LED doesn't seem to even from alsamixer, although there's not an obvious overall mic mute switch in the capture section. [EDIT] In fact I'm not sure the DMIC is working at all, I'm not getting any monitor input in pavucontrol. Here's my latest pulseaudio -vI: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted I: [pulseaudio] core-util.c: Successfully gained nice level -11. I: [pulseaudio] main.c: This is PulseAudio 13.0-10-ge4450 I: [pulseaudio] main.c: Page size is 4096 bytes I: [pulseaudio] main.c: Machine ID is 3042816b5dc5472aae4757ca697863ef. 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/ryan/.pulse. I: [pulseaudio] main.c: Using modules directory /usr/local/lib/pulse-13.0/modules. I: [pulseaudio] main.c: Running in system mode: no I: [pulseaudio] main.c: System supports high resolution timers I: [pulseaudio] cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 I: [pulseaudio] svolume_mmx.c: Initialising MMX optimized volume functions. I: [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers. I: [pulseaudio] svolume_sse.c: Initialising SSE2 optimized volume functions. I: [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers. I: [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions. I: [pulseaudio] svolume_orc.c: Initialising ORC optimized volume functions. I: [pulseaudio] module-device-restore.c: Successfully opened database file '/home/ryan/.pulse/3042816b5dc5472aae4757ca697863ef-device-volumes'. I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0; argument: ""). I: [pulseaudio] module-stream-restore.c: Successfully opened database file '/home/ryan/.pulse/3042816b5dc5472aae4757ca697863ef-stream-volumes'. I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1; argument: "restore_device=false"). I: [pulseaudio] module-card-restore.c: Successfully opened database file '/home/ryan/.pulse/3042816b5dc5472aae4757ca697863ef-card-database'. I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2; argument: ""). I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: #3; argument: ""). I: [pulseaudio] module.c: Loaded "module-switch-on-port-available" (index: #4; argument: ""). I: [pulseaudio] alsa-ucm.c: UCM available for card sof-hda-dsp I: [pulseaudio] alsa-ucm.c: Set UCM verb to BassSpeaker I: [pulseaudio] alsa-ucm.c: Set UCM verb to Headphones I: [pulseaudio] alsa-ucm.c: Set UCM verb to Hdmi1 I: [pulseaudio] alsa-ucm.c: Set UCM verb to Hdmi2 I: [pulseaudio] alsa-ucm.c: Set UCM verb to Hdmi3 I: [pulseaudio] module-alsa-card.c: Found UCM profiles I: [pulseaudio] alsa-ucm.c: Set ucm verb to Hdmi3 I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,5 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,6 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:sofhdadsp,5 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:sofhdadsp,5: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack HDMI/DP,pcm=5 has_control=1 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,6 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,6: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Dmic has_control=0 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Headphone Mic has_control=0 I: [pulseaudio] alsa-ucm.c: Set ucm verb to Hdmi2 I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,4 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,6 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:sofhdadsp,4 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:sofhdadsp,4: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack HDMI/DP,pcm=4 has_control=1 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,6 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,6: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Dmic has_control=0 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Headphone Mic has_control=0 I: [pulseaudio] alsa-ucm.c: Set ucm verb to Hdmi1 I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,3 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,6 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:sofhdadsp,3 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:sofhdadsp,3: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack HDMI/DP,pcm=3 has_control=1 : [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,6 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,6: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Dmic has_control=0 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Headphone Mic has_control=0 I: [pulseaudio] alsa-ucm.c: Set ucm verb to Headphones I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,6 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:sofhdadsp,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:sofhdadsp,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Headphone has_control=1 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,6 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,6: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Dmic has_control=0 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Headphone Mic has_control=0 I: [pulseaudio] alsa-ucm.c: Set ucm verb to BassSpeaker I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,6 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: Device hw:0,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:sofhdadsp,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:sofhdadsp,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Bass Speaker has_control=0 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,6 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,6: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Dmic has_control=0 I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1 I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:0,0 I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:0,0: No such file or directory I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] alsa-ucm.c: UCM jack Headphone Mic has_control=0 I: [pulseaudio] module-card-restore.c: Restoring port latency offsets for card alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic. I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0' I: [pulseaudio] card.c: alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic: active_profile: BassSpeaker I: [pulseaudio] card.c: Created 0 "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" I: [pulseaudio] alsa-ucm.c: Set UCM verb to BassSpeaker I: [pulseaudio] alsa-util.c: Trying to disable ALSA period wakeups, using timers only I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: ALSA period wakeups disabled I: [pulseaudio] alsa-sink.c: Successfully opened device hw:sofhdadsp,0. I: [pulseaudio] alsa-sink.c: Selected mapping 'Bass Speaker' (BassSpeaker: hw:sofhdadsp,0: sink). I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode. I: [pulseaudio] alsa-sink.c: Successfully enabled timer-based scheduling mode. I: [pulseaudio] alsa-ucm.c: ALSA device hw:sofhdadsp,0 roles: (null) I: [pulseaudio] module-device-restore.c: Restoring port for sink sink:alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink. I: [pulseaudio] module-device-restore.c: Restoring volume for sink alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink: front-left: 22232 / 34%, front-right: 22232 / 34% I: [pulseaudio] module-device-restore.c: Restoring mute state for sink alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink: unmuted I: [pulseaudio] sink.c: Created sink 0 "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink" with sample spec s16le 2ch 48000Hz and channel map front-left,front-right I: [pulseaudio] sink.c: alsa.resolution_bits = "16" I: [pulseaudio] sink.c: device.api = "alsa" I: [pulseaudio] sink.c: device.class = "sound" I: [pulseaudio] sink.c: alsa.class = "generic" I: [pulseaudio] sink.c: alsa.subclass = "generic-mix" I: [pulseaudio] sink.c: alsa.name = "" I: [pulseaudio] sink.c: alsa.id = "HDA Analog (*)" I: [pulseaudio] sink.c: alsa.subdevice = "0" I: [pulseaudio] sink.c: alsa.subdevice_name = "subdevice #0" I: [pulseaudio] sink.c: alsa.device = "0" I: [pulseaudio] sink.c: alsa.card = "0" I: [pulseaudio] sink.c: alsa.card_name = "sof-hda-dsp" I: [pulseaudio] sink.c: alsa.long_card_name = "LENOVO-20QFCTO1WW-ThinkPadX1Yoga4th-20QFCTO1WW" I: [pulseaudio] sink.c: alsa.driver_name = "snd_soc_skl_hda_dsp" I: [pulseaudio] sink.c: device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic" I: [pulseaudio] sink.c: sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0" I: [pulseaudio] sink.c: device.bus = "pci" I: [pulseaudio] sink.c: device.vendor.id = "8086" I: [pulseaudio] sink.c: device.vendor.name = "Intel Corporation" I: [pulseaudio] sink.c: device.product.id = "9dc8" I: [pulseaudio] sink.c: device.product.name = "Cannon Point-LP High Definition Audio Controller" I: [pulseaudio] sink.c: device.string = "hw:sofhdadsp,0" I: [pulseaudio] sink.c: device.buffering.buffer_size = "65472" I: [pulseaudio] sink.c: device.buffering.fragment_size = "16320" I: [pulseaudio] sink.c: device.access_mode = "mmap+timer" I: [pulseaudio] sink.c: device.profile.name = "BassSpeaker: hw:sofhdadsp,0: sink" I: [pulseaudio] sink.c: device.profile.description = "Bass Speaker" I: [pulseaudio] sink.c: device.description = "Cannon Point-LP High Definition Audio Controller Bass Speaker" I: [pulseaudio] sink.c: module-udev-detect.discovered = "1" I: [pulseaudio] sink.c: device.icon_name = "audio-card-pci" I: [pulseaudio] source.c: Created source 0 "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink.monitor" with sample spec s16le 2ch 48000Hz and channel map front-left,front-right I: [pulseaudio] source.c: device.description = "Monitor of Cannon Point-LP High Definition Audio Controller Bass Speaker" I: [pulseaudio] source.c: device.class = "monitor" I: [pulseaudio] source.c: alsa.card = "0" I: [pulseaudio] source.c: alsa.card_name = "sof-hda-dsp" I: [pulseaudio] source.c: alsa.long_card_name = "LENOVO-20QFCTO1WW-ThinkPadX1Yoga4th-20QFCTO1WW" I: [pulseaudio] source.c: alsa.driver_name = "snd_soc_skl_hda_dsp" I: [pulseaudio] source.c: device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic" I: [pulseaudio] source.c: sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0" I: [pulseaudio] source.c: device.bus = "pci" I: [pulseaudio] source.c: device.vendor.id = "8086" I: [pulseaudio] source.c: device.vendor.name = "Intel Corporation" I: [pulseaudio] source.c: device.product.id = "9dc8" I: [pulseaudio] source.c: device.product.name = "Cannon Point-LP High Definition Audio Controller" I: [pulseaudio] source.c: device.string = "0" I: [pulseaudio] source.c: module-udev-detect.discovered = "1" I: [pulseaudio] source.c: device.icon_name = "audio-card-pci" I: [pulseaudio] alsa-sink.c: Using 4.0 fragments of size 16320 bytes (85.00ms), buffer size is 65472 bytes (341.00ms) I: [pulseaudio] alsa-sink.c: Time scheduling watermark is 18.38ms I: [alsa-sink-HDA Analog (*)] util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5. I: [alsa-sink-HDA Analog (*)] alsa-sink.c: Starting playback. I: [pulseaudio] core.c: default_source: (unset) -> alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink.monitor I: [pulseaudio] core.c: default_sink: (unset) -> alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink I: [pulseaudio] alsa-util.c: Trying to disable ALSA period wakeups, using timers only I: [pulseaudio] alsa-util.c: Device hw:0,6 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: ALSA period wakeups disabled I: [pulseaudio] alsa-source.c: Successfully opened device hw:0,6. I: [pulseaudio] alsa-source.c: Selected mapping 'DMIC Stereo' (BassSpeaker: hw:0,6: source). I: [pulseaudio] alsa-source.c: Successfully enabled mmap() mode. I: [pulseaudio] alsa-source.c: Successfully enabled timer-based scheduling mode. I: [pulseaudio] alsa-ucm.c: ALSA device hw:0,6 roles: (null) I: [pulseaudio] module-device-restore.c: Restoring port for source source:alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_6__source. I: [pulseaudio] module-device-restore.c: Restoring volume for source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_6__source: front-left: 65536 / 100%, front-right: 65536 / 100% I: [pulseaudio] module-device-restore.c: Restoring mute state for source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_6__source: muted I: [pulseaudio] source.c: Created source 1 "alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_6__source" with sample spec s16le 2ch 48000Hz and channel map front-left,front-right I: [pulseaudio] source.c: alsa.resolution_bits = "16" I: [pulseaudio] source.c: device.api = "alsa" I: [pulseaudio] source.c: device.class = "sound" I: [pulseaudio] source.c: alsa.class = "generic" I: [pulseaudio] source.c: alsa.subclass = "generic-mix" I: [pulseaudio] source.c: alsa.name = "" I: [pulseaudio] source.c: alsa.id = "DMIC32 (*)" I: [pulseaudio] source.c: alsa.subdevice = "0" I: [pulseaudio] source.c: alsa.subdevice_name = "subdevice #0" I: [pulseaudio] source.c: alsa.device = "6" I: [pulseaudio] source.c: alsa.card = "0" I: [pulseaudio] source.c: alsa.card_name = "sof-hda-dsp" I: [pulseaudio] source.c: alsa.long_card_name = "LENOVO-20QFCTO1WW-ThinkPadX1Yoga4th-20QFCTO1WW" I: [pulseaudio] source.c: alsa.driver_name = "snd_soc_skl_hda_dsp" I: [pulseaudio] source.c: device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic" I: [pulseaudio] source.c: sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0" I: [pulseaudio] source.c: device.bus = "pci" I: [pulseaudio] source.c: device.vendor.id = "8086" I: [pulseaudio] source.c: device.vendor.name = "Intel Corporation" I: [pulseaudio] source.c: device.product.id = "9dc8" I: [pulseaudio] source.c: device.product.name = "Cannon Point-LP High Definition Audio Controller" I: [pulseaudio] source.c: device.string = "hw:0,6" I: [pulseaudio] source.c: device.buffering.buffer_size = "65472" I: [pulseaudio] source.c: device.buffering.fragment_size = "16320" I: [pulseaudio] source.c: device.access_mode = "mmap+timer" I: [pulseaudio] source.c: device.profile.name = "BassSpeaker: hw:0,6: source" I: [pulseaudio] source.c: device.profile.description = "DMIC Stereo" I: [pulseaudio] source.c: device.description = "Cannon Point-LP High Definition Audio Controller DMIC Stereo" I: [pulseaudio] source.c: module-udev-detect.discovered = "1" I: [pulseaudio] source.c: device.icon_name = "audio-card-pci" I: [pulseaudio] alsa-source.c: Using 4.0 fragments of size 16320 bytes (85.00ms), buffer size is 65472 bytes (341.00ms) I: [pulseaudio] alsa-source.c: Time scheduling watermark is 18.38ms I: [alsa-source-DMIC32 (*)] util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5. I: [alsa-source-DMIC32 (*)] alsa-source.c: Starting capture. I: [pulseaudio] core.c: default_source: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink.monitor -> alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_6__source I: [pulseaudio] alsa-util.c: Trying to disable ALSA period wakeups, using timers only I: [pulseaudio] alsa-util.c: Device hw:0,0 doesn't support 44100 Hz, changed to 48000 Hz. I: [pulseaudio] alsa-util.c: ALSA period wakeups disabled I: [pulseaudio] alsa-source.c: Successfully opened device hw:0,0. I: [pulseaudio] alsa-source.c: Selected mapping 'Headset Mic' (BassSpeaker: hw:0,0: source). I: [pulseaudio] alsa-source.c: Successfully enabled mmap() mode. I: [pulseaudio] alsa-source.c: Successfully enabled timer-based scheduling mode. I: [pulseaudio] alsa-ucm.c: ALSA device hw:0,0 roles: (null) I: [pulseaudio] module-device-restore.c: Restoring port for source source:alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_0__source. I: [pulseaudio] source.c: Created source 2 "alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_0__source" with sample spec s16le 2ch 48000Hz and channel map front-left,front-right I: [pulseaudio] source.c: alsa.resolution_bits = "16" I: [pulseaudio] source.c: device.api = "alsa" I: [pulseaudio] source.c: device.class = "sound" I: [pulseaudio] source.c: alsa.class = "generic" I: [pulseaudio] source.c: alsa.subclass = "generic-mix" I: [pulseaudio] source.c: alsa.name = "" I: [pulseaudio] source.c: alsa.id = "HDA Analog (*)" I: [pulseaudio] source.c: alsa.subdevice = "0" I: [pulseaudio] source.c: alsa.subdevice_name = "subdevice #0" I: [pulseaudio] source.c: alsa.device = "0" I: [pulseaudio] source.c: alsa.card = "0" I: [pulseaudio] source.c: alsa.card_name = "sof-hda-dsp" I: [pulseaudio] source.c: alsa.long_card_name = "LENOVO-20QFCTO1WW-ThinkPadX1Yoga4th-20QFCTO1WW" I: [pulseaudio] source.c: alsa.driver_name = "snd_soc_skl_hda_dsp" I: [pulseaudio] source.c: device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic" I: [pulseaudio] source.c: sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0" I: [pulseaudio] source.c: device.bus = "pci" I: [pulseaudio] source.c: device.vendor.id = "8086" I: [pulseaudio] source.c: device.vendor.name = "Intel Corporation" I: [pulseaudio] source.c: device.product.id = "9dc8" I: [pulseaudio] source.c: device.product.name = "Cannon Point-LP High Definition Audio Controller" I: [pulseaudio] source.c: device.string = "hw:0,0" I: [pulseaudio] source.c: device.buffering.buffer_size = "65472" I: [pulseaudio] source.c: device.buffering.fragment_size = "16320" I: [pulseaudio] source.c: device.access_mode = "mmap+timer" I: [pulseaudio] source.c: device.profile.name = "BassSpeaker: hw:0,0: source" I: [pulseaudio] source.c: device.profile.description = "Headset Mic" I: [pulseaudio] source.c: device.description = "Cannon Point-LP High Definition Audio Controller Headset Mic" I: [pulseaudio] source.c: module-udev-detect.discovered = "1" I: [pulseaudio] source.c: device.icon_name = "audio-card-pci" I: [pulseaudio] alsa-source.c: Using 4.0 fragments of size 16320 bytes (85.00ms), buffer size is 65472 bytes (341.00ms) I: [pulseaudio] alsa-source.c: Time scheduling watermark is 18.38ms I: [alsa-source-HDA Analog (*)] util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5. I: [alsa-source-HDA Analog (*)] alsa-source.c: Starting capture. I: [pulseaudio] module.c: Loaded "module-alsa-card" (index: #6; argument: "device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""). I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0 (alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic) module loaded. I: [pulseaudio] module-udev-detect.c: Found 1 cards. I: [pulseaudio] module.c: Loaded "module-udev-detect" (index: #5; argument: ""). I: [pulseaudio] module.c: Loaded "module-esound-protocol-unix" (index: #7; argument: ""). I: [pulseaudio] module.c: Loaded "module-native-protocol-unix" (index: #8; argument: ""). I: [pulseaudio] module.c: Loaded "module-gsettings" (index: #9; argument: ""). I: [pulseaudio] module-default-device-restore.c: Restoring default sink 'ladspa_output.mbeq_1197.mbeq'. I: [pulseaudio] core.c: configured_default_sink: (unset) -> ladspa_output.mbeq_1197.mbeq I: [pulseaudio] module-default-device-restore.c: No previous default source setting, ignoring. I: [pulseaudio] module.c: Loaded "module-default-device-restore" (index: #10; argument: ""). I: [pulseaudio] module.c: Loaded "module-rescue-streams" (index: #11; argument: ""). I: [pulseaudio] module.c: Loaded "module-always-sink" (index: #12; argument: ""). I: [pulseaudio] module.c: Loaded "module-intended-roles" (index: #13; argument: ""). I: [pulseaudio] module.c: Loaded "module-suspend-on-idle" (index: #14; argument: ""). I: [pulseaudio] client.c: Created 0 "Login Session 1" I: [pulseaudio] core.c: exit_idle_time: 20 -> 0 I: [pulseaudio] module.c: Loaded "module-systemd-login" (index: #15; argument: ""). I: [pulseaudio] module.c: Loaded "module-position-event-sounds" (index: #16; argument: ""). I: [pulseaudio] module.c: Loaded "module-role-cork" (index: #17; argument: ""). I: [pulseaudio] module.c: Loaded "module-filter-heuristics" (index: #18; argument: ""). I: [pulseaudio] module.c: Loaded "module-filter-apply" (index: #19; argument: ""). E: [pulseaudio] module-ladspa-sink.c: Master sink not found. E: [pulseaudio] module.c: Failed to load module "module-ladspa-sink" (argument: "sink_name=ladspa_output.mbeq_1197.mbeq sink_master=PulseEffects_apps plugin=mbeq_1197 label=mbeq control=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"): initialization failed. E: [pulseaudio] main.c: Sink ladspa_output.mbeq_1197.mbeq does not exist. E: [pulseaudio] main.c: No sink found by this name or index. I: [pulseaudio] main.c: Daemon startup complete. I: [pulseaudio] module-suspend-on-idle.c: Source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_0__source idle for too long, suspending ... I: [alsa-source-HDA Analog (*)] alsa-source.c: Device suspended... I: [pulseaudio] module-suspend-on-idle.c: Source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_0_6__source idle for too long, suspending ... I: [alsa-source-DMIC32 (*)] alsa-source.c: Device suspended... I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.BassSpeaker__hw_sofhdadsp_0__sink idle for too long, suspending ... I: [alsa-sink-HDA Analog (*)] alsa-sink.c: Device suspended... |
@tokyovigilante ok good. As said before the "master" and "dmic" take different paths, "master" going through the legacy hda path, dmic going through sof. If you have my patches on your topology, you should see Dmic0 on alsamixer. There should be "Dmic0 Capture Volume" and "Dmic0 Capture Switch" when listing with "amixer contents" . And yes you don't see the switch in alsamixer view (I'm not totally sure how to bind the volume and switch together in the driver that they would show up nicely as combined element). if you don't have Dmic0 in alsamixer something is not right with topology, so check that you have it patced, compiled and copied to proper folder. If you get this working, then check again pulseaudio... |
OK, am definitely missing Dmic0, will check again. |
@tokyovigilante so make sure you actually compile topologies and not only firmware... as I'm using our CI docker, they are separate commands. |
OK, I have been building topology specifically, but think I might have forgotten your branch, will build and check. I don't think I can build the firmware without an Intel certificate. |
@tokyovigilante you can build it but not install :) firmware is actually locked by device vendor... |
hmm ok, the amixer settings look ok, so I just wanted to make sure that the common hdmi driver is used and it seems to be the case. So pulseaudio can't set the channel count for any output (?) and that's why it is not creating any outputs -> no sounds. Can you try "aplay -Dhw:0,0 test.wav" and see can you hear anything? It is just good to eliminate first pulseaudio and try alsa only. Now you could also see dmesg at the same time you start pulseaudio to see little bit more info what goes wrong... |
Playback works fine there :) dmesg during PA start
|
@tokyovigilante ok good! All the fails seems to be pulseaudio trying to open the dmic with 2 channels and we have now 4 channel dmic topology. Could you just try and compile/copy the hda-generic-2ch topology on top of the 4ch topology and see what happens? |
So you mean: Still no PA output. pulseaudio -vvv
</details= |
@tokyovigilante yes exactly that, did you boot in between? |
Whoops, after reboot, looking better with PA playback restored. Still no input from DMIC though. pulseaudio -vvv
|
@tokyovigilante ok actually pulse log looks pretty good... so if you open the gnome sound settings and see "input" section, do you see dmic there? and can you toggle the mute and volume and see if something happens? |
I don't use a gnome desktop, but pavucontrol shows a "DMIC Stereo" device, but no input level monitoring, and a Skype test call doesn't record audio, so I don't think it is working unfortunately. |
@tokyovigilante aa yes of course, didn't remember that you we're on fedora, sorry. You could try now the previously mentioned "amixer -c 0 sset" thing to try toggle the mute leds as you now should have switches for both playback and dmic... |
The output mute LED works with amixer, but I don't have any mute switch in alsamixer to toggle for the microphone. |
yes you have to do it with something like As said I don't know how to bind the mute switch and volume together so they would be visible in alsamixer. You can get all the switches you have with something like: |
OK, |
@tokyovigilante I'm always struggling with amixer syntax, could you still try these: amixer -c 0 cset name='Master Playback Switch' on/off |
and it was "Dmic0 Capture Switch" |
Thanks, that does indeed get both LEDs to toggle! However I still don't have any input from the microphone via PA. I guess this is a topology issue? |
@tokyovigilante hooray! Ok thanks for your testing. Actually the 4ch topology case is something I didn't test and we probably need to change some setting in topology or driver so that Pulseaudio can open it in proper mode. I don't know where it guesses the channel value. |
Anecdotally I don't get quite as good sound out of the tweeters on my Yoga X1 either with the 2ch topology, they don't as loud when isolated by muting the Bass speakers in alsamixer even at 100% volume (which might just be my imagination to be fair). I have tried using alsactl --file store/restore to save and reload the 100% volume for the tweeters on reboot but it doesn't seem to stick. I will probably revert to the 1.3 topology/UCM for now as I need the Mic to work more than the LED ;) but this patch seems to work as advertised. Thank you for all your help and troubleshooting @juimonen. BTW @plbossart I see 1.4 has just been released today, is that likely to see a signed binary release |
Working on this with @lgirdwood |
@plbossart nice, thanks. @juimonen out of interest I saw that ALSA upstream have just added new SOF "ucm2" UCMs, so I pulled those and alsa-lib from master, installed them, and I have good audio quality with the tweeter and bass speaker, working DMIC and LEDs with the 1.3 topology and firmware. They don't need any machine specific UCM for the Bass speaker either. https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2/sof-hda-dsp |
@tokyovigilante that's for sharing and helping us improve the overall stack! much appreciated. |
@juimonen is this PR needed, waiting for approval? if not please close it |
no replies from @juimonen, closing |
@plbossart sorry missed this... This should be fine, this was intended to be merged to 5.0 release branch by @bardliao. This was just going little bit off rails with @tokyovigilante repeating the steps somewhat successfully. I haven't seen anyone complaining about issues...can't approve myself :) |
@ClarexZhou Could you test the PR on the existing products? To make sure there is no regression on existing products. |
Already done side effect test on CML notebook with codec ALC3204 on 11/8/2019. Without thesofproject/kconfig#22 Kconfig: No side effect. All functions work OK. |
Thanks @ClarexZhou. @juimonen Looks like these commits are all cherry-picked from upstream, right? If yes, I will merge it blindly. |
@bardliao yes everything from upstream. So they are all related to mute led enabling. |
these are patches for making the dmic mute led working. The series includes couple other non-related patches for making the merge smoother.