Bug 113181

Summary: Baytrail-T: Lenovo Ideapad 100s no audio output
Product: Drivers Reporter: dan.g.tob
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: andy.bennett, braiamp, bugzilla, dan.g.tob, kellydavid178, pierre-louis.bossart, thaytan, vikram.chiruvolu, youling257, zeph
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.9 pre rc1 Subsystem:
Regression: No Bisected commit-id:
Bug Depends on:    
Bug Blocks: 113151    
Attachments: systemd journal
full dmesg from 4.5
dmesg from 4.7
dmesg from 4.9 (pre-rc1) 11-10-2016
the complete dsdt disassembly
lsmod after blacklist/whitelist edits
dmesg from 4.8
dmesg from 4.9rc1
dmesg from 4.9rc1
UCM file
dmesg from 4.9 rc1
100s AIF1 quirk
dmesg from 4.10-rc3
vikramsurya's dmesg, dmidecode and pulselog files

Description dan.g.tob 2016-02-25 19:34:59 UTC
Created attachment 206111 [details]
systemd journal

seeing lines like this in dmesg, full journal attached

Feb 26 05:42:28 dans-laptop kernel: byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
Feb 26 05:42:28 dans-laptop kernel: byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered
Feb 26 05:42:28 dans-laptop kernel: baytrail-pcm-audio baytrail-pcm-audio: ipc: error DSP boot timeout
Comment 1 dan.g.tob 2016-03-15 02:26:26 UTC
Created attachment 209191 [details]
full dmesg from 4.5

This is what I'm seeing with 4.5, looks like I need different firmware. Any hints as to which I should try?

[    7.861356] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 0 doesn't have DAPM widget!!!
[    7.861532] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 1 doesn't have DAPM widget!!!
[    7.861695] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 2 doesn't have DAPM widget!!!
[    7.861858] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 3 doesn't have DAPM widget!!!
[    7.862016] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in0_0 doesn't have DAPM widget!!!
[    7.862184] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in0_1 doesn't have DAPM widget!!!
[    7.862352] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in1_0 doesn't have DAPM widget!!!
[    7.862524] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in1_1 doesn't have DAPM widget!!!
[    7.899882] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 0 doesn't have DAPM widget!!!
[    7.900061] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 1 doesn't have DAPM widget!!!
[    7.900227] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 2 doesn't have DAPM widget!!!
[    7.900396] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 3 doesn't have DAPM widget!!!
[    7.900559] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in0_0 doesn't have DAPM widget!!!
[    7.900729] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in0_1 doesn't have DAPM widget!!!
[    7.900903] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in1_0 doesn't have DAPM widget!!!
[    7.901079] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in1_1 doesn't have DAPM widget!!!


[   11.235585] intel_sst_acpi 80860F28:00: Wait timed-out condition:0x0, msg_id:0x0 fw_state 0x1
[   11.235595] intel_sst_acpi 80860F28:00: fw download failed -16
[   11.235608] intel_sst_acpi 80860F28:00: FW download fail -16
[   11.236319]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
Comment 2 dan.g.tob 2016-03-15 02:27:52 UTC
I forgot to mention, device now shows up under /proc/asound/cards as bytcr-rt5640
Comment 3 Jan Schmidt 2016-05-06 16:58:30 UTC
Hey Dan, I'm trying to get the same laptop working. Check out bug #117141
Comment 4 dan.g.tob 2016-07-26 01:36:25 UTC
Created attachment 226421 [details]
dmesg from 4.7

some of the relevant lines

[    7.943578] rt5640 i2c-10EC5640:00: Failed to set DMIC clock
[    7.943675] rt5640 i2c-10EC5640:00: ASoC: PRE_PMU: DMIC CLK event failed: -22
[    8.975526] intel_sst_acpi 80860F28:00: Wait timed-out condition:0x0, msg_id:0x2 fw_state 0x3
[    8.975537] intel_sst_acpi 80860F28:00: fw returned err -16
[    9.975531] intel_sst_acpi 80860F28:00: Wait timed-out condition:0x0, msg_id:0x2 fw_state 0x3
[    9.975554] intel_sst_acpi 80860F28:00: fw returned err -16
[   10.975532] intel_sst_acpi 80860F28:00: Wait timed-out condition:0x0, msg_id:0x2 fw_state 0x3
[   10.975543] intel_sst_acpi 80860F28:00: fw returned err -16
.......
[   16.623550] intel_sst_acpi 80860F28:00: Wait timed-out condition:0x0, msg_id:0x0 fw_state 0x1
[   16.623561] intel_sst_acpi 80860F28:00: fw download failed -16
[   16.623574] intel_sst_acpi 80860F28:00: FW download fail -16
[   16.624316]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   16.624609]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   16.626126]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   16.626403]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   16.631887]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   16.632371]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
Comment 5 dan.g.tob 2016-10-11 18:47:20 UTC
Created attachment 241511 [details]
dmesg from 4.9 (pre-rc1) 11-10-2016

Todays daily ubuntu mainline kernel produces this output, still not working. I think MCLK_EN quirk needs to be disabled for this device.
http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2016-10-11/

[    5.932014] intel_sst_acpi 80860F28:00: Detected Baytrail-CR platform
[    5.932244] intel_sst_acpi 80860F28:00: LPE base: 0x90a00000 size:0x200000
[    5.932247] intel_sst_acpi 80860F28:00: IRAM base: 0x90ac0000
[    5.932277] intel_sst_acpi 80860F28:00: DRAM base: 0x90b00000
[    5.932286] intel_sst_acpi 80860F28:00: SHIM base: 0x90b40000
[    5.932308] intel_sst_acpi 80860F28:00: Mailbox base: 0x90b44000
[    5.932317] intel_sst_acpi 80860F28:00: DDR base: 0x20000000
[    5.932530] intel_sst_acpi 80860F28:00: Got drv data max stream 25

[    6.212582] bytcr_rt5640 bytcr_rt5640: quirk DMIC1_MAP enabled
[    6.212585] bytcr_rt5640 bytcr_rt5640: quirk DMIC enabled
[    6.212588] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF2 enabled
[    6.212590] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
[    6.212597] bytcr_rt5640 bytcr_rt5640: Failed to get MCLK from pmc_plt_clk_3: -2
[    6.212609] bytcr_rt5640: probe of bytcr_rt5640 failed with error -2
Comment 6 Pierre Bossart 2016-10-12 01:41:36 UTC
All the error messages are probably red-herrings. The MCLK error is specifically an issue with a missing patch that hasn't been merged by the clock framework folks yet.

Unless this is a different skew, the Lenovo 100s has a TI codec, there was a patch added last June, see
"ASoC: tlv320aix31xx: Add ACPI match for Lenovo 100S"
You should double check the DSDT table to confirm this.

to make this platform work, you'd need to add this ACPI ID in soc/intel/atom/sst/sst_acpi.c and add the relevant machine driver.
Comment 7 dan.g.tob 2016-10-12 13:51:22 UTC
(In reply to Pierre Bossart from comment #6)
> Unless this is a different skew, the Lenovo 100s has a TI codec, there was a
> patch added last June, see
> "ASoC: tlv320aix31xx: Add ACPI match for Lenovo 100S"
> You should double check the DSDT table to confirm this.
Yes, "ASoC: tlv320aix31xx: Add ACPI match for Lenovo 100S" appears to match my device, and I see that snd_soc_tlv320aic31xx is loaded.

Device (TTLV)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "10TI3100")  // _HID: Hardware ID
                Name (_CID, "10TI3100")  // _CID: Compatible ID
                Name (_DDN, "TI TLV320AIC3100 Codec Controller ")  // _DDN: DOS Device Name
                Name (_UID, One)  // _UID: Unique ID
                Name (OBJ1, Package (0x0A)

> you'd need to add this ACPI ID in soc/intel/atom/sst/sst_acpi.c
sst_acpi appears to match both of these.

Device (LPEA)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F28" /* Intel SST Audio DSP */)  // _HID: Hardware ID
            Name (_CID, "80860F28" /* Intel SST Audio DSP */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) Low Power Audio Controller - 80860F28")  // _DDN: DOS Device Name
            Name (_SUB, "80867270")  // _SUB: Subsystem ID
            Name (_UID, One)  // _UID: Unique ID
            Name (ADEP, Package (0x01)

Device (RTEK)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Name (_HID, "10EC5640" /* Realtek I2S Audio Codec */)  // _HID: Hardware ID
                Name (_CID, "10EC5640" /* Realtek I2S Audio Codec */)  // _CID: Compatible ID
                Name (_DDN, "RTEK Codec Controller ")  // _DDN: DOS Device Name
                Name (_UID, One)  // _UID: Unique ID
                Name (_SUB, "380117AA")  // _SUB: Subsystem ID
                Name (CHAN, Package (0x02)

> and add the relevant machine driver.
Not quite sure what you mean by this, but it is probably beyond my skill level.
Comment 8 dan.g.tob 2016-10-12 13:52:15 UTC
Created attachment 241591 [details]
the complete dsdt disassembly
Comment 9 Pierre Bossart 2016-10-12 13:57:44 UTC
I added a patch some time back to only match with codecs that are enabled, maybe there's additional work needed. 
It's not because a codec is listed in the DSDT that it's enabled. you can double check by looking at /sys/bus/acpi/devices/10EC5640/status and likewise for 10TI3100. only the latter should give a status of 15 (enabled and operational).
Comment 10 Pierre Bossart 2016-10-15 13:25:35 UTC
I added a branch at https://github.com/plbossart/sound/commits/topic/lenovo-100s to add a machine driver for BYT+AIC3100. The code is based on the existing rt5640 machine driver, with some changes to remove unnecessary quirks. 

Disclaimer: this is provided as is in the hope that it is useful. the branch is compiled-tested only, I don't have hardware to test and will only be able to support bug fixing if the error reports are detailed/self-explanatory.
Comment 11 dan.g.tob 2016-10-17 03:14:11 UTC
Created attachment 241841 [details]
lsmod after blacklist/whitelist edits

I applied the top 3 commits against 4.9-rc1;
    ASoC: tlv320aix31xx: Add support for 19.2MHz mclk 
    ASoC: Intel: add machine driver for BYT/CHT w/ AIC31xx 
    ASoC: Intel: Atom: add support for BYT-AIC3100 machine driver 

I did have this build warning;
    sound/soc/intel/boards/bytcr_aic3100.c:241:12: warning: ‘byt_aic3100_quirk_cb’ defined but not used [-Wunused-function]
    static int byt_aic3100_quirk_cb(const struct dmi_system_id *id)
               ^

I could not get 'snd_soc_sst_bytcr_aic3100' to load without adding it to the modules-load.d whitelist, and snd_soc_sst_bytcr_rt5640 was still loading by default and printing same messages as before. I added snd_soc_sst_bytcr_rt5640,
snd_soc_rt5640, snd_soc_rt5645 to modprobe.d blacklist.

snd_soc_sst_bytcr_aic3100 was not printing any messages on load. (acpi match not working?). 

snd_soc_tlv320aic31xx was loaded automatically without whitelist.
Comment 12 Pierre Bossart 2016-10-17 03:34:28 UTC
thanks for testing.
I can't figure out why the wrong machine driver gets loaded, doesn't make sense unless there is a bug in the ACPI checks.
Can you comment out all the references to 10EC564X in the tables found in sound/soc/intel/atom/sst/sst_acpi.c and add log messages on what machine was found. You may also want to add traces in intel/common/sst-match-acpi.c to help debug this further.
Comment 13 dan.g.tob 2016-10-17 05:47:22 UTC
Device (LPEA)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "80860F28" /* Intel SST Audio DSP */)  // _HID: Hardware ID
            Name (_CID, "80860F28" /* Intel SST Audio DSP */)  // _CID: Compatible ID
            Name (_DDN, "Intel(R) Low Power Audio Controller - 80860F28")  // _DDN: DOS Device Name
            Name (_SUB, "80867270")  // _SUB: Subsystem ID
            Name (_UID, One)  // _UID: Unique ID
            Name (ADEP, Package (0x01)
            {
 >               ^I2C2.TTLV
            })
            Name (_DEP, Package (0x01)  // _DEP: Dependencies
            {
 >               ^I2C2.RTEK
            })

-------

Device (TTLV) {
    Name (_HID, "10TI3100")  // _HID: Hardware ID
    Name (_DDN, "TI TLV320AIC3100 Codec Controller ")  // _DDN: DOS Device Name
}

-------

Device (RTEK) {
    Name (_HID, "10EC5640" /* Realtek I2S Audio Codec */)  // _HID: Hardware ID
    Name (_DDN, "RTEK Codec Controller ")  // _DDN: DOS Device Name
}

It seems that both codecs are referenced in DSDT, is 'ADEP instead of _DEP' disabling aic3100 and using rt5640 instead?
Comment 14 Pierre Bossart 2016-10-17 06:01:16 UTC
it's fairly common to have multiple codecs in the same DSDT, but only one of them is active (evaluated at run-time). This can be checked by looking at the return value of the _STA method, shown in 
/sys/bus/acpi/devices/<HID>/status.
Can you provide the output of this value for HID=10TI3100 and 10EC5640?
Comment 15 dan.g.tob 2016-10-18 02:35:26 UTC
Created attachment 241891 [details]
dmesg from 4.8

I see '15' for 10EC5640 and '0' for 10TI3100.

As a sidenote; with 4.8, pressing f6 in alsamixer does show bytcr-rt5640 (not selected by default) but lots of dmesg warnings.
with 4.9, I see default only.
Comment 16 Pierre Bossart 2016-10-18 03:13:35 UTC
Wow. That means that you either don't have a TI codec or that the BIOS is broken.
If you still have a windows partition can you check which codec driver is loaded?
If you didn't keep windows I really don't see how we can debug this further.

can you share the dmesg output from v4.9-rc1 or later?
Comment 17 dan.g.tob 2016-10-18 04:57:40 UTC
(In reply to Pierre Bossart from comment #16)
> Wow. That means that you either don't have a TI codec or that the BIOS is
> broken.
I have been told bios is broken before, so this would not surprise me.
https://bugzilla.kernel.org/show_bug.cgi?id=113141
https://bugzilla.kernel.org/show_bug.cgi?id=113191

> If you still have a windows partition can you check which codec driver is
> loaded?
> If you didn't keep windows I really don't see how we can debug this further.
Unfortunately I didn't keep windows, I think there's a key still stored in BIOS so I may still be able to reinstall if I have too.

I've just noticed a new bios update for the machine released last week (after a year of no updates), doesn't mention anything related though and might require windows to install :/
Comment 18 dan.g.tob 2016-10-18 04:58:09 UTC
Created attachment 241911 [details]
dmesg from 4.9rc1
Comment 19 Pierre Bossart 2016-10-18 05:29:48 UTC
I meant dmesg from the branch with the MCLK patches at https://github.com/plbossart/sound/commits/topic/lenovo-100s
Comment 20 dan.g.tob 2016-10-23 20:03:22 UTC
Created attachment 242381 [details]
dmesg from 4.9rc1

4.9rc1 + the below (is that all that was needed, or do I need to clone the whole branch?)
  ASoC: Intel: bytcr_rt5640: fallback mechanism if MCLK is not enabled 
  ASoC: Intel: bytcr_rt5640: quirks for Insyde devices
  clk: x86: Add Atom PMC platform clocks 
  ASoC: tlv320aix31xx: Add support for 19.2MHz mclk 
  ASoC: Intel: add machine driver for BYT/CHT w/ AIC31xx 
  ASoC: Intel: Atom: add support for BYT-AIC3100 machine driver

Intel graphics are currently broken with 4.9 (screen flickers and blanks randomly), as well as the machine occasionally failing to boot. (same with vanilla, not related just makes testing a pain)

I've also managed to update firmware using winpe, there appears to be no changes to DSDT so it was probably a waste of time.
Comment 21 Pierre Bossart 2016-10-24 11:59:21 UTC
looks to me like the initial probe is working but the DSP mixers are not set. Try to take the UCM files from my github, replacing bytcr_rt5640/HiFi with the one i will share in the attachments.
Comment 22 Pierre Bossart 2016-10-24 12:01:00 UTC
Created attachment 242481 [details]
UCM file

need to get the .conf file from github
Comment 23 dan.g.tob 2016-10-24 13:54:30 UTC
$ ls -l /usr/share/alsa/ucm/bytcr-rt5640/
-rw-r--r-- 1 root root 34658 Oct 25 00:10 bytcr-rt5640.conf
-rw-r--r-- 1 root root 12082 Oct 25 00:38 HiFi

same dmesg as before

[    5.633332] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok
[    5.634195] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
[    5.634251] compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping ok
[    9.677884]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
Comment 24 Pierre Bossart 2016-10-24 15:33:17 UTC
can you share the log of 'pulseaudio --vvv', it looks like the UCM config is not applied.
Comment 25 dan.g.tob 2016-10-25 21:35:30 UTC
Created attachment 242761 [details]
dmesg from 4.9 rc1

Sorry this was my fault, I accidentally saved the github config as html. Now I can see monospeaker, speaker, headphones byctr5640 etc pavucontrol. Still no audio output however.
Comment 26 Pierre Bossart 2016-10-25 22:33:28 UTC
ok, looks like we are very close. 

Your DSDT shows 
Name (CHAN, Package (0x02)
                {
                    One, 
                    0x017D7840
                })

which is an indication of this AIF1 connection. The first field set to 1 means AIF1, if set to 2 AIF2 is used according to Windows folks

What I would recommend is to try the SSP0_AIF1 quirk in sound/soc/intel/boards/bytcr_rt5640.c:

         /* TODO: use CHAN package info from BIOS to detect AIF1/AIF2
 */
         if (res_info->acpi_ipc_irq_index == 0) {
            byt_rt5640_quirk |= BYT_RT5640_SSP0_AIF2; ___>>> replace by SSP0_AIF1
         }
Comment 27 dan.g.tob 2016-10-26 23:43:29 UTC
After changing to BYT_RT5640_SSP0_AIF1 I can confirm that I can hear audio!

Audio only appears to be working through the headphone jack however; I believe I might have fried the internal speakers messing around with audio settings sometime in the past. I pulled the machine apart and sure enough, both speakers show open circuit. I've ordered a replacement set, but expect 2-3 weeks.

HDMI also doesn't play audio, I guess something else is required for this.
Comment 28 Pierre Bossart 2016-10-27 00:46:30 UTC
good to hear. I am trying to figure out the HDMI part, somehow it only works with sticks or headless devices.
Comment 29 dan.g.tob 2016-11-11 10:36:44 UTC
Created attachment 244201 [details]
100s AIF1 quirk

Hi just an update on this;

Replacement speakers arrived and are working with the AIF1 quirk. One problem left is automatic output switching ie. plugging in headphones continues to play through the internal speakers. I have to go into gnome audio panel and select headphones.

I am currently using 4.9rc4 with the following patches
    ASoC: Intel: bytcr_rt5640: fallback mechanism if MCLK is not enabled
    clk: x86: Add Atom PMC platform clocks 
    ASoC: tlv320aix31xx: Add support for 19.2MHz mclk

Plus one local which ill attach. I haven't had a chance to try your AIF1/2 detection patches as yet, but they should make this obsolete
Comment 30 Pierre Bossart 2016-11-11 15:38:39 UTC
I have a set of old patches to enable jack detection but that adds even more quirks.. For now the workaround is as you said to select manually the output - which you have to do anyway depending on whether you have a mono or stereo speaker.
Comment 31 youling257 2016-11-20 06:14:46 UTC
(In reply to dan.g.tob from comment #20)
> Created attachment 242381 [details]
> dmesg from 4.9rc1
> 
> 4.9rc1 + the below (is that all that was needed, or do I need to clone the
> whole branch?)
>   ASoC: Intel: bytcr_rt5640: fallback mechanism if MCLK is not enabled 
>   ASoC: Intel: bytcr_rt5640: quirks for Insyde devices
>   clk: x86: Add Atom PMC platform clocks 
>   ASoC: tlv320aix31xx: Add support for 19.2MHz mclk 
>   ASoC: Intel: add machine driver for BYT/CHT w/ AIC31xx 
>   ASoC: Intel: Atom: add support for BYT-AIC3100 machine driver
> 
> Intel graphics are currently broken with 4.9 (screen flickers and blanks
> randomly), as well as the machine occasionally failing to boot. (same with
> vanilla, not related just makes testing a pain)
> 
> I've also managed to update firmware using winpe, there appears to be no
> changes to DSDT so it was probably a waste of time.

ASoC: Intel: bytcr_rt5640: quirks for Insyde devices ,Signed-off-by: youling257 <youling257@gmail.com> ,by me.

it isn't correct,should be in3_map .
Comment 32 dan.g.tob 2017-01-13 09:09:59 UTC
Created attachment 251451 [details]
dmesg from 4.10-rc3

This is still not quite working out of the box with 4.10-rc3, I can see the AIF1 auto-detection is working however.

[    5.132129] bytcr_rt5640 bytcr_rt5640: BIOS Routing: AIF1 connected
[    5.132135] bytcr_rt5640 bytcr_rt5640: quirk IN1_MAP enabled
[    5.132137] bytcr_rt5640 bytcr_rt5640: quirk DIFF_MIC enabled
[    5.132139] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF1 enabled
[    5.132141] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
[    5.132148] bytcr_rt5640 bytcr_rt5640: Failed to get MCLK from pmc_plt_clk_3: -2
[    5.132161] bytcr_rt5640: probe of bytcr_rt5640 failed with error -2


These on top of 4.9 does work however;
ASoC: Intel: bytcr_rt5640: fallback mechanism if MCLK is not enabled 
clk: x86: Add Atom PMC platform clocks 
ASoC: tlv320aix31xx: Add support for 19.2MHz mclk 

Plus these quirks
BYT_RT5640_DMIC1_MAP
BYT_RT5640_DMIC_EN
BYT_RT5640_MCLK_EN
BYT_RT5640_SSP0_AIF1
Comment 33 Pierre Bossart 2017-01-13 15:14:47 UTC
yes, known issue. the MCLK management patches are not upstream yet (still working on minor changes with clk and x86 maintainers) so you will have to use the ones on my branch for now.
Comment 34 Guido Serra 2017-01-22 12:39:46 UTC
@pierre nope... I got ur latest code from plbossart/intel/audio-latest-fixes
[after nuking the box and reinstalling a debian testing, to skip all my previous changes]

didn't work... I even got the speakers almost burning... (smelled like the circuite is fried) ...

I tried to change in the code this...

            byt_rt5640_quirk |= BYT_RT5640_SSP0_AIF2; ___>>> replace by SSP0_AIF1

still nope... and this is the pulseaudio output 
(do I really need pulseaudio in place?)

E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="platform-bytcr_rt5640" card_name="alsa_card.platform-bytcr_rt5640" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/80860F28:00/bytcr_rt5640/sound/card0 (alsa_card.platform-bytcr_rt5640) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/platform/80860F28:00/bytcr_rt5640/sound/card0 is busy: no
W: [pulseaudio] module-udev-detect.c: Tried to configure /devices/platform/80860F28:00/bytcr_rt5640/sound/card0 (alsa_card.platform-bytcr_rt5640) more often than 5 times in 10s
Comment 35 Pierre Bossart 2017-01-23 15:20:51 UTC
(In reply to Guido Serra from comment #34)
> @pierre nope... I got ur latest code from plbossart/intel/audio-latest-fixes
> [after nuking the box and reinstalling a debian testing, to skip all my
> previous changes]
> 
> didn't work... I even got the speakers almost burning... (smelled like the
> circuite is fried) ...
> 
> I tried to change in the code this...
> 
>             byt_rt5640_quirk |= BYT_RT5640_SSP0_AIF2; ___>>> replace by
> SSP0_AIF1

I don't know what platform you are talking about. The code seems fine and reported as working by previous users so I am wondering what led to this situation. Can you share details of your issue, details of your hardware (latest alas-info.sh please) and better try the experimental/codecs branch which contains more recent fixes related to I2S.

> 
> still nope... and this is the pulseaudio output 
> (do I really need pulseaudio in place?)
> 
> E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
> E: [pulseaudio] module.c: Failed to load module "module-alsa-card"
> (argument: "device_id="0" name="platform-bytcr_rt5640"
> card_name="alsa_card.platform-bytcr_rt5640" namereg_fail=false tsched=yes
> fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes
> card_properties="module-udev-detect.discovered=1""): initialization failed.
> I: [pulseaudio] module-udev-detect.c: Card
> /devices/platform/80860F28:00/bytcr_rt5640/sound/card0
> (alsa_card.platform-bytcr_rt5640) failed to load module.
> D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
> D: [pulseaudio] module-udev-detect.c:
> /devices/platform/80860F28:00/bytcr_rt5640/sound/card0 is busy: no
> W: [pulseaudio] module-udev-detect.c: Tried to configure
> /devices/platform/80860F28:00/bytcr_rt5640/sound/card0
> (alsa_card.platform-bytcr_rt5640) more often than 5 times in 10s
Comment 36 dan.g.tob 2017-03-06 00:19:47 UTC
Audio is working out of the box as of 4.11-rc1.

Is there a tracker bug for jack detection and/or hdmi audio somewhere. what is the status of those?
Comment 37 Vikram Surya 2017-03-07 16:57:17 UTC
I updated to kernel 4.11-rc1 64-bit using this --
http://sourcedigit.com/22066-update-to-linux-kernel-4-11-rc1-on-ubuntu/

Still getting no audio playback.

What can I post here to get your help or do to help myself?
Comment 38 Pierre Bossart 2017-03-07 17:15:52 UTC
(In reply to Vikram Surya from comment #37)
> I updated to kernel 4.11-rc1 64-bit using this --
> http://sourcedigit.com/22066-update-to-linux-kernel-4-11-rc1-on-ubuntu/
> 
> Still getting no audio playback.
> 
> What can I post here to get your help or do to help myself?

usual stuff when there's no audio: alsa-info.sh, dmidecode, dmesg, pulseaudio log.
Comment 40 Vikram Surya 2017-03-07 21:25:29 UTC
Created attachment 255123 [details]
vikramsurya's dmesg, dmidecode and pulselog files
Comment 41 Pierre Bossart 2017-03-07 23:35:41 UTC
(In reply to Vikram Surya from comment #39)

Dude, it's not a kernel issue, you didn't configure the mixers. use the UCM files from https://github.com/plbossart/UCM/tree/master/bytcr-rt5640
Comment 42 dan.g.tob 2017-03-20 07:31:20 UTC
Just an FYI, HDMI audio is also working with SND_X86 & HDMI_LPE_AUDIO