Skip to contentSkip to conversation

baytrail-pcm-audio: audio broken on Lenovo Thinkpad Tablet 10

DISCUSSION Sebastien Bourdeauducq 2 participants 3 messages Feb 17, 2015 – Mar 30, 2015 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

the Thinkpad Tablet 10 has an impressive amount of problems under Linux, among which the audio is completely broken.

The kernel log is:

[    7.532413] rt5640 i2c-10EC5640:00: Device with ID register 6271 is not rt5640/39
[    7.908208] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
[    7.908231] platform byt-rt5640: Driver byt-rt5640 requests probe deferral
[    7.931549] baytrail-pcm-audio baytrail-pcm-audio: error: invalid DMA engine 0
[    7.931557] baytrail-pcm-audio baytrail-pcm-audio: sst_dma_new failed -22
[    7.967040] baytrail-pcm-audio baytrail-pcm-audio: FW version: 04.05.13.a0
[    7.967047] baytrail-pcm-audio baytrail-pcm-audio: Build type: a0
[    7.967051] baytrail-pcm-audio baytrail-pcm-audio: Build date: Apr  2 2014 14:14:39
[    7.967212] byt-rt5640 byt-rt5640: ASoC: CODEC DAI rt5640-aif1 not registered
[    7.967248] platform byt-rt5640: Driver byt-rt5640 requests probe deferral

I'm running kernel 3.19 with the latest firmware from the linux-firmware repository.

Sebastien

#1 lore raw

Hi

Quoted 8 lines · Sebastien Bourdeauducq

Hi,

the Thinkpad Tablet 10 has an impressive amount of problems under Linux, among which the audio is completely broken.

The kernel log is:

[    7.532413] rt5640 i2c-10EC5640:00: Device with ID register 6271 is

not rt5640/39

Bard, Oder: Is this codec even from RT564x family? To me it looks RT567x based on RT5670_DEVICE_ID 0x6271 in sound/soc/codecs/rt5670.c.

At least sound/soc/codecs/rt5640.c: rt5640_i2c_probe() appears to find above same value 0x6271 from the register RT5640_VENDOR_ID2.

If that's the case then one might want to ask Lenovo why they are using completely wrong ACPI ID for the codec.

Signature · 1 line
Jarkko

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi,

Quoted 6 lines · Jarkko Nikula
Quoted 6 lines

Is there a way I can try sound/soc/codecs/rt5670.c instead? I edited it so that it attaches to my ACPI ID (and rt5640 doesn't), but that did not work. I noticed that the kernel has some Baytrail-specific modules for RT564x, and I guess those would need to be changed as well - but it's not straightforward.

Quoted 8 lines

Basically three changes are needed:

1. Hack add "10EC5640" to rt5670.c as you have done
2. Add a new machine driver sound/soc/intel/sst-acpi.c/byt-rt5670 I guess cht_bsw_rt5672.c can be used as a starting point for audio routes and byt-rt5640.c for dai link definitions.mess
3. Hack change sound/soc/intel/sst-acpi.c so that "10EC5640" loads the new machine driver instead of byt-rt5640.

Thanks. I did that and I get the following in the kernel log:

[    6.831422] byt-rt5670 byt-rt5670: ASoC: CPU DAI baytrail-pcm-audio
not regis
tered
[    6.831443] byt-rt5670 byt-rt5670: snd_soc_register_card failed -517
[    6.831453] platform byt-rt5670: Driver byt-rt5670 requests probe

deferral

[    6.884013] baytrail-pcm-audio baytrail-pcm-audio: error: invalid DMA
engine
0
[    6.884023] baytrail-pcm-audio baytrail-pcm-audio: sst_dma_new failed -22

Note: it seems to me that all Baytrail machines will have this "error:
invalid DMA engine" message. AFAICT it is emitted from sst-firmware.c because sst->pdata->dma_engine is 0 and in sst-acpi.c the function sst_acpi_probe does not set it for Baytrail because resindex_dma_base is -1 in sst_acpi_baytrail_desc.

[    6.924094] baytrail-pcm-audio baytrail-pcm-audio: FW version:
04.05.13.a0
[    6.924106] baytrail-pcm-audio baytrail-pcm-audio: Build type: a0
[    6.924109] baytrail-pcm-audio baytrail-pcm-audio: Build date: Apr  2
2014 14:14:39
[    6.931503] byt-rt5670 byt-rt5670: rt5670-aif1 <-> baytrail-pcm-audio
mapping ok
[    6.931624] byt-rt5670 byt-rt5670: ASoC: no source widget found for
ssp2 Tx
[    6.931629] byt-rt5670 byt-rt5670: ASoC: Failed to add route ssp2 Tx
-> direct -> AIF1 Playback
[    6.931636] byt-rt5670 byt-rt5670: ASoC: no source widget found for
codec_out0
[    6.931640] byt-rt5670 byt-rt5670: ASoC: Failed to add route
codec_out0 -> direct -> ssp2 Tx
[    6.931647] byt-rt5670 byt-rt5670: ASoC: no source widget found for
codec_out1
[    6.931650] byt-rt5670 byt-rt5670: ASoC: Failed to add route
codec_out1 -> direct -> ssp2 Tx
[    6.931656] byt-rt5670 byt-rt5670: ASoC: no source widget found for
ssp2 Rx
[    6.931660] byt-rt5670 byt-rt5670: ASoC: Failed to add route ssp2 Rx
-> direct -> codec_in0
[    6.931666] byt-rt5670 byt-rt5670: ASoC: no source widget found for
ssp2 Rx
[    6.931670] byt-rt5670 byt-rt5670: ASoC: Failed to add route ssp2 Rx
-> direct -> codec_in1
[    6.931677] byt-rt5670 byt-rt5670: ASoC: no sink widget found for ssp2 Rx
[    6.931680] byt-rt5670 byt-rt5670: ASoC: Failed to add route AIF1

Capture -> direct -> ssp2 Rx

My byt-rt5670 is there:
https://gist.github.com/sbourdeauducq/8c5da8ac0da13e21ee31

I have to say that I am unfamiliar with Intel SST and I'm don't quite know what I am doing there. I wish sound devices were straightforward DMA-to-DAC devices instead of this complicated DSP architecture which AFAICT boils down to a glorified memcpy/resampler under Linux (this seems to be a pattern with this SoC though; I had a look at how to get the MIPI cameras to work on this machine and it's an even worse mess).

Quoted 3 lines

However, above changes may not make audio working since there has been couple other new Baytrail based machines with correct codec but audio seems to not move between the DSP and codec chip.

Despite the error messages, the audio device is created and userspace applications can send data into it, but no sound is coming out. I also have to say that the settings in alsamixer are a terrible mess which seems not to originate from my hacks.

Quoted 2 lines

One assumption is if they use another SSP port than SSP2. Unfortunately it's difficult to test since Linux DSP FW is hard-coded for SSP2.

If only there were no DSP in the first place...

Sébastien