Bug 115201

Summary: "no backend DAIs enabled for Baytrail Audio Port" on DEXP Ursus 7W with bytcr_rt5640
Product: Drivers Reporter: RussianNeuroMancer (russianneuromancer)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: jbMacBrodie, joel, Keith.miller, paul+kernel.org, sachinx.mokashi, tiwai, vinod.koul, yang.jie, youling257, Yurocka
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.4.6 Subsystem:
Regression: No Bisected commit-id:
Attachments: DSDT
Firmwares
dmesg with Linux 4.5
dmesg with 4.5 and acpi_ipc_irq_index = 0
dmesg 4.8.7 with "detect audio routing with CHAN package" patch

Description RussianNeuroMancer 2016-03-23 20:59:55 UTC
Created attachment 210481 [details]
DSDT

Audio adapter can't start on DEXP Ursus 7W with byt-rt5640, dmesg | grep audio:
[    7.083873] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
[    7.111665] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
[    7.196096] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
[    7.201380] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
[    7.380332] baytrail-pcm-audio baytrail-pcm-audio: ipc: error DSP boot timeout
[    7.573918] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
[    9.632853] byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered

Ubuntu Gnome 16.04 x86_64, updated today
Linux 4.4.0-15 with patches https://github.com/hadess/rtl8723bs/tree/master/patches
linux-firmware package version is 1.157, included Intel firmwares listed in attached firmwares.txt
DSDT is also attached.
Comment 1 RussianNeuroMancer 2016-03-23 21:00:15 UTC
Created attachment 210491 [details]
Firmwares
Comment 2 RussianNeuroMancer 2016-03-23 22:51:07 UTC
Created attachment 210501 [details]
dmesg with Linux 4.5

There is no "error DSP boot timeout" with Linux 4.5, however audio still not working (no sound adapters detected). "Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port" error message get repeated many more times in comparison with Linux 4.4.

Please look into attached dmesg.
Comment 3 RussianNeuroMancer 2016-03-27 09:02:08 UTC
Created attachment 210801 [details]
dmesg with 4.5 and acpi_ipc_irq_index = 0

With acpi_ipc_irq_index = 0 (/sound/soc/intel/atom/sst/sst_acpi.c) firmware downlading seems successful:
[    9.846742] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok
[    9.846832] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
[    9.846880] compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping ok
[    9.869875] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp2-port mapping ok

But there is stil no sound:
[   23.165318]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   23.165763]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   23.166267]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   23.167356]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
Comment 4 jbMacAZ 2016-03-29 00:24:57 UTC
Hundreds of "no backend DAIs enabled for Baytrail..." errors in dmesg with Asus T100-CHI starting with kernel 4.5.0-rc4 through 4.6-rc1-next.  CHI Uses rt5640 also.  There is a dmesg posted for bug#114561 with other details.
Comment 5 Keyon 2016-04-06 02:29:45 UTC
+ Vinod whose team own the driver.
Comment 6 Vinod Koul 2016-04-06 02:30:09 UTC
Thanks for your email

I am attending ELC-NA, pls expect delayed response

Regards
--
~Vinod
Comment 7 Joel Holdsworth 2016-04-25 02:17:18 UTC
This issue is being handled in #117141.

Can you attach the output of dmidecode, so that the DMI system identification can be added to the quirk-table in fix patch-set attached to that bug?
Comment 9 Paul Mansfield 2016-06-15 16:26:23 UTC
I am hoping for progress on this as I think this might solve the problem with broken sound on the Toshiba Click Mini as well.
Comment 10 Sachin Mokashi 2016-06-21 06:23:28 UTC
The following error about the missing backend DAI is due to the missing Alsamixer settings:

[   23.165318]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port

In this driver we use DPCM, which means that you have to route Front End
to a BackEnd and then only you can open a device. Without linking to BE it
will fail.

Would you please post the output of the command "aplay -l" to check if a sound card is getting created or not. 

If it is getting created, the output of "aplay -l" should look something like:

card 0: baytrailcraudio [baytrailcraudio], device 0: Baytrail Audio (*) []
   Subdevices: 1/1
   Subdevice #0: subdevice #0

If sound card is getting created, you can proceed with executing the following amixer commands:

For Playback:

#DSP routing
amixer -c0 sset 'codec_out0 mix 0 pcm0_in' on
amixer -c0 sset 'media0_out mix 0 media1_in' on
amixer -c0 sset 'media1_in Gain 0' 80% 
amixer -c0 sset 'media1_in Gain 0 Ramp Delay' 50
amixer -c0 sset 'media1_in Gain 0' off
amixer -c0 sset 'pcm0_in Gain 0' 80% 
amixer -c0 sset 'pcm0_in Gain 0 Ramp Delay' 50
amixer -c0 sset 'pcm0_in Gain 0' off
amixer -c0 sset 'codec_out0 Gain 0' 80%
amixer -c0 sset 'codec_out0 Gain 0 Ramp Delay' 50
amixer -c0 sset 'codec_out0 Gain 0' off

#Codec routing
amixer -c0 sset "DAC MIXL INF1" on
amixer -c0 sset "DAC MIXR INF1" on
amixer -c0 sset "Stereo DAC MIXL DAC L1" on
amixer -c0 sset "Stereo DAC MIXR DAC R1" on
amixer -c0 sset "SPK MIXL DAC L1" on
amixer -c0 sset "SPK MIXR DAC R1" on
amixer -c0 sset "SPOL MIX SPKVOL L" on
amixer -c0 sset "SPOR MIX SPKVOL R" on
amixer -c0 sset "SPOL MIX DAC L1" on
amixer -c0 sset "SPOR MIX DAC R1" on
amixer -c0 sset "Speaker L" on
amixer -c0 sset "Speaker R" on
amixer -c0 sset "Headphone" off
amixer -c0 sset "Ext Spk" on

Hope this helps!
Comment 11 carlos.valin 2016-07-01 01:49:02 UTC
Same problem in Acer aspire switch 10
Comment 12 Yurii 2016-07-21 18:37:50 UTC
(In reply to Sachin Mokashi from comment #10)

DEXP Ursus GX110 ERA

yura@yura-DEXP-OEM:~$ dmesg | aplay -l
**** Список PLAYBACK устройств ****
карта 0: bytcrrt5640 [bytcr-rt5640], устройство 0: Baytrail Audio (*) []
  Подустройства: 1/1
  Подустройство №0: subdevice #0
карта 0: bytcrrt5640 [bytcr-rt5640], устройство 1: Deep-Buffer Audio (*) []
  Подустройства: 1/1
  Подустройство №0: subdevice #0
yura@yura-DEXP-OEM:~$
Comment 13 Yurii 2016-07-21 18:47:20 UTC
yura@yura-DEXP-OEM:~$ dmesg
[    0.000000] Linux version 4.6.0-040600-generic (root@server-405) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) ) #201605151930 SMP Thu May 19 14:30:18 NOVT 2016
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.6.0-040600-generic root=UUID=74d41c37-9c88-4596-989b-a5878d959eb1 ro quiet splash vt.handoff=7
Comment 14 Sachin Mokashi 2016-07-22 04:58:49 UTC
(In reply to Yurii from comment #12)
> (In reply to Sachin Mokashi from comment #10)
> 
> DEXP Ursus GX110 ERA
> 
> yura@yura-DEXP-OEM:~$ dmesg | aplay -l
> **** Список PLAYBACK устройств ****
> карта 0: bytcrrt5640 [bytcr-rt5640], устройство 0: Baytrail Audio (*) []
>   Подустройства: 1/1
>   Подустройство №0: subdevice #0
> карта 0: bytcrrt5640 [bytcr-rt5640], устройство 1: Deep-Buffer Audio (*) []
>   Подустройства: 1/1
>   Подустройство №0: subdevice #0
> yura@yura-DEXP-OEM:~$

Ok. Sound card is getting created. Did you do the alsa-mixer settings as mentioned? Are you still seeing No-Backend DAIs found error messages?


Also, We have merged quite a few patches upstream, can you please test the upstream kernel https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git for-next branch and upstrem fw repo https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/
Comment 15 youling257 2016-08-31 23:52:22 UTC
(In reply to Sachin Mokashi from comment #14)
> (In reply to Yurii from comment #12)
> > (In reply to Sachin Mokashi from comment #10)
> > 
> > DEXP Ursus GX110 ERA
> > 
> > yura@yura-DEXP-OEM:~$ dmesg | aplay -l
> > **** Список PLAYBACK устройств ****
> > карта 0: bytcrrt5640 [bytcr-rt5640], устройство 0: Baytrail Audio (*) []
> >   Подустройства: 1/1
> >   Подустройство №0: subdevice #0
> > карта 0: bytcrrt5640 [bytcr-rt5640], устройство 1: Deep-Buffer Audio (*) []
> >   Подустройства: 1/1
> >   Подустройство №0: subdevice #0
> > yura@yura-DEXP-OEM:~$
> 
> Ok. Sound card is getting created. Did you do the alsa-mixer settings as
> mentioned? Are you still seeing No-Backend DAIs found error messages?
> 
> 
> Also, We have merged quite a few patches upstream, can you please test the
> upstream kernel
> https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git for-next
> branch and upstrem fw repo
> https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/

[   16.312394] bytcr_rt5640 bytcr_rt5640: quirk DMIC1_MAP enabled
[   16.312397] bytcr_rt5640 bytcr_rt5640: quirk DMIC enabled
[   16.312399] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF2 enabled
[   16.312401] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
[   16.312408] bytcr_rt5640 bytcr_rt5640: Failed to get MCLK from pmc_plt_clk_3: -2
[   16.312421] bytcr_rt5640: probe of bytcr_rt5640 failed with error -2
Comment 16 youling257 2016-09-02 17:05:18 UTC
I compile https://github.com/plbossart/sound/tree/t100taf-7, ok, dmesg
| grep bytcr
bytcr_rt5640 bytcr_rt5640: quirk DMIC1_MAP enabled
bytcr_rt5640 bytcr_rt5640: quirk DMIC enabled
bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF2 enabled
bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok
bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping ok
bytcr_rt5640 bytcr_rt5640: rt5640-aif2 <-> ssp0-port mapping ok

but still Baytrail Audio Port: ASoC: no backend DAIs enabled for
Baytrail Audio Port

and sh alsa_cr.sh,sh alsa_cr_spk.sh, but it still Baytrail Audio Port:
ASoC: no backend DAIs enabled for Baytrail Audio Port

this thread https://groups.google.com/d/msg/android-x86/un74okmr30g/Vm0NKfwfDQAJ
,few months ago,i did these,

sst-mfld-platform sst-mfld-platform: Enter: enable=1 port_name=ssp2-port

bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp2-port mapping ok

bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok

bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok

it still Baytrail Audio Port: ASoC: no backend DAIs enabled for
Baytrail Audio Port,
few months ago,i also sh alsa_cr.sh,sh alsa_cr_spk.sh, but it still
Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio
Port
Comment 17 RussianNeuroMancer 2016-11-13 01:17:34 UTC
Created attachment 244261 [details]
dmesg 4.8.7 with "detect audio routing with CHAN package" patch

Tested Linux 4.8.7 with this two additional commits:
https://github.com/plbossart/sound/commit/94dc3ddfb97fcaeaabd21be0a0bc5d50719c1b92
https://github.com/plbossart/sound/commit/2f797c8f7bda4312c305ac3733e0ee36482a0c9c

bytcr_rt5640 start normally:
[    8.872980] bytcr_rt5640 bytcr_rt5640: quirk DMIC1_MAP enabled
[    8.872983] bytcr_rt5640 bytcr_rt5640: quirk DMIC enabled
[    8.872985] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
[    8.979785] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok
[    8.979871] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
[    9.002705] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp2-port mapping ok

Audio device present in aplay output, but not present in Gnome Settings:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: bytcrrt5640 [bytcr-rt5640], device 0: Baytrail Audio (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: bytcrrt5640 [bytcr-rt5640], device 1: Deep-Buffer Audio (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Still many "[   18.861571]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port" error messages, and no sound.
Comment 18 RussianNeuroMancer 2016-11-13 01:39:42 UTC
UCM files from https://github.com/plbossart/UCM/tree/master/bytcr-rt5640 was added to /usr/share/alsa/ucm
Comment 19 RussianNeuroMancer 2016-11-20 16:12:16 UTC
With this branch https://github.com/plbossart/sound/commits/topic/v4.8-fixes and two commits mentioned above audio playback is working. As I understand this changes is heading upstream anyway so I close this report.
Comment 20 youling257 2016-11-20 16:19:02 UTC
/* change defaults for Baytrail-CR capture */
 +		byt_rt5640_quirk |= BYT_RT5640_IN1_MAP;
 +		byt_rt5640_quirk |= BYT_RT5640_DIFF_MIC;


/* change defaults for Baytrail-CR capture */
 +		byt_rt5640_quirk |= BYT_RT5640_IN3_MAP;



https://github.com/plbossart/sound/commit/2f797c8f7bda4312c305ac3733e0ee36482a0c9c

i'm wrong,ASoC: Intel: bytcr_rt5640: quirks for Insyde devices,should be in3_map,https://github.com/plbossart/sound/commit/94ad2b520b6355d1cbcbd59c0f01b5a8b75b0bc6