Sound on Chromebook Lenovo Ideapad Flex i3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello alsa user list.

I'm trying to get sound working on a Jasper Lake Chromebook:
- Lenovo Ideapad Flex i3
- ChromeOS dedede platform
- botenflex board

The sound device hardware consists of the SOF device included in the Jasper Lake SoC, plus some Realtek rt5682 codec and an rt1015 amplifier (AFAIK).

Originally this is a Chromebook, running ChromeOS. This means the ChromeOS CRAS Sound daemon is responsible for many of the things where a typical linux distribution uses alsa+pulseaudio/pipewire for.

With ChromeOS this works with some kind of an alsa-ucm not fully compatible with alsa+pulseaudio, see: https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/overlay-dedede/chromeos-base/chromeos-bsp-dedede/files/common/audio/ucm-config/sof-rt5682.rt1015.1mic/HiFi.conf

I'm using a kernel with patches from ChromeOS.

I tried to adapt those UCM files for my Debian 11 (Bullseye) userland. Which means I renamed the directory sof-rt5682.rt1015.1mic to sof-rt5682, including a sof-rt5682.conf, as the sound device itself is named like that.

The sound is generally working, except there are some bugs. Namely there some things inside the alsa-ucm which are not working with a standard-linux like Debian:

- CaptureChannelMap "0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1"
... for the 4-channel microphone created by the topology, which means to include only two of the four channels of the microphone -> this isn't recognized by alsa/pulseaudio so you have a microphone with 4 channels, where are two of them inserting some heavy white noise

- JackDev "sof-rt5682 Headset Jack"
- JackSwitch "6"
... for headphone insert detection, which means there is an input device for jack switch detection (/dev/input/event9) whose id is "sof-rt5682 Headset Jack" and the event code which get sent by this input event device should be of type "6"? I didn't figure this out. I can see the input event device with evtest. If I insert or remove the headset some event gets tiggered. But I get this running at all with alsa+pulseaudio. No jack detection here.

#####
# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:	Lid Switch
/dev/input/event1:	Power Button
/dev/input/event2:	AT Translated Set 2 keyboard
/dev/input/event3:	cros_ec_buttons
/dev/input/event4:	PRP0001:00
/dev/input/event5:	ELAN901C:00 04F3:2D70
/dev/input/event6:	ELAN901C:00 04F3:2D70 UNKNOWN
/dev/input/event7:	ELAN901C:00 04F3:2D70 UNKNOWN
/dev/input/event8:	Elan Touchpad
/dev/input/event9:	sof-rt5682 Headset Jack
/dev/input/event10:	sof-rt5682 HDMI/DP,pcm=2
/dev/input/event11:	sof-rt5682 HDMI/DP,pcm=3
/dev/input/event12:	sof-rt5682 HDMI/DP,pcm=4
Select the device event number [0-12]: 9
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "sof-rt5682 Headset Jack"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 164 (KEY_PLAYPAUSE)
    Event code 582 (KEY_VOICECOMMAND)
  Event type 5 (EV_SW)
    Event code 2 (SW_HEADPHONE_INSERT) state 0
    Event code 4 (SW_MICROPHONE_INSERT) state 0
Properties:
Testing ... (interrupt to exit)
Event: time 1652779723.850791, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 1
Event: time 1652779723.850791, -------------- SYN_REPORT ------------
Event: time 1652779725.425205, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 0
Event: time 1652779725.425205, -------------- SYN_REPORT ------------
####
^^ showing two events: first the headphone gets inserted and then removed again.

"alsactl monitor" remains empty when inserting or removing the headphone.

The device is:
####
# cat /proc/asound/devices
  2: [ 0- 6]: digital audio capture
  3: [ 0- 5]: digital audio capture
  4: [ 0- 0]: digital audio playback
  5: [ 0- 1]: digital audio playback
  6: [ 0- 1]: digital audio capture
  7: [ 0- 2]: digital audio playback
  8: [ 0- 3]: digital audio playback
  9: [ 0- 4]: digital audio playback
 10: [ 0- 2]: hardware dependent
 11: [ 0]   : control
 33:        : timer
# cat /proc/asound/cards
 0 [sofrt5682      ]: sof-rt5682 - sof-rt5682
                      Google-Boten-rev5
####

#### dmesg excerpt ####
[ 0.000000] Linux version 5.10.113-15975-gf1e650105c22 (root@hpusdt5) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #2 SMP PREEMPT Tue May 3 22:15:22 CEST 2022 [ 0.000000] Command line: cros_secure console=tty1 root=/dev/mmcblk0p2 i915.modeset=1 i915.force_probe=4e71 rootwait rw fbcon=logo-pos:center,logo-count:1 loglevel=0 splash
...
[ 7.439191] pci 0000:00:1f.3: attach allowed to drvr sof-audio-pci-intel-icl [internal device] [ 7.439221] sof-audio-pci-intel-icl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100 [ 7.439400] sof-audio-pci-intel-icl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100 [ 7.439510] sof-audio-pci-intel-icl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops) [ 7.445934] sof-audio-pci-intel-icl 0000:00:1f.3: use msi interrupt mode [ 7.456150] sof-audio-pci-intel-icl 0000:00:1f.3: hda codecs found, mask 4 [ 7.603876] sof-audio-pci-intel-icl 0000:00:1f.3: Firmware info: version 1:5:0-52df3 [ 7.603880] sof-audio-pci-intel-icl 0000:00:1f.3: Firmware: ABI 3:18:0 Kernel ABI 3:18:0 [ 7.603881] sof-audio-pci-intel-icl 0000:00:1f.3: Firmware debug build 1 on Aug 28 2021-11:40:46 - options:
                GDB: disabled
                lock debug: disabled
                lock vdebug: disabled
[ 7.787320] sof-audio-pci-intel-icl 0000:00:1f.3: Topology: ABI 3:17:0 Kernel ABI 3:18:0 [ 7.787621] sof-audio-pci-intel-icl 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[    7.809790] dmic-codec dmic-codec: GPIO lookup for consumer dmicen
[ 7.809793] dmic-codec dmic-codec: using lookup tables for GPIO lookup
[    7.809794] dmic-codec dmic-codec: No GPIO consumer dmicen found
[ 7.820791] snd_hda_codec_hdmi ehdaudio0D2: ASoC: sink widget AIF1TX overwritten [ 7.820797] snd_hda_codec_hdmi ehdaudio0D2: ASoC: source widget AIF1RX overwritten [ 7.838577] sof_rt5682 jsl_rt5682_rt1015: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3 [ 7.838580] sof_rt5682 jsl_rt5682_rt1015: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4 [ 7.855135] input: sof-rt5682 Headset Jack as /devices/pci0000:00/0000:00:1f.3/jsl_rt5682_rt1015/sound/card0/input10 [ 7.855213] input: sof-rt5682 HDMI/DP,pcm=2 as /devices/pci0000:00/0000:00:1f.3/jsl_rt5682_rt1015/sound/card0/input11 [ 7.855259] input: sof-rt5682 HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/jsl_rt5682_rt1015/sound/card0/input12 [ 7.855307] input: sof-rt5682 HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/jsl_rt5682_rt1015/sound/card0/input13 [ 9.846341] rt1015 i2c-10EC1015:01: ASoC: error at soc_component_read_no_lock on i2c-10EC1015:01: -121 [ 9.846442] rt1015 i2c-10EC1015:01: ASoC: error at soc_component_read_no_lock on i2c-10EC1015:01: -121 [ 9.846622] rt1015 i2c-10EC1015:01: ASoC: error at soc_component_read_no_lock on i2c-10EC1015:01: -121 [ 9.846809] rt1015 i2c-10EC1015:01: ASoC: error at soc_component_read_no_lock on i2c-10EC1015:01: -121
...
####

Maybe someone can help me here or point me in the right direction. Should some modified UCM file do it? (This would be fine as it seems to be the easiest solution) Or do I have to recompile a modified topology? Are there some changes necessary in the SOF firmware or the driver?

Feel free to ask me for further debug information. I don't know if it's allowed to attach files here on the list so I didn't include bigger outputs like amixer contents etc.

best regards
hede


_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux