Skip to content
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

Remove cml_rt1011_rt5682 machine driver #4897

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

brentlu
Copy link

@brentlu brentlu commented Apr 3, 2024

This driver supports ALC5682 headphone codec with 2 or 4 ALC1011 speaker amplifier. Move the support to sof_rt5682 and sof_realtek_common module then delete the cml_rt1011_rt5682 machine driver. Tested on CML Chromebook Helios.

bardliao
bardliao previously approved these changes Apr 3, 2024
sound/soc/intel/boards/sof_realtek_common.c Show resolved Hide resolved
sound/soc/intel/boards/sof_realtek_common.c Show resolved Hide resolved
sound/soc/intel/boards/sof_rt5682.c Show resolved Hide resolved
RT1011 + RT5682 I2S codec.
Say Y if you have such a device.
If unsure select "N".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a .config file only selected this option, then with a make olddefconfig the sof_rt5682 machine would not be selected.
For true backwards compatibility I think we need to keep this Kconfig and use 'imply sof_rt5682' or something to keep the link.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add the option back

@plbossart
Copy link
Member

@ujfalusi @marc-hb @fredoh9 any idea why the SOF kernel builds fail now?

It started last night, what changed?

@fredoh9
Copy link
Collaborator

fredoh9 commented Apr 3, 2024

SOFCI TEST

plbossart
plbossart previously approved these changes Apr 4, 2024
@plbossart
Copy link
Member

@plbossart
Copy link
Member

SOFCI TEST

@marc-hb
Copy link
Collaborator

marc-hb commented Apr 5, 2024

CML FW failing to load again in https://sof-ci.01.org/linuxpr/PR4897/build2055/devicetest/index.html so this was not a fluke.

@marc-hb
Copy link
Collaborator

marc-hb commented Apr 5, 2024

We have a well-known bug where we don't get the kernel logs when the firmware does not load. It's very painful. Please upvote and comment to help prioritize it:
thesofproject/sof-test#1112

I used ssh and I fetch some logs, see below. UTC time (as it always should be)

Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 0 (PCM0P) is ready [type: 23, pipe: 1, pins: 0 / 0, stream: Passthrough Playback 0]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_control_load: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: load control type 1 name : 1 Master Playback Volume
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_control_load_volume: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: load kcontrol index 1 chans 2
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 1 (PGA1.0) is ready [type: 6, pipe: 1, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 2 (BUF1.0) is ready [type: 31, pipe: 1, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 3 (BUF1.1) is ready [type: 31, pipe: 1, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 4 (SSP0.OUT) is ready [type: 27, pipe: 1, pins: 0 / 0, stream: SSP0-Codec]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_connect_dai_widget: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: connected widget SSP0.OUT -> DAI link SSP0-Codec
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 5 (PIPELINE.1.SSP0.OUT) is ready [type: 32, pipe: 1, pins: 0 / 0, stream: SSP0.OUT]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 6 (PCM0C) is ready [type: 24, pipe: 2, pins: 0 / 0, stream: Passthrough Capture 0]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_control_load: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: load control type 1 name : 2 Master Capture Volume
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_control_load_volume: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: load kcontrol index 7 chans 2
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 7 (PGA2.0) is ready [type: 6, pipe: 2, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 8 (BUF2.0) is ready [type: 31, pipe: 2, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 9 (BUF2.1) is ready [type: 31, pipe: 2, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 10 (SSP0.IN) is ready [type: 28, pipe: 2, pins: 0 / 0, stream: SSP0-Codec]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_connect_dai_widget: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: connected widget SSP0.IN -> DAI link SSP0-Codec
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 11 (PIPELINE.2.SSP0.IN) is ready [type: 32, pipe: 2, pins: 0 / 0, stream: SSP0.IN]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 12 (PCM1C) is ready [type: 24, pipe: 3, pins: 0 / 0, stream: Passthrough Capture 1]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 13 (BUF3.0) is ready [type: 31, pipe: 3, pins: 0 / 0, stream: none]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: snd_sof:sof_widget_ready: sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: widget 14 (DMIC0.IN) is ready [type: 28, pipe: 3, pins: 0 / 0, stream: dmic01]
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: error: can't connect DAI DMIC0.IN stream dmic01
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: error: failed to add widget id 0 type 28 name : DMIC0.IN stream dmic01
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof_rt5682 cml_rt5682_def: ASoC: failed to load widget DMIC0.IN
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof_rt5682 cml_rt5682_def: ASoC: topology: could not load header: -22
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: error: tplg component load failed -22
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: error: failed to load DSP topology -22
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof_rt5682 cml_rt5682_def: ASoC: failed to instantiate card -22
Apr 04 14:39:13 jf-cml-hel-rt5682-07 kernel: sof_rt5682 cml_rt5682_def: probe with driver sof_rt5682 failed with error -22

@plbossart
Copy link
Member

@brentlu looks like we have a disconnect between machine driver and topology now, so this PR can't be merged until CI tests are ok.

@brentlu
Copy link
Author

brentlu commented Apr 8, 2024

There is something wrong with the dmic dai link. May I know the configuration of the device? Is it running ChromeOS? What's the OS image version?

@plbossart
Copy link
Member

I can reproduce this issue manually on jf-cml-hel-rt5682-05, this really isn't a CI problem.

My guess is that we're now having a mismatch in topology, what's used by this PR is:

[    3.403953] snd_soc_sof_rt5682:sof_audio_probe: sof_rt5682 cml_rt5682_def: sof_rt5682_quirk = 801

[    3.263893] sof-audio-pci-intel-cnl 0000:00:1f.3:  Firmware file:     intel/sof/community/sof-cml.ri
[    3.263897] sof-audio-pci-intel-cnl 0000:00:1f.3:  Topology file:     intel/sof-tplg/sof-cml-rt1011-rt5682.tplg

dmesg.log

@brentlu
Copy link
Author

brentlu commented Apr 9, 2024

Something wrong with dmic01 dai link which does not happen on my side. Does the CI run a clean build since there is change in Makefile?

HW: helios
OS: hatch-release/R122-15708.0.0
kernel: chrome-v5.15
fw/tplg: inbox or fafc1ca00 (cavs2.5-001-drop-stable)

[    6.321469] sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: ready widget id 12 pipe 3 type 24 name : PCM1C stream Passthrough Capture 1
[    6.321473] sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: ready widget id 13 pipe 3 type 31 name : BUF3.0 stream none
[    6.321476] sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: ready widget id 14 pipe 3 type 28 name : DMIC0.IN stream dmic01
[    6.321479] sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: connected widget DMIC0.IN -> DAI link dmic01
[    6.321482] sof-audio-pci-intel-cnl 0000:00:1f.3: tplg: ready widget id 15 pipe 3 type 32 name : PIPELINE.3.DMIC0.IN stream DMIC0.IN

@bardliao
Copy link
Collaborator

bardliao commented Apr 9, 2024

@brentlu @plbossart dmic01 is defined in cml_rt1011_rt5682_dailink[] consistently, but, it depends on ctx->dmic_be_num in sof_rt5682.c. And I checked jf-cml-hel-rt5682-05 the ctx->dmic_be_num value is 0.

Edit: is_legacy_cpu is true. That's why ctx->dmic_be_num is 0. And if I test dmic capture without this PR, I will get below error

[  175.731140] snd_sof:sof_ipc3_pcm_hw_params: sof-audio-pci-intel-cnl 0000:00:1f.3: stream_tag 2
[  175.731144] snd_sof:ipc3_log_header: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[  175.731564] sof-audio-pci-intel-cnl 0000:00:1f.3: ipc tx error for 0x60010000 (msg/reply size: 108/20): -22
[  175.732173] sof-audio-pci-intel-cnl 0000:00:1f.3: HW params ipc failed for stream 2
[  175.732778] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -22

It let me wonder if CML_HEL_RT5682 really supports DMIC?

@brentlu
Copy link
Author

brentlu commented Apr 9, 2024

@plbossart
Copy link
Member

Maybe we could test it after this patch got merged.

https://patchwork.kernel.org/project/alsa-devel/patch/6e16433f-1897-46a2-b3ee-e177e7d846b8@moroto.mountain/

Can you pick this patch on your branch and resubmit @brentlu ?

@bardliao
Copy link
Collaborator

Maybe we could test it after this patch got merged.

https://patchwork.kernel.org/project/alsa-devel/patch/6e16433f-1897-46a2-b3ee-e177e7d846b8@moroto.mountain/

I manually tested it on jf-cml-hel-rt5682-05 and it works.

@brentlu brentlu force-pushed the helios-upgrade branch 4 times, most recently from b332ca8 to d82b703 Compare April 10, 2024 03:24
@brentlu
Copy link
Author

brentlu commented Apr 10, 2024

RMMOD snd_soc_acpi_intel_match
rmmod: ERROR: Module snd_soc_acpi_intel_match is in use by: snd_soc_intel_sof_board_helpers

update the sof_remove script :
thesofproject/sof-test#1107

brentlu and others added 4 commits April 10, 2024 19:10
Add support for boards with four ALC1011 amplifiers. Configuration is
copied from cml_rt1011_rt5682 machine driver for backward
compatibility with existing cml devices.

Signed-off-by: Brent Lu <brent.lu@intel.com>
For cml boards, ALC1011 speaker amplifier is supported by machine
driver cml_rt1011_rt5682. Use same driver name for backward
compatibility with existing devices on market.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Delete this driver and use sof_rt5682 machine driver instead.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Initialize "is_legacy_cpu" to false to prevent an uninitialized variable
bug.

Fixes: 8efcd48 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/6e16433f-1897-46a2-b3ee-e177e7d846b8@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
@plbossart
Copy link
Member

SOFCI TEST

@plbossart plbossart requested a review from bardliao April 11, 2024 14:28
@plbossart
Copy link
Member

tests look ok now, merging.

@plbossart plbossart merged commit 46537ef into thesofproject:topic/sof-dev Apr 11, 2024
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants