Bug 95681 - No sound on Asus EeeBook X205TA
Summary: No sound on Asus EeeBook X205TA
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: Intel Linux
: P1 blocking
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-26 18:50 UTC by Lubomir Kucera
Modified: 2023-11-12 06:57 UTC (History)
50 users (show)

See Also:
Kernel Version: 4.1.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
DSDT.dsl (663.13 KB, text/x-dsl)
2015-03-26 18:50 UTC, Lubomir Kucera
Details
Output of "lspci -vv" (2.62 KB, text/x-log)
2015-06-10 01:23 UTC, Hugues
Details
Output of "dmesg" (45.13 KB, text/x-log)
2015-06-10 01:24 UTC, Hugues
Details
Output of dmidecode (6.52 KB, application/octet-stream)
2016-04-25 06:12 UTC, Reihar
Details
dmidecode.txt (6.52 KB, text/plain)
2016-04-25 14:44 UTC, KBT
Details
Output of "dmidecode" (6.52 KB, text/plain)
2016-04-25 14:57 UTC, Hugues
Details
dmidecode output for x205ta (6.52 KB, application/octet-stream)
2016-04-30 13:00 UTC, Pieter Lenaerts
Details
X205TA.208_dmidecode (6.52 KB, text/plain)
2016-05-03 05:06 UTC, Spud
Details
x205ta dmidecode output (6.52 KB, application/octet-stream)
2016-05-04 08:09 UTC, Massimo Branchini
Details
mixer settings for speaker playback (10.18 KB, application/x-shellscript)
2016-12-02 19:47 UTC, Pierre Bossart
Details
mixer setting for rt5645 codec driver (7.77 KB, text/plain)
2016-12-13 01:46 UTC, Bard Liao
Details
dmesg.txt (35.00 KB, text/plain)
2016-12-20 16:46 UTC, KBT
Details
dmesg.txt (48.18 KB, text/plain)
2016-12-20 18:11 UTC, KBT
Details
pulseaudio.txt (86.05 KB, text/plain)
2016-12-20 18:11 UTC, KBT
Details
dmesg with distorted sound (44.34 KB, text/plain)
2016-12-29 18:40 UTC, Marco Bo
Details
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers (4.01 KB, text/plain)
2016-12-30 08:04 UTC, Marco Bo
Details
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00-nocache/registers (2.57 KB, text/plain)
2016-12-30 08:04 UTC, Marco Bo
Details
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers (3.96 KB, application/octet-stream)
2016-12-30 17:27 UTC, harryharryharry
Details
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers during playback (2.51 KB, application/octet-stream)
2016-12-30 17:28 UTC, harryharryharry
Details
codec register dumps when playing sound (3.96 KB, application/octet-stream)
2017-01-03 07:36 UTC, harryharryharry
Details
codec register-nocache dumps when playing sound (2.51 KB, application/octet-stream)
2017-01-03 07:36 UTC, harryharryharry
Details
register dump after: set clk_src parameter as RT5645_CLK_SEL_I2S2_ASRC (3.96 KB, application/octet-stream)
2017-01-03 19:47 UTC, harryharryharry
Details
register-nocache dump after: set clk_src parameter as RT5645_CLK_SEL_I2S2_ASRC (2.51 KB, application/octet-stream)
2017-01-03 19:48 UTC, harryharryharry
Details
dmesg before jack insertion (58.42 KB, application/octet-stream)
2017-01-07 02:34 UTC, harryharryharry
Details
registers before jack insertion (3.96 KB, application/octet-stream)
2017-01-07 02:35 UTC, harryharryharry
Details
registers-nocache before jack insertion (2.51 KB, application/octet-stream)
2017-01-07 02:35 UTC, harryharryharry
Details
dmesg after jack insertion (58.42 KB, application/octet-stream)
2017-01-07 02:36 UTC, harryharryharry
Details
registers after jack insertion (3.96 KB, application/octet-stream)
2017-01-07 02:36 UTC, harryharryharry
Details
registers-nocache after jack insertion (2.51 KB, application/octet-stream)
2017-01-07 02:36 UTC, harryharryharry
Details
attachment-26913-0.html (1.45 KB, text/html)
2017-01-09 07:12 UTC, calimero
Details
DSDT - Radius9 - 4.10rc3+ Intel kernel (413.97 KB, application/octet-stream)
2017-02-02 05:01 UTC, Tom Ketola
Details
cat /sys/bus/acpi/devices/10EC*/status (3 bytes, text/plain)
2017-02-02 05:02 UTC, Tom Ketola
Details
dmesg from failed audio - Radius9 - 4.10rc3+ (89.74 KB, text/plain)
2017-02-02 05:04 UTC, Tom Ketola
Details
Pulseaudio log from 4.10rc3+ (2.12 KB, text/plain)
2017-02-02 05:04 UTC, Tom Ketola
Details
attachment-2435-0.html (3.06 KB, text/html)
2018-01-09 00:48 UTC, Bard Liao
Details

Description Lubomir Kucera 2015-03-26 18:50:31 UTC
Created attachment 172471 [details]
DSDT.dsl

Sound card on Asus EeeBook X205TA is not being detected. The laptop uses Intel Atom Z3735F (Baytrail) with rt5648 sound card. This rt5648 has the same device id as rt5645 for Intel Cherrytrail & Braswell (0x6308).
Comment 1 Bjorn Helgaas 2015-06-09 19:00:18 UTC
Please attach a complete dmesg log and "lspci -vv" output.  Did this ever work?  If so, what kernel worked and what kernel is broken?
Comment 2 Hugues 2015-06-10 01:23:23 UTC
Created attachment 179361 [details]
Output of "lspci -vv"
Comment 3 Hugues 2015-06-10 01:24:08 UTC
Created attachment 179371 [details]
Output of "dmesg"
Comment 4 Hugues 2015-06-10 01:28:56 UTC
(In reply to Bjorn Helgaas from comment #1)
> Please attach a complete dmesg log and "lspci -vv" output.  Did this ever
> work?  If so, what kernel worked and what kernel is broken?

On my system it never worked -- running Debian 8 on Linux Kernel 4.0.4 (tried several kernels since 3.16). Apparently there is no driver (yet) for this Realtek rt5648 card (c.f. http://comments.gmane.org/gmane.linux.alsa.devel/138822).
Comment 5 Lubomir Kucera 2015-06-10 09:23:10 UTC
Thank you Hugues for sending the logs.

There was no driver even in linux 4.1rc5, but according to link Hugues posted, there might be something in linux-next.
Comment 6 Bjorn Helgaas 2015-06-12 22:16:29 UTC
Thanks.  I wanted to make sure the lack of sound was not due to a PCI core issue.  I don't see anything like that here, so I guess you'll just have to wait for someone to write a driver.
Comment 7 Ned 2015-06-22 08:19:20 UTC
I have the same problem on the same hardware.

On the Internet I found hints that different sound chips were built into the X205TA at different times by Asus.  So, some people may have a different chip.

The sound chip (and possibly other devices) are connected via the new Baytrail SDIO.  Is there an equivalent to lsusb or lspci for the sdio bus?
Comment 8 Spud 2015-10-08 22:43:55 UTC
I really need a kernel sound module(s) for the bottom firing speakers and mic/headphone ports to work. This lappy is "reported" to be only good for light work. Not with lean and mean Debian/Mate installed its not! Quite good. GPU direct too. No sound is the only show stopper.

The system uses SDIO for sound and Bluetooth; even though its less max throughput than SATA or USB, to save POWER. This thing has the killer batt life! As we know: ASUS should provide an open driver (yeah); but has worked with MS to make a Chromebook killer. Any correlation?? This could be a huge win for Linux users. 

Tip: Please don't let this tip slow the dev of a ASUS X205 sound driver; but if you're stuck without sound then you can use a USB sound device (such as USB headphones) for the time being.

It's the PERFECT Linux demo/notebook; if only for the sound. I didn't return it; because ya'll are awesome. ;) KEEPING the faith.
Comment 9 Alejandro Soto 2015-12-28 21:00:48 UTC
Is something new known? Several months have already passed away, and most problems with the X205TA have already been solved, including suspend/resume, the costant freezes, the touchpad, the battery status, and who-knows-what-else. Thus, it's damn irritating to notice how sound appears to be the only area where no progress is being made. If we create a driver/workaround, then the X205TA will finally fulfill its sole divine purpose as the PerfectLinuxNotebook(TM) ;).
Comment 10 Srikant Patnaik 2016-01-02 06:11:20 UTC
It seems there are plenty of variants with Intel Z3735F, and all of them share the same legacy. I found HDMI audio patch (https://github.com/01org/baytrailaudio/blob/master/hdmi_audio_20150319.patch), which according to this post(https://plus.google.com/u/0/+IanMORRISON/posts/WRka6ZNqL3C) is WORKING. It might be a good starting point. 
My apologies if it's already been discussed and discarded.
Comment 11 Jimmy 2016-01-03 10:31:04 UTC
Negative ghost rider, the patch in comment 10 doesn't work. Also sound for the x205ta doesn't work in kernel 4.4.0-040400rc7.
Comment 12 Alejandro Soto 2016-01-08 03:15:49 UTC
Hi, everybody! For anyone interested, pages 43 onwards of http://www.ubuntuforums.org/showthread.php?t=2254322 provide some important links, most notably a rt5648.c file, which may contain (the base for) what we need to get the RT5648 working on the X205TA. Kernel hackers are further encouraged to look at the code ;).
Comment 13 Daniel Young 2016-02-16 12:32:54 UTC
I am still having issues with laptop freezing using Debian 8.2. I have tried #echo 333 > /sys/kernel/debug/dri/0/i915_max_freq command but does not seem to help. Any suggestions?
Comment 14 Daniel Young 2016-02-16 12:33:26 UTC
I am still having issues with laptop freezing using Debian 8.2. I have tried #echo 333 > /sys/kernel/debug/dri/0/i915_max_freq command but does not seem to help. Any suggestions?
Comment 15 harryharryharry 2016-02-16 13:32:24 UTC
My suggestion is that you don't pollute this bugtracker with issues that have nothing to do with the bug... head over to ubuntuforums if you want help
Comment 16 KBT 2016-02-22 21:59:20 UTC
this bug is still present in kernel version 4.5.0-rc5

is there any way one can help to resolve this timely?
Comment 17 Spud 2016-04-03 18:14:37 UTC
Since it's been over a year with no working sound driver then what needs to happen next? Are any official devs attempting this? Has this somehow become political? Like the win-modems of old; isn't this like a win-sound-card we need to reverse engineer? I know it's best NOT to buy this hardware; but others will. They're out there. I know it's a wrong, closed device; but that still makes Linux look incapable. The thing is complete (almost perfect); but for this one required major driver. Are we OK with the only option being Windows sound? Can we somehow use the win driver (NDIS?); to get around any road blocks? Is there a way for all X205 users to report their exact sound chip model; if that's even an issue?
Comment 18 Joel Holdsworth 2016-04-25 02:18:29 UTC
I've been working on fixing this issue 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 19 Reihar 2016-04-25 06:12:25 UTC
Created attachment 213931 [details]
Output of dmidecode
Comment 20 Reihar 2016-04-25 06:13:49 UTC
(In reply to Joel Holdsworth from comment #18)
> I've been working on fixing this issue 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?

I've attached the output to the bug.
Comment 21 KBT 2016-04-25 14:44:51 UTC
Created attachment 214041 [details]
dmidecode.txt

Attached the results from dmidecode.

[2016-04-25 04:18] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #18 from Joel Holdsworth <joel@airwebreathe.org.uk> ---
>I've been working on fixing this issue 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?
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 22 Hugues 2016-04-25 14:57:06 UTC
Created attachment 214051 [details]
Output of "dmidecode"

Here is another one. Thanks ;)
Comment 23 Pieter Lenaerts 2016-04-30 13:00:34 UTC
Created attachment 214771 [details]
dmidecode output for x205ta
Comment 24 Spud 2016-05-03 05:06:24 UTC
Created attachment 215041 [details]
X205TA.208_dmidecode

Here's mine.
Comment 25 Massimo Branchini 2016-05-04 08:09:38 UTC
Created attachment 215261 [details]
x205ta dmidecode output
Comment 26 calimero 2016-08-19 09:45:47 UTC
Hi.

What command is required on debian to output dmicode in a text file ?
(debian server and i3 installed...)
Comment 27 Spud 2016-09-18 04:43:41 UTC
No sound. Help please. What can I do?
Comment 28 calimero 2016-09-18 21:14:20 UTC
(In reply to Spud from comment #27)
> No sound. Help please. What can I do?

http://www.ebay.com/itm/USB-2-0-External-7-1-Channel-3D-Virtual-Audio-Sound-Card-Mic-Adapter-PC-Laptop-/400883770992

Buy this, works great, and wait for linux congress to vote budget one day for soundcard driver.
Comment 29 Skullnet 2016-11-07 10:18:10 UTC
Is there any progress with this sound driver?
Comment 30 Zanna 2016-11-07 10:43:53 UTC
(In reply to calimero from comment #26)
> Hi.
> 
> What command is required on debian to output dmicode in a text file ?
> (debian server and i3 installed...)

Assuming sudo dmidecode works, just redirect the output to the file you want to write to, for example:

    sudo dmidecode > dmifile
Comment 31 calimero 2016-11-08 06:22:27 UTC
(In reply to Zanna from comment #30)
> (In reply to calimero from comment #26)
> > Hi.
> > 
> > What command is required on debian to output dmicode in a text file ?
> > (debian server and i3 installed...)
> 
> Assuming sudo dmidecode works, just redirect the output to the file you want
> to write to, for example:
> 
>     sudo dmidecode > dmifile

Thank you very much.

So I've tried to read how to make an attachment and as usual the related doc is a giant pile of mental masturbation that doesn't deliver the useful way to do it even after the fifth line beyond which 99% of people stop to read.

As you can see here :
https://www.bugzilla.org/docs/3.0/html/attachments.html

And here:
https://www.bugzilla.org/docs/3.4/en/html/api/Bugzilla/Attachment.html

It's unpredictable garbage for random academia.


So here is my dmicode (and yes it's fncking ugly, because oddly, there's no attachment button, ah !):


# dmidecode 2.12
# SMBIOS entry point at 0x7c984110
SMBIOS 2.7 present.
16 structures occupying 1025 bytes.
Table at 0x7C312010.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: American Megatrends Inc.
	Version: X205TAW.201
	Release Date: 09/18/2015
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 1024 kB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		EDD is supported
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		Print screen service is supported (int 5h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		ACPI is supported
		USB legacy is supported
		Smart battery is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 5.6

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: X205TAW
	Version: 1.0       
	Serial Number: FBNLCX080237462     
	UUID: 00010961-0A1C-3333-FFFF-EC0000000000
	Wake-up Type: Power Switch
	SKU Number: ASUS-NotebookSKU
	Family: X

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: X205TAW
	Version: 1.0       
	Serial Number: BSN12345678901234567
	Asset Tag: ATN12345678901234567
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: MIDDLE              
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0

Handle 0x0003, DMI type 3, 22 bytes
Chassis Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Type: Notebook
	Lock: Not Present
	Version: 1.0       
	Serial Number: FBNLCX080237462     
	Asset Tag: ATN12345678901234567
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Safe
	Security Status: None
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: 1
	Contained Elements: 0
	SKU Number: To be filled by O.E.M.

Handle 0x0008, DMI type 10, 10 bytes
On Board Device 1 Information
	Type: Video
	Status: Enabled
	Description:  VGA
On Board Device 2 Information
	Type: Ethernet
	Status: Enabled
	Description:  GLAN
On Board Device 3 Information
	Type: Ethernet
	Status: Enabled
	Description:  WLAN

Handle 0x0009, DMI type 11, 5 bytes
OEM Strings
	String 1:              
	String 2:              
	String 3:              
	String 4: 90NL0732-M06980
	String 5:  
	String 6:  
	String 7:  
	String 8:  
	String 9:  
	String 10:  

Handle 0x000A, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: Multi-bit ECC
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 1

Handle 0x000B, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Array Handle: 0x000A
	Partition Width: 2

Handle 0x000C, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x000A
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2048 MB
	Form Factor: DIMM
	Set: None
	Locator: A1_DIMM0
	Bank Locator: A1_BANK0
	Type: DDR3
	Type Detail: Unknown
	Speed: 1333 MHz
	Manufacturer: A1_Manufacturer0
	Serial Number: A1_SerNum0
	Asset Tag: A1_AssetTagNum0
	Part Number: Array1_PartNumber0
	Rank: Unknown
	Configured Clock Speed: 1333 MHz

Handle 0x000D, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x000C
	Memory Array Mapped Address Handle: 0x000B
	Partition Row Position: <OUT OF SPEC>
	Interleave Position: Unknown
	Interleaved Data Depth: Unknown

Handle 0x000E, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x000F, DMI type 7, 19 bytes
Cache Information
	Socket Designation: CPU Internal L1
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 224 kB
	Maximum Size: 224 kB
	Supported SRAM Types:
		Unknown
	Installed SRAM Type: Unknown
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Other
	Associativity: Other

Handle 0x0010, DMI type 7, 19 bytes
Cache Information
	Socket Designation: CPU Internal L2
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 1024 kB
	Maximum Size: 1024 kB
	Supported SRAM Types:
		Unknown
	Installed SRAM Type: Unknown
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Unified
	Associativity: 16-way Set-associative

Handle 0x0011, DMI type 4, 42 bytes
Processor Information
	Socket Designation: SOCKET 0
	Type: Central Processor
	Family: Core i5
	Manufacturer: Intel
	ID: 78 06 03 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 55, Stepping 8
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz
	Voltage: 1.2 V
	External Clock: 83 MHz
	Max Speed: 2400 MHz
	Current Speed: 1330 MHz
	Status: Populated, Enabled
	Upgrade: Socket BGA1155
	L1 Cache Handle: 0x000F
	L2 Cache Handle: 0x0010
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Fill By OEM
	Part Number: Fill By OEM
	Core Count: 4
	Core Enabled: 4
	Thread Count: 4
	Characteristics:
		64-bit capable

Handle 0x0012, DMI type 131, 64 bytes
OEM-specific Type
	Header and Data:
		83 40 12 00 00 00 00 00 00 00 00 00 00 00 00 00
		00 00 00 00 00 00 00 00 01 00 00 00 02 00 01 00
		81 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00
		00 00 00 00 50 00 00 00 76 50 72 6F 00 00 00 00

Handle 0x0013, DMI type 127, 4 bytes
End Of Table
Comment 32 Spud 2016-11-19 21:42:25 UTC
OK I said way up above that a USB sound adapter can help; but that does nothing to use the built-in speakers. They sound pretty decent running Windows. Dead with Linux.

Need I say I know this proprietary hardware was crap by Microsoft and hardware makers to keep people sucking at their teat? That is not OK.

Need I say this machine was made to fight Chromebooks with full Windows instead. Else it would not have been done. It was not entirely successful with Windows and due still to much bloat. However this thing is the bee knees with Linux. I also use Mate/Debian (your option) on it and that makes the best of all worlds. It's light. Battery life is the tops. The quad core processor plays HD video and up to passable direct GUI. The direct GPU works automatically with Linux. The screen is a Goldy-locks resolution for max compatibility and good 11" size for carry. No touch screen to foul things up. Decent brightness. The cost was lower. Much more and all this you just can't get COMBINED in any other package. The true portable computer.

Now I think we can stop posting dmifile specs. I don't think that person is working on a solution.

My question is how do I get started writing a kernel model for this? Where do I go? Who do I need to coordinate with? What can you tell me to help me get the problem solved? Has anyone tried and failed? What is the road block?

I have never suggest anyone has to help; nor failed to understand the BS in the hardware industry. I prefer open hardware. Yet last time I check the Linux community did not stand for being locked out of anything. I understand I'm going to have to reverse engineer this thing. Plus, I see where they purposely made it difficult. That never stopped us before. Why should it now?
Comment 33 Skullnet 2016-11-19 22:06:49 UTC
>Has anyone tried and failed? What is the road block?

It doesn't work.
https://github.com/Monsterovich/rt5648/
Comment 34 KBT 2016-11-19 22:19:09 UTC
I friend of a friend said he got audio working on an X205TA that he bought last week.

He said he got it working out of the box using Manjaro Linux.

Take this information with a grain of salt though, i asked for dmesg, kernel config and a picture of the underside of the laptop and haven't got it yet.

yours
Comment 35 KBT 2016-11-19 22:20:59 UTC
I friend of a friend said he got audio working on an X205TA that he bought last week.

He said he got it working out of the box using Manjaro Linux.

Take this with a grain of salt, i asked for dmesg, kernel config and a picture of the underside of the laptop and haven't got it yet.

yours

[2016-11-19 22:42] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #32 from Spud <pkk777@netzero.com> ---
>OK I said way up above that a USB sound adapter can help; but that does
>nothing
>to use the built-in speakers. They sound pretty decent running Windows. Dead
>with Linux.
>
>Need I say I know this proprietary hardware was crap by Microsoft and hardware
>makers to keep people sucking at their teat? That is not OK.
>
>Need I say this machine was made to fight Chromebooks with full Windows
>instead. Else it would not have been done. It was not entirely successful with
>Windows and due still to much bloat. However this thing is the bee knees with
>Linux. I also use Mate/Debian (your option) on it and that makes the best of
>all worlds. It's light. Battery life is the tops. The quad core processor
>plays
>HD video and up to passable direct GUI. The direct GPU works automatically
>with
>Linux. The screen is a Goldy-locks resolution for max compatibility and good
>11" size for carry. No touch screen to foul things up. Decent brightness. The
>cost was lower. Much more and all this you just can't get COMBINED in any
>other
>package. The true portable computer.
>
>Now I think we can stop posting dmifile specs. I don't think that person is
>working on a solution.
>
>My question is how do I get started writing a kernel model for this? Where do
>I
>go? Who do I need to coordinate with? What can you tell me to help me get the
>problem solved? Has anyone tried and failed? What is the road block?
>
>I have never suggest anyone has to help; nor failed to understand the BS in
>the
>hardware industry. I prefer open hardware. Yet last time I check the Linux
>community did not stand for being locked out of anything. I understand I'm
>going to have to reverse engineer this thing. Plus, I see where they purposely
>made it difficult. That never stopped us before. Why should it now?
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 36 Alejandro Soto 2016-11-19 22:24:46 UTC
(In reply to Skullnet from comment #33)
> >Has anyone tried and failed? What is the road block?
> 
> It doesn't work.
> https://github.com/Monsterovich/rt5648/

Actually, I wrote that code (Monsterovich's repo is actually a fork of https://github.com/KemyLand/rt5648/)myLand/rt5648/), so maybe  I can give a few hints on the situation.

Firstly, I copy-pasted the mainline rt5645 driver (which does work) and attempted to hack around with it, in an attempt to get a working rt5648 driver. After a few weeks, I got the driver to detect the card, register it with the sound subsystem, and almost got it to work. Some other people helped with a few bits of the code, and everything was going well. We were excited since we were apparently in the right track to reverse engineering a sound driver, and thus getting all of the X205TA's hardware to work under Linux.

Then, we hit bottom and realized the hard truth. The card needs firmware. Proprietary firmware. Great.

This happened several months ago. No further progress has been done ever since, simply because firmware is the only missing piece. Since we can't reverse-engineer the firmware by any sane means, it's virtually impossible to get around this problem without Realtek, who hasn't provided any help despite several emails being sent to them.
Comment 37 Ron Li 2016-11-21 19:26:17 UTC
(In reply to Alejandro Soto from comment #36)
> (In reply to Skullnet from comment #33)
> > >Has anyone tried and failed? What is the road block?
> > 
> > It doesn't work.
> > https://github.com/Monsterovich/rt5648/
> 
> Actually, I wrote that code (Monsterovich's repo is actually a fork of
> https://github.com/KemyLand/rt5648/)myLand/rt5648/), so maybe  I can give a
> few hints on the situation.
> 
> Firstly, I copy-pasted the mainline rt5645 driver (which does work) and
> attempted to hack around with it, in an attempt to get a working rt5648
> driver. After a few weeks, I got the driver to detect the card, register it
> with the sound subsystem, and almost got it to work. Some other people
> helped with a few bits of the code, and everything was going well. We were
> excited since we were apparently in the right track to reverse engineering a
> sound driver, and thus getting all of the X205TA's hardware to work under
> Linux.
> 
> Then, we hit bottom and realized the hard truth. The card needs firmware.
> Proprietary firmware. Great.
> 
> This happened several months ago. No further progress has been done ever
> since, simply because firmware is the only missing piece. Since we can't
> reverse-engineer the firmware by any sane means, it's virtually impossible
> to get around this problem without Realtek, who hasn't provided any help
> despite several emails being sent to them.

Hi, I used your code, and then compiled the snd-soc-rt5648.ko file successfully. I put the ko file into /lib/modules/kernel/snd-soc-rt5648.ko and ran the "depmod -a" command. Then, while I ran "modprobe snd-soc-rt5648" to load this module, it is still no sound on my X205TA. Could you tell me how to make it work?
Comment 38 Alejandro Soto 2016-11-21 19:40:12 UTC
(In reply to Ron Li from comment #37)
> Hi, I used your code, and then compiled the snd-soc-rt5648.ko file
> successfully. I put the ko file into /lib/modules/kernel/snd-soc-rt5648.ko
> and ran the "depmod -a" command. Then, while I ran "modprobe snd-soc-rt5648"
> to load this module, it is still no sound on my X205TA. Could you tell me
> how to make it work?

As I already mentioned above, my code won't work without the proper RT5648 firmware, and we lack the firmware. There won't be any sound on any Linux-operated X205TA until we somehow get the right firmware.

I've been quite conservative regarding modifications to my X205TA since February (it has been my main computer ever since, needing it nearly everday, and didn't wanted to break something). However, my X205TA will soon not be into constant usage for about 3 months. I'll use this time frame to do testing again, and maybe get another try on the rt5648 driver. The good news is that Windows has working sound, so a Windows installation should have the firmware stored somewhere.
Comment 39 calimero 2016-11-22 13:31:11 UTC
So it's fucken hopeless unless that gaddam firmware gets released.

Alright.


http://www.realtek.com/contact/contentView.aspx?Langid=1&PNid=6&PFid=6&Level=1&Conn=1

"Dear Mr Realtek,

As you can see here:
https://bugzilla.kernel.org/show_bug.cgi?id=95681

Everybody is stuck with no sound on the Asus x205ta because the proper RT5648 firmware is missing to us all.

It's sad, really sad.
Sad, as in baby seals dying on the beach in droves during a summer party.



As I write this message, I am on my knees, begging you, you almighty realtek.
Could you please, for the love of god, consider making the proper RT5648 firmware for the Asus x205ta sound card, available to the linux community.

Thank you very much.

Regards,

Your most loyal and faithful customer."




https://vip.asus.com/VIP2/Services/QuestionForm?lang=en-us#
(product type: Eee Book)

"Dear Mr Asus

As you can see here:
https://bugzilla.kernel.org/show_bug.cgi?id=95681

Everybody is stuck with no sound on the Asus x205ta because the proper RT5648 firmware is missing to us all.

It's sad as in polar bears drowning at sea because of global warming.


I beg you, could you please help us make the proper RT5648 firmware for the Asus x205ta sound card available to the linux community.

Thank you very very much.

Regards,

Your most loyal and faithful customer."




And I've also launched a petition on change.org

https://www.change.org/p/realtek-make-the-asus-x205ta-proper-sound-card-rt5648-firmware-available-to-the-linux-community
Comment 40 Bard Liao 2016-11-22 14:40:53 UTC
Hi

I am from Realtek. I have no idea what RT5648 firmware means. RT5648 doesn't need any firmware to work. Can anyone show me the dmesg with Alejandro Soto's code? I am thinking maybe what you are talking about is Intel sst firmware which is needed for Baytrail. Unfortunately, I don't know where can we get proper Baytrail sst firmware.
Actually, rt5648 is very similar to rt5645. So, the basic audio function should work if you use rt5645 codec driver and machine driver. Basically, what you need to do is add a mapping table on baytrail_machines[] in sst-acpi.c. Where also identify the firmware name for the card.
Here is an example.
static struct sst_acpi_mach baytrail_machines[] = {
	{ "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL },
	{ "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL },
+	{ "10EC5645", "byt-rt5645", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL },
	{}
};

Note that the codec name in DSDT.dsl should be match to the acpi id table in codec driver.
So,
Name (_HID, "10EC5648")  // _HID: Hardware ID
Name (_CID, "10EC5648")  // _CID: Compatible ID
should change to
Name (_HID, "10EC5645")  // _HID: Hardware ID
Name (_CID, "10EC5645")  // _CID: Compatible ID
if you are using rt5645 driver.

Maybe Alejandro Soto already did it, but I am sorry I can't access https://github.com/KemyLand/rt5648/)myLand/rt5648/. So I don't know what he did.
Comment 41 Alejandro Soto 2016-11-22 18:15:01 UTC
(In reply to Bard Liao from comment #40)
> Maybe Alejandro Soto already did it, but I am sorry I can't access
> https://github.com/KemyLand/rt5648/)myLand/rt5648/. So I don't know what he
> did.

Hi! It's great to know someone from Realtek is helping us! Regarding the URL, it's actually https://github.com/KemyLand/rt5648/ (I made a typo in my other comment).
Comment 42 Alejandro Soto 2016-11-22 18:37:41 UTC
BTW, my tree seems to lack some files mentioned by Bard Laio, so we where definitively on the wrong track with it.
Comment 43 Alejandro Soto 2016-11-22 19:11:30 UTC
Another BTW: You should look at the "debug" branch of the repository, not "master".
Comment 44 Joshua Grisham 2016-11-22 19:56:17 UTC
Hi,

First, kudos to Bard for sticking his neck out here--the atmosphere in this bug thread is tense and I don't think that Realtek are necessary the only (or even majority) stakeholder in why this is not fully working.  :)  

There have been a few people who probably got very close to getting this to work, including myself and Michele Curti working independently as well as with Pierre, Vinod, and a few others at Intel.  My understanding is certainly not the best--I am not an expert at it!--however I did learn enough to get the basics and to maybe help with some of the confusion which has been happening in this thread.

First, audio on this device is handled by a combination of the Intel SST device (part of the SoC) and connected to the Realtek RT5648 codec. 

There is a ton of information in this Ubuntu thread:  https://ubuntuforums.org/showthread.php?t=2254322 
Some contributed by Michele and many others, plus quite a bit of testing and code debugging/testing by myself as well (I am joshg2 on Ubuntu forums).  You can see some of research and information starting around page 60 of this thread, especially in page 68 and page 80.  There is also a pretty long thread on the Alsa mailing list started by Michele which kind of kicked a lot of this off, and had a fair amount of involvement from Intel as well.

Basically, there should be a binary firmware loaded for the Intel SST audio device, these could be found here: https://git.kernel.org/cgit/linux/kernel/git/vkoul/firmware.git/tree/intel  or also in many distributions' package repos), which is selected and loaded based on the ACPI device which is found currently from code in sst_acpi like you see here: https://github.com/torvalds/linux/blob/master/sound/soc/intel/common/sst-acpi.c  (note especially starting around line 219 here: https://github.com/torvalds/linux/blob/master/sound/soc/intel/common/sst-acpi.c#L219 )

Note that sst_acpi is giving both a board driver name as well as a firmware name; there would need to be a board driver existing to link Intel SST audio device to the Realtek RT5648 codec.  Also note that ALC5648, RT5648, 10EC5648 are all basically the same thing: different identifiers for the Realtek 5648 codec.

And then of course you have to have the codec itself (which is loaded by the above-mentioned board driver).  In RT5648 case it does have the same device ID as RT5645, so initially I was trying to create a board driver bytcr_rt5645 to link the Intel device and firmware together with the rt5645 codec.  

Yes, as others have pointed out, Asus did use RT5648 with Baytrail-CR in a few mobile Android devices; specifically a phone called FonePad and a tablet called MemoPad.  I looked at the source code for both of those after I found them online and determined that the closer fit was the tablet (for multiple reasons, but especially because it had stereo speakers instead of mono, and there were fewer use-cases for sound output mixing like phone, speakerphone, etc which did not match cases for the X205TA). However, one major hurdle in this is that these devices are a couple of years old now, and the kernel used in these versions of Android (as well as Android in general), and the structure of the ASoC sound system in Linux kernal at the time was quite a bit different from modern versions of the kernel.  It became quickly evident that trying to retrofit the existing code into modern versions of the kernel would be close to impossible, or, at a minimum, very painful to do!

Another complicating factor, is that SoC-based devices like this are typically for mobile such as Android, and as such they typically use UCM to control mixing for sound output and input.  I and Michele both were ultimately able to get a board driver compiled, using Intel firmware (and debate between SSP0/1/2 is also in question..) and Realtek RT5645 (or modified to more closely map RT5648 -- I spent a lot of time diff'ing the two and getting rt5645 to line up best I could with some of the very small differences found in rt5648).  But, because of the point with UCM, the reality is that there are HUNDREDS of possible controls which must be set in order to control sound output and volume.  So even if what I or Michele had was mostly working, it could be that we would still have a ton of trouble just getting the Alsa mixer controls set properly to even ensure that sound would play back.  I did even pull the UCM profiles from some of these Android devices, but partly because there were so many differences in the Linux sound system between the older Android versions and modern 4.x kernels, it was still a lot of hurdles and a lot of differences!  But reading through them did at least give me an idea on what to try, yet unfortunately I was never able to get sound to output.  The closest I ever got was a one-time little pop sound from the speakers!

So to recap:  Intel SOC driver + Intel firmware + Realtek Codec + Alsa mixer controls/UCM are really the combination that are necessary here.  

On the Android devices (Fonepad and Memopad) which have similar hardware, when you read the code and see the comments, it was actually mostly put together by some folks at Asus and not Intel and Realtek (however I think they did help some at some point?).  If I recall, the dates in the code comments were somewhere around 2012/2013 time frame.  What I began to realize in part, over time, from working with all of this, is that it is pretty difficult to try and "guess" at what most of these values and settings should be without having the knowledge of how the hardware itself was implemented on the device.  This is part of why I feel that Asus probably would have the ultimate responsibility in putting something like this together, though I am not sure if they are actively interested or working on anything of the sort.

As for myself and my own involvement: the X205TA was sort of an in-between device for me as I was searching for a more expensive device that fit all of my usage requirements. It became more of a hobby than anything.  Ultimately, I have since sold my X205TA and now I have a very nice UX303UB that does everything that I was looking for.  I even have it set up to triple boot between Windows and 2 distributions of Linux with everything working.  The battery life isn't as nice as the X205TA, but it isn't bad, either! (easily 7-8+ hours depending on what I am doing)

My experience with other Asus devices (such as my UX303UB) help to further cement my opinion that the X205TA (and devices similar to it using mobile device class SOC processors) were ones which were a little bit of a departure from certain standard things which Asus has used in laptop devices of the past -- including the sound codecs, embedded controller devices for things like hotkeys and hotkey notifications, etc.  All of these things which I spent a lot of time debugging and running into roadblocks on the X205TA are not an issue with some other laptop models from Asus which do not use these mobile-class processors like the Intel Atom.  The reality is that the usage of devices like this with Linux is very small, and they are almost becoming deprecated with newer models coming out multiple times each year.  There is not really any monetary or other incentive that I can tell for Asus to try and support this kind of development--they have other things which they are investing their time in!  For the FonePad and MemoPad, these were products which they were marketing and selling with Android, so they had to get the sound working for them in order to create and sell the product.

Anyway, I realize this ended up being a pretty long comment, but hopefully it will help someone in further troubleshooting this device and maybe coming with a good solution!  If I can provide any help or anything, I will try to do so as I am able and capable.  

Best of luck! :) 

Josh
Comment 45 Alejandro Soto 2016-11-22 20:16:17 UTC
Didn't knew that you guys had already come up with a much more complete codebase than my driver-attempt. So, better off ignore my code and let's use your code as a base code ;). Do you have any links to it?
Comment 46 harryharryharry 2016-11-24 13:47:59 UTC
@Joshua Grisham

First of all, thank you for taking the time to provide your input even though this doesn't directly benefit you anymore. I wholeheartedly agree with you that we should laud Bard for giving his feedback despite the negative tone here lately.

Is there a way to access the work you and others have already done so we (or more specifically, people with capabilities to do so; sadly I'm not one of them) can build forward on that and do not need to reinvent the wheel ?

Thanks in advance,
Harry
Comment 47 Bard Liao 2016-11-25 08:50:31 UTC
Don't know if this can help anyone. The latest audio code is on
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next branch. But I didn't try it on ubuntu.
Comment 48 Joshua Grisham 2016-11-25 16:45:32 UTC
Alejandro, I have sent you a mail with some of my code.  I did not keep track of all of my iterations, but that is one version which I had sent over to Intel for them to review.  There is some more context on each of the files in my mail to you.  Please feel free to take and upload for anyone else in the community and modify to your liking!

Josh
Comment 49 Pierre Bossart 2016-11-29 18:45:04 UTC
this can be solved fairly simply by adding the MCLK support to the byt-rt5645 machine driver (same as in bytcr-rt5640).
Comment 50 Pierre Bossart 2016-11-30 20:30:52 UTC
can you try the code at https://github.com/plbossart/sound/tree/topic/bytrtclocks

compile tested only but it should load the rt5645 driver and the cht-bsw-rt545 driver.

If it works and you see the 'no backend' message your mixer settings are incorrect, use the UCM configuration from alsa-lib/src/conf/chtrt5645 and copy it to /usr/share/alsa/ucm

please send dmesg logs if this doesn't work.
Comment 51 Skullnet 2016-12-01 14:41:30 UTC
This doesn't work :)

After I did.

monsterovich@eee ~ $ play micro.wav 
play FAIL formats: can't open output file `default': snd_pcm_hw_params error: Invalid argument

dmesg:

[   60.903138]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
Comment 52 Skullnet 2016-12-01 15:42:50 UTC
Well, there is full dmesg log.
http://pastebin.com/TyV2zYp5
Comment 53 Pierre Bossart 2016-12-01 16:36:48 UTC
Well there is encouraging news: the codec driver is detected and the machine driver gets loaded. I heard about two issues:

For people who get the 'Audio Port: ASoC: no backend DAIs enabled for Audio Port' this is a configuration issue, you need to set the DSP mixers. If you just copy the existing alsa-lib/src/conf/ucm/chtrt5645 to /usr/share/alsa/ucm the message should go away. Note that the configuration isn't good, the volume is very low and I see the headset output only but that's a start. If you don't use UCM/PulseAudio then use the UCM files to set the alsamixer values with a script.

for people who see 'cht-bsw-rt5645 cht-bsw-rt5645: ASoC: CODEC DAI rt5645-aif1 not registered" in dmesg, I found this regression on a CHT device as well and identified the issue. I will revert this commit as a work-around on my branch and see if this works later today. 


67bf5156edc4f58241fd7c119ae145c552adddd6 is the first bad commit
commit 67bf5156edc4f58241fd7c119ae145c552adddd6
Author: David Arcari <darcari@redhat.com>
Date:   Wed Oct 12 18:40:30 2016 +0200

    gpio / ACPI: fix returned error from acpi_dev_gpio_irq_get()
    
    acpi_dev_gpio_irq_get() currently ignores the error returned
    by acpi_get_gpiod_by_index() and overwrites it with -ENOENT.
    
    Problem is this error can be -EPROBE_DEFER, which just blows
    up some drivers when the module ordering is not correct.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: David Arcari <darcari@redhat.com>
    Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
    Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Comment 54 Skullnet 2016-12-01 17:16:56 UTC
>If you just copy the existing alsa-lib/src/conf/ucm/chtrt5645 to
>/usr/share/alsa/ucm the message should go away.

It didn't.
Comment 55 Pierre Bossart 2016-12-01 17:22:23 UTC
then you need to debug and figure out what pulseaudio does. this is no longer a kernel/driver issue if the card is created
Comment 56 Skullnet 2016-12-01 17:26:06 UTC
>then you need to debug and figure out what pulseaudio does. this is no longer
>a kernel/driver issue if the card is created

I don't have PA installed.
Comment 57 Joshua Grisham 2016-12-01 17:36:58 UTC
UCM profiles are used by pulseaudio so the profiles won't work without having it installed and playback using pulse. Your other option as Pierre mentioned before would be to read through the settings in the profiles and mirror the same control settings using alsamixer or similar.
Comment 58 Pierre Bossart 2016-12-01 17:42:45 UTC
I just pushed a forced update on my branch https://github.com/plbossart/sound/tree/topic/bytrtclocks

it works on a CHT device, it *should* not load all the drivers on baytrail and set the clocks as well.
Comment 59 Pierre Bossart 2016-12-01 17:43:30 UTC
typo: it *should* NOW load all the drivers on baytrail and set the clocks as well.
Comment 60 KBT 2016-12-01 19:20:29 UTC
unfortunately in my case alsa-mixer doesn't even see the device.

[2016-12-01 18:37] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #57 from Joshua Grisham <grishamjosh@gmail.com> ---
>UCM profiles are used by pulseaudio so the profiles won't work without having
>it installed and playback using pulse. Your other option as Pierre mentioned
>before would be to read through the settings in the profiles and mirror the
>same control settings using alsamixer or similar.
Comment 61 Takashi Iwai 2016-12-01 19:43:13 UTC
(In reply to Joshua Grisham from comment #57)
> UCM profiles are used by pulseaudio so the profiles won't work without
> having it installed and playback using pulse.

Not really, UCM is independent from PA.  UCM profiles can be used via alsaucm program included in alsa-utils alone.

>  Your other option as Pierre
> mentioned before would be to read through the settings in the profiles and
> mirror the same control settings using alsamixer or similar.

Right, that's another option, and possibly may cover even more than the current UCM profile.

Again: if you see "no backend" message is found in kernel, it's basically a good sign.  The rest is most likely only the mixer / DSP setup, i.e. merely a configuration problem.  (So in theory, at this point, this "kernel bugzilla entry" can be even closed -- it's no kernel bug, after all :)

Note that it's implemented with DPCM, and without the proper routing set up by user, nothing works; even aplay fails, as some of you have already seen.  This is normal behavior.  You need to try to set up the routing either manually or UCM for making it flying.
Comment 62 Skullnet 2016-12-01 20:05:38 UTC
>Again: if you see "no backend" message is found in kernel, it's basically a
>good sign.

Well, this message disappeared when I put these commands:

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

But I still have no sound.

I also found that there are a lot of interrupts in intel audio driver:

monsterovich@eee ~ $ cat /proc/interrupts | grep -E "CPU|sst"
            CPU0       CPU1       CPU2       CPU3       
   1:          1      35758          0          0   IO-APIC   29-fasteoi   intel_sst_driver
monsterovich@eee ~ $ play Beelzebub.flac 

Beelzebub.flac:

 File Size: 52.9M     Bit Rate: 1.62M
  Encoding: FLAC          
  Channels: 2 @ 24-bit   
Samplerate: 44100Hz      
Replaygain: off         Artist: Gnosis (Remastered by Monsterovich)
  Duration: 00:04:21.51  Title: Beelzebub

In:1.49% 00:00:03.90 [00:04:17.61] Out:182k  [   -==|==    ]        Clip:0    
Aborted.
monsterovich@eee ~ $ cat /proc/interrupts | grep -E "CPU|sst"
            CPU0       CPU1       CPU2       CPU3       
   1:          1      35981          0          0   IO-APIC   29-fasteoi   intel_sst_driver
Comment 63 Pierre Bossart 2016-12-01 20:25:16 UTC
Apparently most people are now able to load drivers and get a card created, however more work is needed:

1. dmesg shows [   10.144419] intel_sst_acpi 80860F28:00: Detected Baytrail-CR platform
This means the routing with SSP2 will not work, only SSP0 is physically present on the package. We would need to use the same quirk as on bytcr_rt5640 to enable the SSP0-AIF1 connection to get sound.

2. the UCM file is not very good and would need some love.

Will see if I can do this later this week.
Comment 64 Pierre Bossart 2016-12-02 02:55:42 UTC
Another update is available at https://github.com/plbossart/sound/tree/topic/bytrtclocks

I essentially copy-pasted most of the code needed for Baytrail-CR. On this device the DSDT tells me the routing should be SSP0-AIF1, let me know if this helps

I also squelched some of the warnings but I am not too happy with the refcount-based solution, it's kludgy but hopefully enough for the time being.

Again tested only on a CHT device for non-regressions, I have no X205 hardware.
Comment 65 Skullnet 2016-12-02 11:49:34 UTC
It didn't work anyway.

monsterovich@eee ~ $ aplay micro.wav 
Воспроизведение WAVE 'micro.wav' : Signed 16 bit Little Endian, Частота 44100 Гц, Стерео
aplay: set_params:1297: Невозможно установить параметры hw:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 125000
PERIOD_SIZE: (5512 5513)
PERIOD_BYTES: (22048 22052)
PERIODS: (3 5)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0

[  136.965900] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  136.966991]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  159.100978] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  159.102061]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  160.995503]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  205.543482] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  205.544564]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  206.409306]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  207.036665]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  211.030900] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  211.031968]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  220.476716] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  220.504486]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  403.094006] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  403.096563]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  405.840828] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  405.841894]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  419.924946] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  419.926004]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  425.884511] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  425.885577]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  432.536858] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  432.537929]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  446.224787] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  446.225900]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  498.184757] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  498.185821]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  499.095537]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  499.630406]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  500.299676]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
Comment 66 Takashi Iwai 2016-12-02 12:28:59 UTC
(In reply to Skullnet from comment #65)
> It didn't work anyway.

You didn't set up the DSP, that's why you still see "no backend DAIs" error and aplay hw_params error.  In addition to setting up DSP, you'll need to set up the RT codec mixer elements to make the sound working.  Even if all these are set up properly but you still don't get the sound, it might be a driver issue.
Comment 67 Skullnet 2016-12-02 13:54:52 UTC
>In addition to setting up DSP, you'll need to set up the RT codec mixer
>elements to make the sound working

Which one? http://pastebin.com/p4ydC7mL

There are a LOT of them.
Comment 68 Takashi Iwai 2016-12-02 13:57:49 UTC
(In reply to Skullnet from comment #67)
> >In addition to setting up DSP, you'll need to set up the RT codec mixer
> elements to make the sound working
> 
> Which one? http://pastebin.com/p4ydC7mL

All of them :)
Comment 69 Skullnet 2016-12-02 15:57:52 UTC
>All of them :)

I still get this "no backend DAIs" message after I enabled everything. However, It worked in previous version, but without sound.
Comment 70 Takashi Iwai 2016-12-02 16:01:27 UTC
You shouldn't enable everything, but *adjust* everything properly to match with your hardware configuration.
Comment 71 Pierre Bossart 2016-12-02 16:56:15 UTC
it's difficult to provide feedback or correct problems if you don't add any attachment, dmesg, or additional information. Keep in mind that neither Takashi nor I have this hardware so it's not like we can provide a turn-key solution.

(In reply to Skullnet from comment #69)
> >All of them :)
> 
> I still get this "no backend DAIs" message after I enabled everything.
> However, It worked in previous version, but without sound.
Comment 72 Pierre Bossart 2016-12-02 16:59:05 UTC
And actually the source of your problems are likely because with the SSP0 routing the 'modem' mixers are not set. Something like this should work:

amixer -c0 set 'modem_out mix 0 pcm0_in' on

(In reply to Pierre Bossart from comment #71)
> it's difficult to provide feedback or correct problems if you don't add any
> attachment, dmesg, or additional information. Keep in mind that neither
> Takashi nor I have this hardware so it's not like we can provide a turn-key
> solution.
> 
> (In reply to Skullnet from comment #69)
> > >All of them :)
> > 
> > I still get this "no backend DAIs" message after I enabled everything.
> > However, It worked in previous version, but without sound.
Comment 73 Pierre Bossart 2016-12-02 19:47:15 UTC
Created attachment 246651 [details]
mixer settings for speaker playback

tested on Asus T100HA, works fine on speakers. No luck with headphones, static noise and crackling sound
Comment 74 Skullnet 2016-12-02 19:54:53 UTC
>tested on Asus T100HA, works fine on speakers. No luck with headphones, static
>noise and crackling sound

This script removed "no backend DAIs" message, but I still have no sound from speakers or headphones.
Comment 75 Skullnet 2016-12-02 20:22:34 UTC
Well, when I enabled the "Speaker Channel" option, speakers started to beep loudly and get warm and I instantly turned off my laptop. This driver is dangerous. I don't want to get dead speakers as a result of these useless tests.
Comment 76 Takashi Iwai 2016-12-02 21:09:29 UTC
Yes, for any sound testing, you'd have to start from the low level and raise the volume gradually.  Never ever test with the full volume from the beginning, and check always the dB level in each mixer element.
That's why basically all volumes are lowest and muted as default.  Such a danger isn't specific to this driver but it's true in general.

(Though, ASoC codec driver tends to expose all possible stuff that can toast more easily than the ones on PC laptops, indeed...)
Comment 77 Pierre Bossart 2016-12-02 21:15:06 UTC
Nobody forced you to run those tests and these settings are examples only tested on another machine where they work well - clearly indicated in the comment. If you find the driver dangerous and the test useless you are welcome to try something else. Best of luck.
Comment 78 harryharryharry 2016-12-02 23:44:33 UTC
Thanks a lot for all the help & work you put into this Pierre and Takashi ! This is in no way useless (as someone implied before), let me tell you! 

If I am able to, I'll try and get you some actual meaningful feedback...
Comment 79 Alejandro Soto 2016-12-02 23:56:44 UTC
(In reply to harryharryharry from comment #78)
> Thanks a lot for all the help & work you put into this Pierre and Takashi !
> This is in no way useless (as someone implied before), let me tell you! 
> 
> If I am able to, I'll try and get you some actual meaningful feedback...
I'm by no means attempting to defend the "useless tests" comment. Everyone's help here is greatly appreciated, and is the only means we have to run the OS we want, the way we want, on our own systems. But, given that the aforementioned commenter almost burnt out his speakers while performing these tests, further precaution must of course be taken.
Comment 80 Pierre Bossart 2016-12-10 01:37:49 UTC
While debugging an imbalance between mclck enable/disable calls that generated warnings in dmesg, I may have found the root cause for the problem on Baytrail, there was a missing DAPM configuration and as a result the mclk was not enabled at the right frequency. It may explain the behavior reported last week. 

For testers there is a new branch at 
https://github.com/plbossart/sound/tree/experimental/codecs

the name of the branch is self-explanatory, the code was tested on CHT, not Baytrail and all standard disclaimers apply. Please start with the lowest volume setting and increase gradually

amixer -Dhw:chtrt5645 cset name="Speaker Playback Volume" 1%
Comment 81 harryharryharry 2016-12-10 22:01:31 UTC
Hi Pierre, 

I compiled & booted a kernel from your experimental/codecs branch. There is no audio (also no heat or smoke :) ).

This is the dmesg:
http://sprunge.us/UUFj

For now I only built the kernel and tried to play a mp3-file with vlc (after I applied the "mixer settings for speaker playback"-attachment you uploaded, and set speaker playback volume to low first...) because I wouldn't really know what to test/try next...

If there is anything else I can test or other logs I can provide please let me know.

Gr. Harry
Comment 82 tom schmitz 2016-12-11 09:25:33 UTC
Hello,

I am following this already for some time... its quite important so i want to contribute by testing. 
thing is, i am not sure how.

so i download for example the latest source- 4.8.0 and patch it with pierres files.
Then what steps are important?

i am not the most experienced linux user out there...

Big question. do I need to adjust something else in order to be able to boot with the new kernel later on?

greets, tom
Comment 83 Takashi Iwai 2016-12-11 16:56:21 UTC
Better to use Pierre's branch as is, instead of cherry-picking.  It's based on the latest ASoC tree, so it's practically for 4.10 kernel, and already contains other relevant fixes than 4.8.
Comment 84 Pierre Bossart 2016-12-12 15:32:15 UTC
yes, use this branch, make sure you have KConfigs PINCTRL_BAYTRAIL and PINCTRL_CHERRYVIEW enabled ('m' or 'y')
Then install the new kernel and setup the mixers (with the script or UCM) and send the dmesg logs if it fails
Comment 85 Pierre Bossart 2016-12-12 15:34:36 UTC
(In reply to harryharryharry from comment #81)
> Hi Pierre, 
> 
> I compiled & booted a kernel from your experimental/codecs branch. There is
> no audio (also no heat or smoke :) ).
> 
> This is the dmesg:
> http://sprunge.us/UUFj
> 
> For now I only built the kernel and tried to play a mp3-file with vlc (after
> I applied the "mixer settings for speaker playback"-attachment you uploaded,
> and set speaker playback volume to low first...) because I wouldn't really
> know what to test/try next...
> 
> If there is anything else I can test or other logs I can provide please let
> me know.
> 
> Gr. Harry

Your log shows:
[   11.368499]  Audio Port: ASoC: no backend DAIs enabled for Audio Port

which is the telltale sign that the mixers are not set. Maybe reboot if the mixer settings were not applied upfront.
Comment 86 KBT 2016-12-12 16:18:19 UTC
Hello Pierre,

i tried all the new suggestions and your script.

i still have no sound, but i see:

[  110.099134] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  110.177689] Base clock rate 1536000 is too low
[  110.177699] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[  110.177704] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22
[  110.368232] Base clock rate 1536000 is too low
[  110.368243] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[  110.368248] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22
[  119.879133] intel_sst_acpi 80860F28:00: FW Version 01.dd.dd.dd
[  119.988003] Base clock rate 1536000 is too low
[  119.988032] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[  119.988051] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22
[  120.158250] Base clock rate 1536000 is too low
[  120.158261] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[  120.158266] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22

yours
 Christian

[2016-12-12 16:32] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #84 from Pierre Bossart <pierre-louis.bossart@linux.intel.com> ---
>yes, use this branch, make sure you have KConfigs PINCTRL_BAYTRAIL and
>PINCTRL_CHERRYVIEW enabled ('m' or 'y')
>Then install the new kernel and setup the mixers (with the script or UCM) and
>send the dmesg logs if it fails
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 87 Pierre Bossart 2016-12-12 16:33:43 UTC
there may be a missing control value, I only set the mclk to 19.2 MHz and I have no idea how this might get divided into 1.536MHz

@Bard: can you look into this?
https://github.com/plbossart/sound/blob/4dc0569af161dd57c47e83a09326be372165642b/sound/soc/codecs/rt5645.c#L839
Comment 88 harryharryharry 2016-12-12 17:01:04 UTC
Thanks for the feedback Pierre. I think I'm up to speed, as I'm getting the same message as KBT now.
Comment 89 Pierre Bossart 2016-12-12 17:57:31 UTC
(In reply to harryharryharry from comment #88)
> Thanks for the feedback Pierre. I think I'm up to speed, as I'm getting the
> same message as KBT now.

can you share the dmesg log? I suspect the issue is due to a missing control, on CHT I test with SSP2-AIF1 but on baytrail you would need to use SSP0-AIF2 and maybe the dmic link isn't quite right
Comment 90 harryharryharry 2016-12-12 18:09:32 UTC
this is my dmesg:
http://sprunge.us/VDaY
Comment 91 Pierre Bossart 2016-12-12 19:03:08 UTC
I can confirm the issue is due to a different routing. when I force the routing to be the same as on Baytrail I also see the same logs. We probably need Realtek's help here.
Comment 92 Alejandro Soto 2016-12-12 19:13:37 UTC
(In reply to Pierre Bossart from comment #91)
> I can confirm the issue is due to a different routing. when I force the
> routing to be the same as on Baytrail I also see the same logs. We probably
> need Realtek's help here.
I fear that isn't going to happen anytime soon. A few of us emailed them about a year ago, and got absolutely no response.
Comment 93 Pierre Bossart 2016-12-12 19:55:26 UTC
where do you think the mixers settings come from? Bard Liao from Realtek has been extremely helpful.
Most of the issues here are due to hardware differences and BIOS concerns, Realtek and Intel are both trying to help without knowledge on how those platforms were built or actual hardware to test.
Comment 94 Alejandro Soto 2016-12-12 19:59:02 UTC
I thought Bard Laio worked at Intel... sorry for the confusion.
Comment 95 Bard Liao 2016-12-13 01:41:41 UTC
(In reply to Pierre Bossart from comment #87)
> there may be a missing control value, I only set the mclk to 19.2 MHz and I
> have no idea how this might get divided into 1.536MHz
> 
> @Bard: can you look into this?
> https://github.com/plbossart/sound/blob/
> 4dc0569af161dd57c47e83a09326be372165642b/sound/soc/codecs/rt5645.c#L839

You can use PLL to get 24.576MHz sysclk.
sysclk = 512 * params_rate(params);
snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK, mclk rate, sysclk);
snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_PLL1, sysclk, SND_SOC_CLOCK_IN);
Comment 96 Bard Liao 2016-12-13 01:46:18 UTC
Created attachment 247511 [details]
mixer setting for rt5645 codec driver

That is for reference only. If anyone find(feel) there is anything wrong, please let me know.
Comment 97 Pierre Bossart 2016-12-13 14:42:57 UTC
(In reply to Bard Liao from comment #95)
> (In reply to Pierre Bossart from comment #87)
> > there may be a missing control value, I only set the mclk to 19.2 MHz and I
> > have no idea how this might get divided into 1.536MHz
> > 
> > @Bard: can you look into this?
> > https://github.com/plbossart/sound/blob/
> > 4dc0569af161dd57c47e83a09326be372165642b/sound/soc/codecs/rt5645.c#L839
> 
> You can use PLL to get 24.576MHz sysclk.
> sysclk = 512 * params_rate(params);
> snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK, mclk rate, sysclk);
> snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_PLL1, sysclk,
> SND_SOC_CLOCK_IN);

it's what we are doing already in the hw_params
https://github.com/plbossart/sound/blob/2966f928814f706ea18c112d6a46d670457d799e/sound/soc/intel/boards/cht_bsw_rt5645.c#L221

Does it need to be done earlier on startup?
Comment 98 harryharryharry 2016-12-16 17:33:17 UTC
Is there anything we can 'trial-and-error' about it, or does Bard need to shine his light on this one ?
Comment 99 Pierre Bossart 2016-12-16 19:07:17 UTC
I am working with Bard to solve the DMIC setting issue. Stay tuned.
Comment 100 Pierre Bossart 2016-12-19 18:43:21 UTC
Bard Liao provided a fix that makes the "Failed to set DMIC clock" error message go away when using AIF2 and no regression on AIF1. Any volunteers to test on X205TA?

new branch (forced update) is at:
https://github.com/plbossart/sound/commits/experimental/codecs

No functional changes since last time except a rebase to the latest broonie/for-next code and an update for the MCLK code.
Comment 101 KBT 2016-12-20 16:46:24 UTC
Created attachment 248181 [details]
dmesg.txt

I tried the tip of the topic branch

i still get: Audio Port: ASoC: no backend DAIs enabled for Audio Port

even after running 5645_mixers.sh

after playing around a bit toggling DAC L2 Mux ( IF1 DAC)
 gave some noise (strangely not the audio i wanted to play though, a lot deeper)

dmesg.txt attached


[2016-12-19 19:43] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #100 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
>---
>Bard Liao provided a fix that makes the "Failed to set DMIC clock" error
>message go away when using AIF2 and no regression on AIF1. Any volunteers to
>test on X205TA?
>
>new branch (forced update) is at:
>https://github.com/plbossart/sound/commits/experimental/codecs
>
>No functional changes since last time except a rebase to the latest
>broonie/for-next code and an update for the MCLK code.
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 102 KBT 2016-12-20 16:49:13 UTC
 toggling DAC1 L Mux gives something intelligible 

 it's stuttering though

[2016-12-20 17:46] Dr. Christian Bahls - qb352.de <kbt@qb352.de> wrote:
>I tried the tip of the topic branch
>
>i still get: Audio Port: ASoC: no backend DAIs enabled for Audio Port
>
>even after running 5645_mixers.sh
>
>after playing around a bit toggling DAC L2 Mux ( IF1 DAC)
>gave some noise (strangely not the audio i wanted to play though, a lot
>deeper)
>
>dmesg.txt attached
>
>
>[2016-12-19 19:43] bugzilla-daemon@bugzilla.kernel.org
><bugzilla-daemon@bugzilla.kernel.org> wrote:
>>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>>
>>--- Comment #100 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
>>---
>>Bard Liao provided a fix that makes the "Failed to set DMIC clock" error
>>message go away when using AIF2 and no regression on AIF1. Any volunteers to
>>test on X205TA?
>>
>>new branch (forced update) is at:
>>https://github.com/plbossart/sound/commits/experimental/codecs
>>
>>No functional changes since last time except a rebase to the latest
>>broonie/for-next code and an update for the MCLK code.
>>
>>-- 
>>You are receiving this mail because:
>>You are on the CC list for the bug.

>[    0.000000] Linux version 4.9.0-x205ta-pb-nf-00332-g5fd7444 (e@dumbo) (gcc
>version 6.2.0 20161109 (Debian 6.2.0-13) ) #11 SMP Tue Dec 20 17:21:20 CET
>2016
>[    0.000000] KERNEL supported cpus:
>[    0.000000]   Intel GenuineIntel
>[    0.000000] x86/fpu: Legacy x87 FPU detected.
>[    0.000000] x86/fpu: Using 'eager' FPU context switches.
>[    0.000000] e820: BIOS-provided physical RAM map:
>[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000008efff] usable
>[    0.000000] BIOS-e820: [mem 0x000000000008f000-0x000000000008ffff] ACPI NVS
>[    0.000000] BIOS-e820: [mem 0x0000000000090000-0x000000000009dfff] usable
>[    0.000000] BIOS-e820: [mem 0x000000000009e000-0x000000000009ffff] reserved
>[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001fffffff] usable
>[    0.000000] BIOS-e820: [mem 0x0000000020000000-0x00000000201fffff] reserved
>[    0.000000] BIOS-e820: [mem 0x0000000020200000-0x000000007b8d1fff] usable
>[    0.000000] BIOS-e820: [mem 0x000000007b8d2000-0x000000007b901fff] reserved
>[    0.000000] BIOS-e820: [mem 0x000000007b902000-0x000000007b935fff] ACPI
>data
>[    0.000000] BIOS-e820: [mem 0x000000007b936000-0x000000007c040fff] ACPI NVS
>[    0.000000] BIOS-e820: [mem 0x000000007c041000-0x000000007c928fff] reserved
>[    0.000000] BIOS-e820: [mem 0x000000007c929000-0x000000007c984fff] type 20
>[    0.000000] BIOS-e820: [mem 0x000000007c985000-0x000000007cbfffff] usable
>[    0.000000] BIOS-e820: [mem 0x00000000e00f8000-0x00000000e00f8fff] reserved
>[    0.000000] BIOS-e820: [mem 0x00000000fed01000-0x00000000fed01fff] reserved
>[    0.000000] BIOS-e820: [mem 0x00000000fed08000-0x00000000fed08fff] reserved
>[    0.000000] BIOS-e820: [mem 0x00000000ffb00000-0x00000000ffffffff] reserved
>[    0.000000] Notice: NX (Execute Disable) protection cannot be enabled:
>non-PAE kernel!
>[    0.000000] efi: EFI v2.31 by American Megatrends
>[    0.000000] efi:  ACPI=0x7b935000  ACPI 2.0=0x7b935014  ESRT=0x7c928290 
>SMBIOS=0x7c928110
>[    0.000000] SMBIOS 2.7 present.
>[    0.000000] DMI: ASUSTeK COMPUTER INC. X205TA/X205TA, BIOS X205TA.212
>09/04/2015
>[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
>[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
>[    0.000000] e820: last_pfn = 0x7cc00 max_arch_pfn = 0x100000
>[    0.000000] MTRR default type: uncachable
>[    0.000000] MTRR fixed ranges enabled:
>[    0.000000]   00000-9FFFF write-back
>[    0.000000]   A0000-FFFFF write-protect
>[    0.000000] MTRR variable ranges enabled:
>[    0.000000]   0 base 000000000 mask F80000000 write-back
>[    0.000000]   1 base 07E000000 mask FFE000000 uncachable
>[    0.000000]   2 base 07D000000 mask FFF000000 uncachable
>[    0.000000]   3 base 07CE00000 mask FFFE00000 uncachable
>[    0.000000]   4 base 07CE00000 mask FFFE00000 uncachable
>[    0.000000]   5 base 07CD00000 mask FFFF00000 uncachable
>[    0.000000]   6 disabled
>[    0.000000]   7 disabled
>[    0.000000] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- WT
>[    0.000000] esrt: Reserving ESRT space from 0x7c928290 to 0x7c9282c8.
>[    0.000000] initial memory mapped: [mem 0x00000000-0x0effffff]
>[    0.000000] Base memory trampoline at [78099000] 99000 size 16384
>[    0.000000] BRK [0x0e80a000, 0x0e80afff] PGTABLE
>[    0.000000] BRK [0x0e80b000, 0x0e80bfff] PGTABLE
>[    0.000000] BRK [0x0e80c000, 0x0e80cfff] PGTABLE
>[    0.000000] RAMDISK: [mem 0x3752a000-0x37a8cfff]
>[    0.000000] ACPI: Early table checksum verification disabled
>[    0.000000] ACPI: RSDP 0x000000007B935014 000024 (v02 _ASUS_)
>[    0.000000] ACPI: XSDT 0x000000007B9340F8 0000D4 (v01 _ASUS_ Notebook
>00000003 MSFT 0100000D)
>[    0.000000] ACPI: FACP 0x000000007B930000 00010C (v05 _ASUS_ Notebook
>00000003 AMI  0100000D)
>[    0.000000] ACPI: DSDT 0x000000007B919000 0126D7 (v02 _ASUS_ Notebook
>00000003 AMI  0100000D)
>[    0.000000] ACPI: TCPA 0x000000007B933000 000032 (v02                
>00000000      00000000)
>[    0.000000] ACPI: UEFI 0x000000007BFF4000 000042 (v01 _ASUS_ Notebook
>00000000      00000000)
>[    0.000000] ACPI: OEM0 0x000000007B932000 000084 (v05 _ASUS_ BATTERY 
>00000003 AMI  0100000D)
>[    0.000000] ACPI: DBG2 0x000000007B931000 000072 (v00 _ASUS_ INTLDBG2
>00000003 AMI  0100000D)
>[    0.000000] ACPI: HPET 0x000000007B92F000 000038 (v01 _ASUS_ Notebook
>00000003 AMI  0100000D)
>[    0.000000] ACPI: LPIT 0x000000007B92E000 000104 (v01 _ASUS_ Notebook
>00000003 AMI  0100000D)
>[    0.000000] ACPI: APIC 0x000000007B92D000 00006C (v03 _ASUS_ Notebook
>00000003 AMI  0100000D)
>[    0.000000] ACPI: MCFG 0x000000007B92C000 00003C (v01 _ASUS_ Notebook
>00000003 AMI  0100000D)
>[    0.000000] ACPI: SSDT 0x000000007B918000 000603 (v01 _ASUS_ CpuDptf 
>00000003 AMI  0100000D)
>[    0.000000] ACPI: SSDT 0x000000007B916000 001BE2 (v01 _ASUS_ DptfTab 
>00000003 AMI  0100000D)
>[    0.000000] ACPI: SSDT 0x000000007B915000 000058 (v01 _ASUS_ LowPwrM 
>00000003 AMI  0100000D)
>[    0.000000] ACPI: SSDT 0x000000007B914000 0000FF (v01 _ASUS_ SoCDptf 
>00000003 AMI  0100000D)
>[    0.000000] ACPI: FPDT 0x000000007B913000 000044 (v01 _ASUS_ Notebook
>01072009 AMI  00010013)
>[    0.000000] ACPI: SSDT 0x000000007B912000 000763 (v01 PmRef  CpuPm   
>00003000 INTL 20061109)
>[    0.000000] ACPI: SSDT 0x000000007B911000 000290 (v01 PmRef  Cpu0Tst 
>00003000 INTL 20061109)
>[    0.000000] ACPI: SSDT 0x000000007B910000 00017A (v01 PmRef  ApTst   
>00003000 INTL 20061109)
>[    0.000000] ACPI: SSDT 0x000000007B90F000 000427 (v01 Intel_ Tpm2Tabl
>00001000 INTL 20061109)
>[    0.000000] ACPI: TPM2 0x000000007B90E000 000034 (v03                
>00000000      00000000)
>[    0.000000] ACPI: BGRT 0x000000007B90D000 000038 (v01 _ASUS_ Notebook
>01072009 AMI  00010013)
>[    0.000000] ACPI: CSRT 0x000000007B90C000 00014C (v00 _ASUS_ Notebook
>00000005 INTL 20120624)
>[    0.000000] ACPI: MSDM 0x000000007B900F90 000055 (v03 _ASUS_ Notebook
>00000000 ASUS 00000001)
>[    0.000000] ACPI: Local APIC address 0xfee00000
>[    0.000000] 0MB HIGHMEM available.
>[    0.000000] 1996MB LOWMEM available.
>[    0.000000]   mapped low ram: 0 - 7cc00000
>[    0.000000]   low ram: 0 - 7cc00000
>[    0.000000] BRK [0x0e80d000, 0x0e80dfff] PGTABLE
>[    0.000000] Zone ranges:
>[    0.000000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
>[    0.000000]   Normal   [mem 0x0000000001000000-0x000000007cbfffff]
>[    0.000000]   HighMem  empty
>[    0.000000] Movable zone start for each node
>[    0.000000] Early memory node ranges
>[    0.000000]   node   0: [mem 0x0000000000001000-0x000000000008efff]
>[    0.000000]   node   0: [mem 0x0000000000090000-0x000000000009dfff]
>[    0.000000]   node   0: [mem 0x0000000000100000-0x000000001fffffff]
>[    0.000000]   node   0: [mem 0x0000000020200000-0x000000007b8d1fff]
>[    0.000000]   node   0: [mem 0x000000007c985000-0x000000007cbfffff]
>[    0.000000] Initmem setup node 0 [mem
>0x0000000000001000-0x000000007cbfffff]
>[    0.000000] On node 0 totalpages: 506089
>[    0.000000] free_area_init_node: node 0, pgdat 866ca440, node_mem_map
>ef882028
>[    0.000000]   DMA zone: 40 pages used for memmap
>[    0.000000]   DMA zone: 0 pages reserved
>[    0.000000]   DMA zone: 3996 pages, LIFO batch:0
>[    0.000000]   Normal zone: 4950 pages used for memmap
>[    0.000000]   Normal zone: 502093 pages, LIFO batch:31
>[    0.000000] Using APIC driver default
>[    0.000000] Reserving Intel graphics memory at 0x7cf00000-0x7eefffff
>[    0.000000] ACPI: Local APIC address 0xfee00000
>[    0.000000] IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-86
>[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
>[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
>[    0.000000] Using ACPI (MADT) for SMP configuration information
>[    0.000000] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
>[    0.000000] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
>[    0.000000] PM: Registered nosave memory: [mem 0x0008f000-0x0008ffff]
>[    0.000000] PM: Registered nosave memory: [mem 0x0009e000-0x0009ffff]
>[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000fffff]
>[    0.000000] PM: Registered nosave memory: [mem 0x20000000-0x201fffff]
>[    0.000000] PM: Registered nosave memory: [mem 0x7b8d2000-0x7b901fff]
>[    0.000000] PM: Registered nosave memory: [mem 0x7b902000-0x7b935fff]
>[    0.000000] PM: Registered nosave memory: [mem 0x7b936000-0x7c040fff]
>[    0.000000] PM: Registered nosave memory: [mem 0x7c041000-0x7c928fff]
>[    0.000000] PM: Registered nosave memory: [mem 0x7c929000-0x7c984fff]
>[    0.000000] e820: [mem 0x7ef00000-0xe00f7fff] available for PCI devices
>[    0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles:
>0xffffffff, max_idle_ns: 19112604462750000 ns
>[    0.000000] setup_percpu: NR_CPUS:4 nr_cpumask_bits:4 nr_cpu_ids:4
>nr_node_ids:1
>[    0.000000] percpu: Embedded 16 pages/cpu @f3698000 s35788 r0 d29748 u65536
>[    0.000000] pcpu-alloc: s35788 r0 d29748 u65536 alloc=16*4096
>[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
>[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total
>pages: 501099
>[    0.000000] Kernel command line:
>BOOT_IMAGE=/vmlinuz-4.9.0-x205ta-pb-nf-00332-g5fd7444
>root=UUID=2b3b9c91-22c2-472a-8312-7934c9c774c6 ro noht nohpet
>drm.vblankoffdelay=1 video.use_native_backlight=1 i915.enable_hangcheck=0
>relative_sleep_states=1
>[    0.000000] Setting dangerous option i915.enable_hangcheck - tainting
>kernel
>[    0.000000] log_buf_len individual max cpu contribution: 32768 bytes
>[    0.000000] log_buf_len total cpu_extra contributions: 98304 bytes
>[    0.000000] log_buf_len min size: 131072 bytes
>[    0.000000] log_buf_len: 262144 bytes
>[    0.000000] early log buf free: 121284(92%)
>[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
>[    0.000000] Dentry cache hash table entries: 262144 (order: 8, 1048576
>bytes)
>[    0.000000] Inode-cache hash table entries: 131072 (order: 7, 524288 bytes)
>[    0.000000] Initializing CPU#0
>[    0.000000] Initializing HighMem for node 0 (00000000:00000000)
>[    0.000000] Memory: 1951292K/2024356K available (4887K kernel code, 362K
>rwdata, 1784K rodata, 472K init, 452K bss, 73064K reserved, 0K cma-reserved,
>0K highmem)
>[    0.000000] virtual kernel memory layout:
>                   fixmap  : 0xfff67000 - 0xfffff000   ( 608 kB)
>                   pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
>                   vmalloc : 0xf5400000 - 0xff7fe000   ( 163 MB)
>                   lowmem  : 0x78000000 - 0xf4c00000   (1996 MB)
>                     .init : 0x866e2000 - 0x86758000   ( 472 kB)
>                     .data : 0x864c6063 - 0x866e0980   (2154 kB)
>                     .text : 0x86000000 - 0x864c6063   (4888 kB)
>[    0.000000] Checking if this processor honours the WP bit even in
>supervisor mode...Ok.
>[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
>[    0.000000] Hierarchical RCU implementation.
>[    0.000000]         Build-time adjustment of leaf fanout to 32.
>[    0.000000] NR_IRQS:2304 nr_irqs:1024 0
>[    0.000000] CPU 0 irqstacks, hard=ef40c000 soft=ef40e000
>[    0.000000] Console: colour dummy device 80x25
>[    0.000000] console [tty0] enabled
>[    0.000000] tsc: Detected 1332.800 MHz processor
>[    0.000016] Calibrating delay loop (skipped), value calculated using timer
>frequency.. 2665.60 BogoMIPS (lpj=13328000)
>[    0.000043] pid_max: default: 32768 minimum: 301
>[    0.000067] ACPI: Core revision 20160831
>[    0.030746] ACPI: 9 ACPI AML tables successfully acquired and loaded
>[    0.087433] Mount-cache hash table entries: 4096 (order: 2, 16384 bytes)
>[    0.087452] Mountpoint-cache hash table entries: 4096 (order: 2, 16384
>bytes)
>[    0.087871] CPU: Physical Processor ID: 0
>[    0.087885] CPU: Processor Core ID: 0
>[    0.087901] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
>[    0.087913] ENERGY_PERF_BIAS: View and update with
>x86_energy_perf_policy(8)
>[    0.087934] mce: CPU supports 6 MCE banks
>[    0.087953] CPU0: Thermal monitoring enabled (TM1)
>[    0.087971] process: using mwait in idle threads
>[    0.087992] Last level iTLB entries: 4KB 48, 2MB 0, 4MB 0
>[    0.088006] Last level dTLB entries: 4KB 128, 2MB 16, 4MB 16, 1GB 0
>[    0.088313] Freeing SMP alternatives memory: 16K (86758000 - 8675c000)
>[    0.088437] smpboot: APIC(0) Converting physical 0 to logical package 0
>[    0.088453] smpboot: Max logical packages: 1
>[    0.088468] Enabling APIC mode:  Flat.  Using 1 I/O APICs
>[    0.088526] TSC deadline timer enabled
>[    0.088530] smpboot: CPU0: Intel(R) Atom(TM) CPU  Z3735F @ 1.33GHz (family:
>0x6, model: 0x37, stepping: 0x8)
>[    0.088560] Performance Events: PEBS fmt2+, 8-deep LBR, Silvermont events,
>8-deep LBR, full-width counters, Intel PMU driver.
>[    0.088603] ... version:                3
>[    0.088616] ... bit width:              40
>[    0.088628] ... generic registers:      2
>[    0.088640] ... value mask:             000000ffffffffff
>[    0.088652] ... max period:             0000007fffffffff
>[    0.088665] ... fixed-purpose events:   3
>[    0.088677] ... event mask:             0000000700000003
>[    0.090264] CPU 1 irqstacks, hard=ef4ea000 soft=ef4ec000
>[    0.090266] x86: Booting SMP configuration:
>[    0.090281] .... node  #0, CPUs:      #1
>[    0.090377] Initializing CPU#1
>[    0.240982] CPU 2 irqstacks, hard=ef4f8000 soft=ef4fa000
>[    0.241000]  #2
>[    0.241054] Initializing CPU#2
>[    0.391050] CPU 3 irqstacks, hard=ef50e000 soft=ef51c000
>[    0.391065]  #3
>[    0.391118] Initializing CPU#3
>[    0.540911] x86: Booted up 1 node, 4 CPUs
>[    0.540938] smpboot: Total of 4 processors activated (10665.98 BogoMIPS)
>[    0.541898] devtmpfs: initialized
>[    0.542621] PM: Registering ACPI NVS region [mem 0x0008f000-0x0008ffff]
>(4096 bytes)
>[    0.542645] PM: Registering ACPI NVS region [mem 0x7b936000-0x7c040fff]
>(7385088 bytes)
>[    0.543045] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff,
>max_idle_ns: 19112604462750000 ns
>[    0.543124] pinctrl core: initialized pinctrl subsystem
>[    0.543374] NET: Registered protocol family 16
>[    0.568782] cpuidle: using governor ladder
>[    0.569012] ACPI: bus type PCI registered
>[    0.569135] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem
>0xe0000000-0xefffffff] (base 0xe0000000)
>[    0.569161] PCI: not using MMCONFIG
>[    0.569962] PCI: Using configuration type 1 for base access
>[    0.608992] HugeTLB registered 4 MB page size, pre-allocated 0 pages
>[    0.609445] ACPI: Added _OSI(Module Device)
>[    0.609461] ACPI: Added _OSI(Processor Device)
>[    0.609474] ACPI: Added _OSI(3.0 _SCP Extensions)
>[    0.609488] ACPI: Added _OSI(Processor Aggregator Device)
>[    0.632083] ACPI: Dynamic OEM Table Load:
>[    0.632119] ACPI: SSDT 0x00000000EF608000 000501 (v01 PmRef  Cpu0Ist 
>00003000 INTL 20061109)
>[    0.632827] ACPI: Dynamic OEM Table Load:
>[    0.632857] ACPI: SSDT 0x00000000EF608800 000433 (v01 PmRef  Cpu0Cst 
>00003001 INTL 20061109)
>[    0.634235] ACPI: Dynamic OEM Table Load:
>[    0.634265] ACPI: SSDT 0x00000000EF5FC000 00015F (v01 PmRef  ApIst   
>00003000 INTL 20061109)
>[    0.634920] ACPI: Dynamic OEM Table Load:
>[    0.634951] ACPI: SSDT 0x00000000EF476F00 00008D (v01 PmRef  ApCst   
>00003000 INTL 20061109)
>[    0.638945] ACPI: Interpreter enabled
>[    0.639011] ACPI: (supports S0 S5)
>[    0.639025] ACPI: Using IOAPIC for interrupt routing
>[    0.639122] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem
>0xe0000000-0xefffffff] (base 0xe0000000)
>[    0.651355] [Firmware Info]: PCI: MMCONFIG at [mem 0xe0000000-0xefffffff]
>not reserved in ACPI motherboard resources
>[    0.651382] PCI: not using MMCONFIG
>[    0.651405] PCI: Using host bridge windows from ACPI; if necessary, use
>"pci=nocrs" and report a bug
>[    0.655742] ACPI: Power Resource [USBC] (on)
>[    0.663247] ACPI: Power Resource [PLPE] (on)
>[    0.674505] ACPI: Power Resource [CLK0] (on)
>[    0.674639] ACPI: Power Resource [CLK1] (on)
>[    0.675329] ACPI: Power Resource [P28T] (off)
>[    0.675456] ACPI: Power Resource [P18T] (off)
>[    0.680849] ACPI: Power Resource [P28X] (off)
>[    0.680982] ACPI: Power Resource [P18X] (off)
>[    0.681117] ACPI: Power Resource [P28P] (off)
>[    0.681251] ACPI: Power Resource [P18P] (off)
>[    0.681393] ACPI: Power Resource [P1XT] (off)
>[    0.682845] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
>[    0.690636] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
>[    0.690663] acpi PNP0A08:00: _OSC: OS supports [ASPM ClockPM Segments MSI]
>[    0.690797] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM
>[    0.690819] acpi PNP0A08:00: fail to add MMCONFIG information, can't access
>extended PCI configuration space under this bridge.
>[    0.691439] PCI host bridge to bus 0000:00
>[    0.691458] pci_bus 0000:00: root bus resource [io  0x0070-0x0077]
>[    0.691475] pci_bus 0000:00: root bus resource [io  0x0000-0x006f window]
>[    0.691491] pci_bus 0000:00: root bus resource [io  0x0078-0x0cf7 window]
>[    0.691507] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
>[    0.691524] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff
>window]
>[    0.691547] pci_bus 0000:00: root bus resource [mem 0x000c0000-0x000dffff
>window]
>[    0.691570] pci_bus 0000:00: root bus resource [mem 0x000e0000-0x000fffff
>window]
>[    0.691593] pci_bus 0000:00: root bus resource [mem 0x7cf00001-0x7ef00000
>window]
>[    0.691616] pci_bus 0000:00: root bus resource [mem 0x80000000-0x908ffffe
>window]
>[    0.691639] pci_bus 0000:00: root bus resource [mem 0xfed40000-0xfed40fff
>window]
>[    0.691662] pci_bus 0000:00: root bus resource [bus 00-ff]
>[    0.691691] pci 0000:00:00.0: [8086:0f00] type 00 class 0x060000
>[    0.691952] pci 0000:00:02.0: [8086:0f31] type 00 class 0x030000
>[    0.691971] pci 0000:00:02.0: reg 0x10: [mem 0x90000000-0x903fffff]
>[    0.691987] pci 0000:00:02.0: reg 0x18: [mem 0x80000000-0x8fffffff pref]
>[    0.692002] pci 0000:00:02.0: reg 0x20: [io  0x1000-0x1007]
>[    0.692281] pci 0000:00:14.0: [8086:0f35] type 00 class 0x0c0330
>[    0.692306] pci 0000:00:14.0: reg 0x10: [mem 0x90800000-0x9080ffff 64bit]
>[    0.692384] pci 0000:00:14.0: PME# supported from D3hot D3cold
>[    0.692624] pci 0000:00:1a.0: [8086:0f18] type 00 class 0x108000
>[    0.692649] pci 0000:00:1a.0: reg 0x10: [mem 0x90700000-0x907fffff]
>[    0.692664] pci 0000:00:1a.0: reg 0x14: [mem 0x90600000-0x906fffff]
>[    0.692763] pci 0000:00:1a.0: PME# supported from D0 D3hot
>[    0.693002] pci 0000:00:1f.0: [8086:0f1c] type 00 class 0x060100
>[    0.693296] pci_bus 0000:00: on NUMA node 0
>[    0.694031] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.694241] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.694449] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.694657] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.694864] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.695071] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.695278] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.695488] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 10 11 12 14 15)
>*0, disabled.
>[    0.712648] vgaarb: setting as boot device: PCI:0000:00:02.0
>[    0.712667] vgaarb: device added:
>PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
>[    0.712690] vgaarb: loaded
>[    0.712702] vgaarb: bridge control possible 0000:00:02.0
>[    0.849299] random: fast init done
>[    0.952724] i2c_designware 80860F41:04: I2C bus managed by PUNIT
>[    0.952797] EDAC MC: Ver: 3.0.0
>[    0.953037] Registered efivars operations
>[    0.958633] wmi: Mapper loaded
>[    0.958755] PCI: Using ACPI for IRQ routing
>[    0.958771] PCI: pci_cache_line_size set to 64 bytes
>[    0.958795] Expanded resource reserved due to conflict with PCI Bus 0000:00
>[    0.958812] e820: reserve RAM buffer [mem 0x0008f000-0x0008ffff]
>[    0.958816] e820: reserve RAM buffer [mem 0x0009e000-0x0009ffff]
>[    0.958819] e820: reserve RAM buffer [mem 0x7b8d2000-0x7bffffff]
>[    0.958822] e820: reserve RAM buffer [mem 0x7cc00000-0x7fffffff]
>[    0.959229] ------------[ cut here ]------------
>[    0.959251] WARNING: CPU: 0 PID: 1 at net/wireless/reg.c:516
>regulatory_init+0x87/0x108
>[    0.959272] db.txt is empty, you should update it...
>[    0.959278] Modules linked in:
>[    0.959302] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G     U         
>4.9.0-x205ta-pb-nf-00332-g5fd7444 #11
>[    0.959323] Hardware name: ASUSTeK COMPUTER INC. X205TA/X205TA, BIOS
>X205TA.212 09/04/2015
>[    0.959345]  ef4a9efc 861eaa06 ef4a9ee0 00000000 86037476 00000009 00000204
>ef6c8600
>[    0.959377]  000000eb ef4a9f28 ffffffff 860374c2 00000009 00000000 ef4a9ee0
>8666b3df
>[    0.959408]  ef4a9efc 80e1ba2b 86715952 8666af04 00000204 8666b3df 00000000
>00000000
>[    0.959438] Call Trace:
>[    0.959457]  [<861eaa06>] ? dump_stack+0x44/0x57
>[    0.959473]  [<86037476>] ? __warn+0xbe/0xd5
>[    0.959488]  [<860374c2>] ? warn_slowpath_fmt+0x35/0x4f
>[    0.959504]  [<86715952>] ? regulatory_init+0x87/0x108
>[    0.959520]  [<8671586e>] ? cfg80211_init+0x55/0xb2
>[    0.959535]  [<86715819>] ? packet_init+0x35/0x35
>[    0.959550]  [<860004a1>] ? do_one_initcall+0x88/0x117
>[    0.959566]  [<866e2500>] ? initcall_blacklist+0x77/0x80
>[    0.959583]  [<86049c08>] ? parse_args+0x1fb/0x321
>[    0.959599]  [<866e2c14>] ? kernel_init_freeable+0x11f/0x198
>[    0.959615]  [<864c0fcd>] ? rest_init+0x5a/0x5a
>[    0.959630]  [<864c0fd2>] ? kernel_init+0x5/0xcc
>[    0.959645]  [<864c4783>] ? ret_from_fork+0x1b/0x28
>[    0.959662] ---[ end trace f10b13f3f63a610f ]---
>[    0.959971] clocksource: Switched to clocksource refined-jiffies
>[    0.960254] pnp: PnP ACPI init
>[    0.960385] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
>[    0.960763] system 00:01: [io  0x0680-0x069f] has been reserved
>[    0.960782] system 00:01: [io  0x0400-0x047f] has been reserved
>[    0.960799] system 00:01: [io  0x0500-0x05fe] has been reserved
>[    0.960815] system 00:01: [io  0x0600-0x061f] has been reserved
>[    0.960832] system 00:01: [io  0x164e-0x164f] has been reserved
>[    0.960852] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
>[    0.961125] pnp 00:02: Plug and Play ACPI device, IDs PNP0501 (active)
>[    0.962589] system 00:03: [io  0x0240-0x0259] has been reserved
>[    0.962612] system 00:03: Plug and Play ACPI device, IDs PNP0c02 (active)
>[    0.971775] pnp: PnP ACPI: found 4 devices
>[    0.976634] pci_bus 0000:00: resource 4 [io  0x0070-0x0077]
>[    0.976640] pci_bus 0000:00: resource 5 [io  0x0000-0x006f window]
>[    0.976644] pci_bus 0000:00: resource 6 [io  0x0078-0x0cf7 window]
>[    0.976649] pci_bus 0000:00: resource 7 [io  0x0d00-0xffff window]
>[    0.976654] pci_bus 0000:00: resource 8 [mem 0x000a0000-0x000bffff window]
>[    0.976658] pci_bus 0000:00: resource 9 [mem 0x000c0000-0x000dffff window]
>[    0.976662] pci_bus 0000:00: resource 10 [mem 0x000e0000-0x000fffff window]
>[    0.976667] pci_bus 0000:00: resource 11 [mem 0x7cf00001-0x7ef00000 window]
>[    0.976671] pci_bus 0000:00: resource 12 [mem 0x80000000-0x908ffffe window]
>[    0.976675] pci_bus 0000:00: resource 13 [mem 0xfed40000-0xfed40fff window]
>[    0.976859] NET: Registered protocol family 2
>[    0.977226] TCP established hash table entries: 16384 (order: 4, 65536
>bytes)
>[    0.977310] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
>[    0.977436] TCP: Hash tables configured (established 16384 bind 16384)
>[    0.977482] UDP hash table entries: 1024 (order: 3, 32768 bytes)
>[    0.977519] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
>[    0.977611] NET: Registered protocol family 1
>[    0.977655] pci 0000:00:02.0: Video device with shadowed ROM at [mem
>0x000c0000-0x000dffff]
>[    0.978051] PCI: CLS 0 bytes, default 64
>[    0.978255] Trying to unpack rootfs image as initramfs...
>[    1.238653] Freeing initrd memory: 5516K (af52a000 - afa8d000)
>[    1.239532] simple-framebuffer simple-framebuffer.0: framebuffer at
>0x80000000, 0x1d5000 bytes, mapped to 0xf5600000
>[    1.239561] simple-framebuffer simple-framebuffer.0: format=a8r8g8b8,
>mode=800x600x32, linelength=3200
>[    1.247450] Console: switching to colour frame buffer device 100x37
>[    1.255228] simple-framebuffer simple-framebuffer.0: fb0: simplefb
>registered!
>[    1.256236] futex hash table entries: 1024 (order: 4, 65536 bytes)
>[    1.256896] workingset: timestamp_bits=14 max_order=19 bucket_order=5
>[    1.261304] squashfs: version 4.0 (2009/01/31) Phillip Lougher
>[    1.261723] fuse init (API version 7.26)
>[    1.264744] NET: Registered protocol family 38
>[    1.264941] Block layer SCSI generic (bsg) driver version 0.4 loaded (major
>252)
>[    1.265185] io scheduler noop registered
>[    1.265290] io scheduler deadline registered (default)
>[    1.265814] intel_idle: MWAIT substates: 0x33000020
>[    1.265817] intel_idle: v0.4.1 model 0x37
>[    1.266272] intel_idle: lapic_timer_reliable_states 0xffffffff
>[    1.276763] ACPI: AC Adapter [ADP1] (off-line)
>[    1.277123] input: Lid Switch as
>/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input0
>[    1.277363] ACPI: Lid Switch [LID]
>[    1.281615] input: Power Button as
>/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input1
>[    1.285904] ACPI: Power Button [PWRB]
>[    1.290268] input: Sleep Button as
>/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input2
>[    1.294797] ACPI: Sleep Button [SLPB]
>[    1.304286] [Firmware Bug]: No valid trip found
>[    1.308992] GHES: HEST is not enabled!
>[    1.313838] Linux agpgart interface v0.103
>[    1.318790] [drm] Initialized
>[    1.324608] [drm] Memory usable by graphics device = 2048M
>[    1.329348] checking generic (80000000 1d5000) vs hw (80000000 10000000)
>[    1.329351] fb: switching to inteldrmfb from simple
>[    1.334086] Console: switching to colour dummy device 80x25
>[    1.334303] [drm] Replacing VGA console driver
>[    1.335406] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
>[    1.335422] [drm] Driver supports precise vblank timestamp query.
>[    1.336183] vgaarb: device changed decodes:
>PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
>[    1.342927] ACPI: Battery Slot [BATC] (battery present)
>[    1.352015] ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
>[    1.352713] input: Video Bus as
>/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input3
>[    1.352809] [drm] Initialized i915 1.6.0 20160919 for 0000:00:02.0 on minor
>0
>[    1.358435] fbcon: inteldrmfb (fb0) is primary device
>[    1.362174] brd: module loaded
>[    1.369338] loop: module loaded
>[    1.374174] nbd: registered device at major 43
>[    1.380210] mei_txe 0000:00:1a.0: can't derive routing for PCI INT A
>[    1.380213] mei_txe 0000:00:1a.0: PCI INT A: not connected
>[    1.385181] i8042: PNP: No PS/2 controller found. Probing ports directly.
>[    2.428700] i8042: No controller found
>[    2.428779] clocksource: tsc: mask: 0xffffffffffffffff max_cycles:
>0x133626f6b26, max_idle_ns: 440795214178 ns
>[    2.429311] clocksource: Switched to clocksource tsc
>[    2.429597] mousedev: PS/2 mouse device common for all mice
>[    2.431170] ACPI Warning: Could not enable fixed event - RealTimeClock (4)
>(20160831/evxface-654)
>[    2.431736] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
>[    2.431778] rtc_cmos 00:00: alarms up to one day, 242 bytes nvram
>[    2.431796] i2c /dev entries driver
>[    2.435537] intel_pstate: Intel P-state driver initializing
>[    2.436239] sdhci: Secure Digital Host Controller Interface driver
>[    2.436242] sdhci: Copyright(c) Pierre Ossman
>[    2.442587] mmc0: SDHCI controller on ACPI [INT33BB:00] using ADMA
>[    2.476376] mmc1: SDHCI controller on ACPI [80860F14:00] using ADMA
>[    2.486961] mmc2: SDHCI controller on ACPI [PNP0FFF:00] using ADMA
>[    2.487783] EFI Variables Facility v0.08 2004-May-17
>[    2.495559] hidraw: raw HID events driver (C) Jiri Kosina
>[    2.528340] asus 0018:0B05:8585.0001: Fixing up Asus notebook report
>descriptor
>[    2.531143] i2c_hid i2c-PDEC3393:00: error in i2c_hid_init_report size:7 /
>ret_size:0
>[    2.537991] i2c_hid i2c-PDEC3393:00: error in i2c_hid_init_report size:19 /
>ret_size:0
>[    2.538904] input: PDEC3393:00 0B05:8585 as
>/devices/platform/80860F41:00/i2c-0/i2c-PDEC3393:00/0018:0B05:8585.0001/input/input4
>[    2.541176] asus 0018:0B05:8585.0001: input,hidraw0: I2C HID v1.00 Keyboard
>[PDEC3393:00 0B05:8585] on i2c-PDEC3393:00
>[    2.605038] Console: switching to colour frame buffer device 170x48
>[    2.659769] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
>[    2.678186] input: Elan Touchpad as
>/devices/platform/80860F41:03/i2c-3/i2c-ELAN0100:00/input/input5
>[    2.695389] intel_rapl: Found RAPL domain package
>[    2.707470] mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
>[    2.711865] mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
>[    2.718042] mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
>[    2.724562] mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
>[    2.731755] intel_rapl: Found RAPL domain core
>[    2.736818] NET: Registered protocol family 17
>[    2.741788] microcode: sig=0x30678, pf=0x2, revision=0x832
>[    2.758079] microcode: Microcode Update Driver: v2.01
><tigran@aivazian.fsnet.co.uk>, Peter Oruba
>[    2.762575] Using IPI No-Shortcut mode
>[    2.790018] registered taskstats version 1
>[    2.807853] zswap: default zpool zbud not available
>[    2.813823] zswap: pool creation failed
>[    2.853895] Key type encrypted registered
>[    2.931858] i2c_designware 80860F41:04: I2C bus managed by PUNIT
>[    2.960283] mmc1: new HS200 MMC card at address 0001
>[    2.969107] mmcblk1: mmc1:0001 SDW32G 29.1 GiB
>[    2.976258] mmcblk1boot0: mmc1:0001 SDW32G partition 1 4.00 MiB
>[    2.981167] mmcblk1boot1: mmc1:0001 SDW32G partition 2 4.00 MiB
>[    2.991273] mmcblk1rpmb: mmc1:0001 SDW32G partition 3 4.00 MiB
>[    2.997005] [Firmware Bug]: No valid trip found
>[    3.002706] rtc_cmos 00:00: setting system clock to 2016-12-20 16:39:06 UTC
>(1482251946)
>[    3.008097] Freeing unused kernel memory: 472K (866e2000 - 86758000)
>[    3.012618] Write protecting the kernel text: 4892k
>[    3.013381]  mmcblk1: p1 p2 p3 p4
>[    3.021752] Write protecting the kernel read-only data: 1788k
>[    3.026624] mmc0: new ultra high speed DDR50 SDIO card at address 0001
>[    3.349559] ACPI: bus type USB registered
>[    3.354884] usbcore: registered new interface driver usbfs
>[    3.359828] usbcore: registered new interface driver hub
>[    3.364458] usbcore: registered new device driver usb
>[    3.370619] xhci_hcd 0000:00:14.0: xHCI Host Controller
>[    3.375974] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus
>number 1
>[    3.382503] xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci version 0x100
>quirks 0x00009810
>[    3.387110] xhci_hcd 0000:00:14.0: cache line size of 64 is not supported
>[    3.387710] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
>[    3.393572] usb usb1: New USB device strings: Mfr=3, Product=2,
>SerialNumber=1
>[    3.399945] usb usb1: Product: xHCI Host Controller
>[    3.406238] usb usb1: Manufacturer: Linux 4.9.0-x205ta-pb-nf-00332-g5fd7444
>xhci-hcd
>[    3.412614] usb usb1: SerialNumber: 0000:00:14.0
>[    3.418077] hub 1-0:1.0: USB hub found
>[    3.422655] hub 1-0:1.0: 6 ports detected
>[    3.432153] xhci_hcd 0000:00:14.0: xHCI Host Controller
>[    3.436344] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus
>number 2
>[    3.441384] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
>[    3.445375] usb usb2: New USB device strings: Mfr=3, Product=2,
>SerialNumber=1
>[    3.449440] usb usb2: Product: xHCI Host Controller
>[    3.453389] usb usb2: Manufacturer: Linux 4.9.0-x205ta-pb-nf-00332-g5fd7444
>xhci-hcd
>[    3.457591] usb usb2: SerialNumber: 0000:00:14.0
>[    3.462252] hub 2-0:1.0: USB hub found
>[    3.466569] hub 2-0:1.0: 1 port detected
>[    3.803465] EXT4-fs (mmcblk1p3): mounted filesystem with ordered data mode.
>Opts: (null)
>[    3.819402] usb 1-1: new high-speed USB device number 2 using xhci_hcd
>[    4.027990] usb 1-1: New USB device found, idVendor=0bda, idProduct=57b5
>[    4.043058] usb 1-1: New USB device strings: Mfr=3, Product=1,
>SerialNumber=2
>[    4.049989] usb 1-1: Product: USB Camera
>[    4.054686] usb 1-1: Manufacturer: 04081-00092400F1OM74
>[    4.059336] usb 1-1: SerialNumber: 200901010001
>[    4.209872] usb 1-2: new high-speed USB device number 3 using xhci_hcd
>[    4.324780] NET: Registered protocol family 10
>[    4.352856] ip_tables: (C) 2000-2006 Netfilter Core Team
>[    4.412583] usb 1-2: New USB device found, idVendor=05e3, idProduct=0610
>[    4.427221] usb 1-2: New USB device strings: Mfr=0, Product=1,
>SerialNumber=0
>[    4.427230] usb 1-2: Product: USB2.0 Hub
>[    4.433798] hub 1-2:1.0: USB hub found
>[    4.436681] hub 1-2:1.0: 4 ports detected
>[    4.449356] usb: port power management may be unreliable
>[    4.483711] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT
>+SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS
>+ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
>[    4.493189] systemd[1]: Detected architecture x86.
>[    4.565052] systemd[1]: Set hostname to <at>.
>[    5.073742] systemd[1]: docker.socket: Cannot add dependency job, ignoring:
>Unit docker.socket is masked.
>[    5.082867] systemd[1]: ModemManager.service: Cannot add dependency job,
>ignoring: Unit ModemManager.service is masked.
>[    5.088221] systemd[1]: accounts-daemon.service: Cannot add dependency job,
>ignoring: Unit accounts-daemon.service is masked.
>[    5.094246] systemd[1]: Listening on Journal Socket (/dev/log).
>[    5.105011] systemd[1]: Listening on LVM2 metadata daemon socket.
>[    5.115651] systemd[1]: Listening on udev Kernel Socket.
>[    5.126287] systemd[1]: Listening on LVM2 poll daemon socket.
>[    5.398609] EXT4-fs (mmcblk1p3): re-mounted. Opts:
>discard,errors=remount-ro
>[    5.601065] systemd-journald[279]: Received request to flush runtime
>journal from PID 1
>[    5.890652] intel_sst_acpi 80860F28:00: Detected Baytrail-CR platform
>[    5.895021] intel_sst_acpi 80860F28:00: LPE base: 0x90a00000 size:0x200000
>[    5.898647] intel_sst_acpi 80860F28:00: IRAM base: 0x90ac0000
>[    5.902278] intel_sst_acpi 80860F28:00: DRAM base: 0x90b00000
>[    5.906404] intel_sst_acpi 80860F28:00: SHIM base: 0x90b40000
>[    5.910456] intel_sst_acpi 80860F28:00: Mailbox base: 0x90b44000
>[    5.914522] intel_sst_acpi 80860F28:00: DDR base: 0x20000000
>[    5.919155] intel_sst_acpi 80860F28:00: Got drv data max stream 25
>[    6.245856] EXT4-fs (mmcblk1p4): mounted filesystem with ordered data mode.
>Opts: discard,errors=remount-ro
>[    6.259854] mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
>[    6.264089] mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
>[    6.265627] mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
>[    6.269647] mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
>[    6.294060] cht-bsw-rt5645 cht-bsw-rt5645: BIOS Routing: AIF2 connected
>[    6.294063] cht-bsw-rt5645 cht-bsw-rt5645: quirk SSP0_AIF2 enabled
>[    6.300016] cht-bsw-rt5645 cht-bsw-rt5645: snd-soc-dummy-dai <->
>media-cpu-dai mapping ok
>[    6.300076] cht-bsw-rt5645 cht-bsw-rt5645: snd-soc-dummy-dai <->
>deepbuffer-cpu-dai mapping ok
>[    6.300121] compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping
>ok
>[    6.301220] cht-bsw-rt5645 cht-bsw-rt5645: rt5645-aif2 <-> ssp0-port
>mapping ok
>[    6.304577] input: chtrt5645 Headset as
>/devices/platform/80860F28:00/cht-bsw-rt5645/sound/card0/input6
>[    6.479531] usbcore: registered new interface driver brcmfmac
>[    6.667451] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Jun 17
>2014 11:48:43 version 6.10.190.49 (r485840) FWID 01-8744bcd2
>[    6.707154] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30
>0x30)
>[   16.142586] random: crng init done
Comment 103 Pierre Bossart 2016-12-20 17:03:06 UTC
(In reply to KBT from comment #101)
> Created attachment 248181 [details]
> dmesg.txt
> 
> I tried the tip of the topic branch
> 
> i still get: Audio Port: ASoC: no backend DAIs enabled for Audio Port
> 
> even after running 5645_mixers.sh
> 
> after playing around a bit toggling DAC L2 Mux ( IF1 DAC)
>  gave some noise (strangely not the audio i wanted to play though, a lot
> deeper)
> 
> dmesg.txt attached

there is no error message in the dmesg?
Comment 104 Pierre Bossart 2016-12-20 17:06:12 UTC
I forgot to mention the UCM files I used on Asus T100HA are here: https://github.com/plbossart/UCM
take the chtrt5645 directory and copy it in /usr/share/alsa/ucm if you are testing with PulseAudio
Comment 105 KBT 2016-12-20 17:07:04 UTC
this->
[  536.770370] Base clock rate 0 is too low
[  536.770399] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[  536.770418] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22

appeared after a while:

[   64.515955] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
...
[   64.954676]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[  102.021218] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
[  132.970615] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
[  167.518230] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
[  486.545703] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
[  536.770370] Base clock rate 0 is too low
[  536.770399] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[  536.770418] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22

last try to play sound:

[ 1654.857151] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01

(noisy, stuttering, but intelligible)



[2016-12-20 18:03] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #103 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
>---
>(In reply to KBT from comment #101)
>> Created attachment 248181 [details]
>> dmesg.txt
>>
>> I tried the tip of the topic branch
>>
>> i still get: Audio Port: ASoC: no backend DAIs enabled for Audio Port
>>
>> even after running 5645_mixers.sh
>>
>> after playing around a bit toggling DAC L2 Mux ( IF1 DAC)
>>  gave some noise (strangely not the audio i wanted to play though, a lot
>> deeper)
>>
>> dmesg.txt attached
>
>there is no error message in the dmesg?
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 106 KBT 2016-12-20 17:09:08 UTC
I used mplayer -ao alsa, my debian insists on starting pulseaudio with the session though

[2016-12-20 18:06] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #104 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
>---
>I forgot to mention the UCM files I used on Asus T100HA are here:
>https://github.com/plbossart/UCM
>take the chtrt5645 directory and copy it in /usr/share/alsa/ucm if you are
>testing with PulseAudio
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 107 KBT 2016-12-20 17:13:46 UTC
Using the ucm, i still get 

[   31.273654] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
[   31.274083]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
[   31.274471]  Audio Port: ASoC: no backend DAIs enabled for Audio Port

routing the audio through pulseaudio doesn't seem to work
mplayer reports the audiodevice stuck for the first few seconds

if i just run the 5645_mixers.sh attached to this thread and kill pulseaudio
using alsamixer i get some noise out of alsamixer -ao alsa


[2016-12-20 18:09] Dr. Christian Bahls - qb352.de <kbt@qb352.de> wrote:
>I used mplayer -ao alsa, my debian insists on starting pulseaudio with the
>session though
>
>[2016-12-20 18:06] bugzilla-daemon@bugzilla.kernel.org
><bugzilla-daemon@bugzilla.kernel.org> wrote:
>>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>>
>>--- Comment #104 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
>>---
>>I forgot to mention the UCM files I used on Asus T100HA are here:
>>https://github.com/plbossart/UCM
>>take the chtrt5645 directory and copy it in /usr/share/alsa/ucm if you are
>>testing with PulseAudio
>>
>>-- 
>>You are receiving this mail because:
>>You are on the CC list for the bug.
Comment 108 KBT 2016-12-20 17:14:33 UTC
of course "mplayer -ao alsa"

[2016-12-20 18:13] Dr. Christian Bahls - qb352.de <kbt@qb352.de> wrote:
>Using the ucm, i still get
>
>[   31.273654] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
>[   31.274083]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
>[   31.274471]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
>
>routing the audio through pulseaudio doesn't seem to work
>mplayer reports the audiodevice stuck for the first few seconds
>
>if i just run the 5645_mixers.sh attached to this thread and kill pulseaudio
>using alsamixer i get some noise out of alsamixer -ao alsa
>
>
>[2016-12-20 18:09] Dr. Christian Bahls - qb352.de <kbt@qb352.de> wrote:
>>I used mplayer -ao alsa, my debian insists on starting pulseaudio with the
>>session though
>>
>>[2016-12-20 18:06] bugzilla-daemon@bugzilla.kernel.org
>><bugzilla-daemon@bugzilla.kernel.org> wrote:
>>>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>>>
>>>--- Comment #104 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
>>>---
>>>I forgot to mention the UCM files I used on Asus T100HA are here:
>>>https://github.com/plbossart/UCM
>>>take the chtrt5645 directory and copy it in /usr/share/alsa/ucm if you are
>>>testing with PulseAudio
>>>
>>>-- 
>>>You are receiving this mail because:
>>>You are on the CC list for the bug.
Comment 109 Pierre Bossart 2016-12-20 17:21:36 UTC
(In reply to KBT from comment #107)
> Using the ucm, i still get 
> 
> [   31.273654] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> [   31.274083]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
> [   31.274471]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
> 
> routing the audio through pulseaudio doesn't seem to work
> mplayer reports the audiodevice stuck for the first few seconds

well it would help if you can help root-cause with the log from pulseaudio -vvv, I have no idea why this happens for you and not for me.
Comment 110 Pierre Bossart 2016-12-20 17:22:27 UTC
(In reply to KBT from comment #105)
> this->
> [  536.770370] Base clock rate 0 is too low
> [  536.770399] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
> [  536.770418] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed:
> -22
> 
> appeared after a while:
> 
> [   64.515955] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> ...
> [   64.954676]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
> [  102.021218] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> [  132.970615] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> [  167.518230] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> [  486.545703] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> [  536.770370] Base clock rate 0 is too low
> [  536.770399] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
> [  536.770418] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed:
> -22

ok, it think I know where this comes from, can you help double-check by adding a printk before this statement in sound/soc/intel/boards/cht_bsw_rt5645.c

		ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_RCCLK,
					0, SND_SOC_CLOCK_IN);

This code existed in the machine driver from the beginning doesn't make much sense to me but it was harmless so far, we may have to set a different value that is less silly than 0Hz... it should be at least 3072kHz to make those DMIC errors go away so while you are at it if you can also change the code to this

	ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_RCCLK,
					3072000, SND_SOC_CLOCK_IN);
Comment 111 KBT 2016-12-20 18:11:52 UTC
Created attachment 248191 [details]
dmesg.txt

tried both suggestions
pulseaudio log and new dmesg attached

haven't seen the "setting to 0hz" yet

> [2016-12-20 18:21] bugzilla-daemon@bugzilla.kernel.org
> <bugzilla-daemon@bugzilla.kernel.org> wrote:
> > https://bugzilla.kernel.org/show_bug.cgi?id=95681
> > 
> > --- Comment #109 from Pierre Bossart <pierre-louis.bossart@linux.intel.com>
> ---
> > (In reply to KBT from comment #107)
> > > Using the ucm, i still get
> > > 
> > > [   31.273654] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01
> > > [   31.274083]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
> > > [   31.274471]  Audio Port: ASoC: no backend DAIs enabled for Audio Port
> > > 
> > > routing the audio through pulseaudio doesn't seem to work
> > > mplayer reports the audiodevice stuck for the first few seconds
> > 
> > well it would help if you can help root-cause with the log from pulseaudio
> > -vvv, I have no idea why this happens for you and not for me.
> > 
> > -- 
> > You are receiving this mail because:
> > You are on the CC list for the bug.
Comment 112 KBT 2016-12-20 18:11:53 UTC
Created attachment 248201 [details]
pulseaudio.txt
Comment 113 harryharryharry 2016-12-20 19:01:11 UTC
I also tested out the latest commit, and briefly got distorted sound in the left and right (a little softer) speaker, by setting "DAC1 L2 mux" "DAC1 L mux" "DAC1 R2 mux" "DAC1 R mux" all to "IF2 DAC" (they were set to IF1 DAC). Then the sound suddenly stopped and DMESG then showed:
[ 1886.072656] Base clock rate 0 is too low
[ 1886.072675] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[ 1886.072688] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22
[ 1907.294523] Base clock rate 0 is too low
[ 1907.294541] rt5645 i2c-10EC5648:00: Failed to set DMIC clock
[ 1907.294554] rt5645 i2c-10EC5648:00: ASoC: PRE_PMU: DMIC CLK event failed: -22

and I couldnt get sound back. I tried again after a reboot but all I got was a loud beep, and the speakers became very warm so I rebooted immediately...

This is the my dmesg (no playback, just a clean boot):
http://sprunge.us/aTDQ
Comment 114 harryharryharry 2016-12-20 19:47:04 UTC
addition:
I am consistently able to get (distorted) sound on the left speaker by running the following command on boot:
amixer -Dhw:chtrt5645 cset name="Speaker Playback Volume" 40%; amixer -Dhw:chtrt5645 cset name="DAC L2 Mux" "IF2 DAC"

The same trick for the right speaker doesnt work though.
Comment 115 Pierre Bossart 2016-12-20 21:03:12 UTC
have you tried the other settings provided by Bard @ Realtek:

alsa_amixer cset name="DAC L2 Mux" "IF2 DAC"
alsa_amixer cset name="DAC R2 Mux" "IF2 DAC"
alsa_amixer cset name="Mono DAC MIXL DAC L2 Switch" 1
alsa_amixer cset name="Mono DAC MIXR DAC R2 Switch" 1
alsa_amixer cset name="SPK MIXL DAC L2 Switch" 1
alsa_amixer cset name="SPK MIXR DAC R2 Switch" 1
alsa_amixer cset name="SPKVOL L Switch" 1
alsa_amixer cset name="SPKVOL R Switch" 1
alsa_amixer cset name="SPOL MIX SPKVOL L Switch" 1
alsa_amixer cset name="SPOR MIX SPKVOL R Switch" 1
Comment 116 harryharryharry 2016-12-20 21:15:13 UTC
those commands gave me errors (command alsa_amixer not found), but when I do:
"amixer -Dhw:chtrt5645" instead of "alsa_amixer" 
I get the same result as before (left speaker; distorted sound)
Comment 117 Pierre Bossart 2016-12-22 00:34:32 UTC
I think I completely screwed-up with the UCM files, somehow what I committed isn't what I worked on. If you can try again with the update at https://github.com/plbossart/UCM/commits/master
it'd be nice. As usual use a lower volume for starters, the example uses no attenuation and might be too loud in some cases.
Comment 118 harryharryharry 2016-12-22 17:57:04 UTC
With the new HiFi.conf I need to unmute "Speaker Channel" and "Ext Spk" but I still only get distorted sound and only on the left speaker.
Comment 119 Pierre Bossart 2016-12-23 20:07:13 UTC
The UCM file contains those statements already, not sure why you need to unmute them?

cset "name='Ext Spk Switch' on"
cset "name='Speaker Channel Switch' on"

Are you really selecting the speaker output with the system UI and actually using UCM?
Comment 120 harryharryharry 2016-12-23 21:24:28 UTC
I noticed there are more instances of those (or similar) commands in HiFi.conf.

I think I've narrowed it down to line 241 and 242 of HiFi.conf
If I set those lines to "on" instead of "off", "Ext Spk Switch" and "Speaker Channel Switch" are no longer muted at boot.
Comment 121 Pierre Bossart 2016-12-27 00:58:55 UTC
(In reply to harryharryharry from comment #120)
> I noticed there are more instances of those (or similar) commands in
> HiFi.conf.
> 
> I think I've narrowed it down to line 241 and 242 of HiFi.conf
> If I set those lines to "on" instead of "off", "Ext Spk Switch" and "Speaker
> Channel Switch" are no longer muted at boot.

The purpose of separate UCM devices for speaker and headset is precisely to select one or the other. enabling all devices at all times is not the intent. I added these two lines on purpose to make sure the previous asound.state would not get in the way. 
If you only want to use the speaker output, select it with the UI and pulseaudio will remember it moving forward.
Comment 122 harryharryharry 2016-12-27 07:44:40 UTC
Sorry for the confusion, I didn't realize the headphones were selected by default.

Is there any way for me to experiment with getting sound also to the right (not only left) speaker, and reducing noise ? The audio that is being played is very noisy and hard to hear. I've tried several settings in alsamixer, but there are so many of them and it seems the majority of them do nothing.

Or is there some feedback I can supply so you can see why the output is so noisy and only on one speaker ?
Comment 123 Pierre Bossart 2016-12-27 16:32:52 UTC
the settings enable audio on both left and right, they work fine on the T100HA. I wonder if this is an isolated case (mechanical problem?) or a more general one due to hardware differences. I asked for the schematics but still don't have them so it's really a guess.

Also are you actually sure you have two speakers? when I worked on the T100TAF I had to add a quirk to route right to left since there is a single speaker. A lot of those baytrail tablets went back to mono speaker to reduce cost.
Comment 124 harryharryharry 2016-12-27 16:59:24 UTC
I (still) have windows installed side-by-side, and both speakers work under windows. 

The first time I was able to get any sound in Linux (20dec) I briefly got a very faint (much more faint then the left) and distored sound from the right speaker while playing with alsamixer settings, but I havent been able to reproduce sound out of the right speaker since.
The x205ta has two speakers next to anti slip feet:
https://www.asus.com/websites/global/products/tLVjLGQSRF5PGYqG/img/d/speakers-main.png

I should add that about half of the time after I boot there is no soundcard present (when doing aplay -l), and I need to reboot if I want to play around with alsamixer. So there's still something iffy about soundcard initialization... If you want I can supply a dmesg when the soundcard is NOT initialized properly (aplay -l reports no soundcards).
Comment 125 Pierre Bossart 2016-12-27 21:32:25 UTC
well yes, if the soundcard initialization is still not reliable, we need to fix this first. please attach the dmesg log when the card is initialized and when it's not.
ACPI is in general fairly reliable, it's the first time I hear that things would work inconsistently.
Comment 126 Marco Bo 2016-12-29 18:40:01 UTC
I compiled kernel:
https://github.com/plbossart/sound/commits/experimental/codecs
branch: experimental/codecs

and get the right ucm file, by copying  https://github.com/plbossart/UCM/chtrt5645 into /usr/share/alsa/ucm/

and I get sound, but distorted. Using the Ubuntu->systemsettings->sound->test Sound utility, I get "Front Left" coming from the right speaker at a very low volume, and "front right" coming from both speakers at a louder volume.
Comment 127 Marco Bo 2016-12-29 18:40:59 UTC
Created attachment 249171 [details]
dmesg with distorted sound
Comment 128 harryharryharry 2016-12-29 20:07:20 UTC
This is the dmesg from one of my boots where the soundcard is not properly initialized:
http://sprunge.us/GVFI
Comment 129 Bard Liao 2016-12-30 01:41:42 UTC
(In reply to Marco Bo from comment #127)
> Created attachment 249171 [details]
> dmesg with distorted sound

Can you dump codec registers while speaker is playing?
cat /sys/kernel/debug/regmap/<bus name>/registers

Thanks.
Comment 130 Marco Bo 2016-12-30 08:04:15 UTC
Created attachment 249251 [details]
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers
Comment 131 Marco Bo 2016-12-30 08:04:45 UTC
Created attachment 249261 [details]
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00-nocache/registers
Comment 132 harryharryharry 2016-12-30 17:27:32 UTC
Created attachment 249341 [details]
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers

cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers during playback

when aplay -l doesnt list any devices. Mplayer displays the following message during playback:
Starting playback...
A:   0.1 (00.0) of 248.0 (04:08.0) ??,?%                                                                                                                                 
Audio device got stuck!
A:   0.1 (00.0) of 248.0 (04:08.0) ??,?%                                                                                                                                 
Audio device got stuck!
A:   0.1 (00.0) of 248.0 (04:08.0) ??,?%
Comment 133 harryharryharry 2016-12-30 17:28:24 UTC
Created attachment 249351 [details]
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers during playback

cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers during playback

when aplay -l doesnt list any devices. Mplayer displays the following message during playback:
Starting playback...
A:   0.1 (00.0) of 248.0 (04:08.0) ??,?%                                                                                                                                 
Audio device got stuck!
A:   0.1 (00.0) of 248.0 (04:08.0) ??,?%                                                                                                                                 
Audio device got stuck!
A:   0.1 (00.0) of 248.0 (04:08.0) ??,?%
Comment 134 harryharryharry 2016-12-30 17:34:11 UTC
I see I just made an error in the naming of the attachment I uploaded last: 
 cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers during playback 
should be 
cat /sys/kernel/debug/regmap/i2c-10EC5648\:00-nocache/registers
Comment 135 Pierre Bossart 2017-01-02 16:19:47 UTC
(In reply to harryharryharry from comment #128)
> This is the dmesg from one of my boots where the soundcard is not properly
> initialized:
> http://sprunge.us/GVFI

There are tons of messages in there related to gpios and pinctrl that I've never seen. I don't know how you came across all this. Did you enable any special features here? All you really need in PINCTRL_BAYTRAIL.
Comment 136 Pellegrino Prevete 2017-01-02 16:39:05 UTC
@Pierre Bossart: i2c (so maybe gpios?) has some problems with this device. For example see https://bugzilla.kernel.org/show_bug.cgi?id=189681
Comment 137 harryharryharry 2017-01-02 20:43:51 UTC
@Pierre Bossart
Yes, I had the CONFIG_PINCTRL's of SUNRISEPOINT, BROXTON and CHERRYVIEW compiled as well.

This is a dmesg when the soundcard is not initialized with a kernel with only CONFIG_PINCTRL_BAYTRAIL compiled:
http://sprunge.us/YLCE

I may (very probably) have some unnecessary CONFIG_SND modules built in as well (but I don't know which ones are necessary):
output of $ cat .config|grep SND|grep -v "not set":
http://sprunge.us/ZfXU
Could that be the cause, or should the soundcard be initialized regardless of those unnecessary modules ?
Comment 138 Bard Liao 2017-01-03 02:03:30 UTC
(In reply to Marco Bo from comment #131)
> Created attachment 249261 [details]
> cat /sys/kernel/debug/regmap/i2c-10EC5648\:00-nocache/registers

We were on holiday in the past few days and will look into the register dump today.
Comment 139 Bard Liao 2017-01-03 07:04:17 UTC
(In reply to harryharryharry from comment #134)
> I see I just made an error in the naming of the attachment I uploaded last: 
>  cat /sys/kernel/debug/regmap/i2c-10EC5648\:00/registers during playback 
> should be 
> cat /sys/kernel/debug/regmap/i2c-10EC5648\:00-nocache/registers

It seems you didn't set codec mixers. Can you check it?
Comment 140 Bard Liao 2017-01-03 07:17:28 UTC
(In reply to Marco Bo from comment #131)
> Created attachment 249261 [details]
> cat /sys/kernel/debug/regmap/i2c-10EC5648\:00-nocache/registers

Regarding the distortion issue, please do the following.
1. The clk_src parameter should be RT5645_CLK_SEL_I2S2_ASRC when  rt5645_sel_asrc_clk_src is called by machine driver since I2S2 is used.
2. Set "SPK MIXL DAC L1 Switch" and "SPK MIXR DAC R1 Switch" off before playback.

Regarding the "Front Left" coming from the right speaker at a very low volume, and "front right" coming from both speakers at a louder volume issue, it looks good from codec side.

@Pierre Bossart:
Is there any sound effect on SoC side?
Comment 141 harryharryharry 2017-01-03 07:26:24 UTC
If I understand you correctly those are the mixer settings that can be accessed via alsamixer ? 
I think I must have misunderstood: I uploaded the register dumps after a boot when the soundcard isn't initialized properly (and those codec mixer settings arent available).

I'll upload the codec register dumps from when the sound IS working now.
Comment 142 harryharryharry 2017-01-03 07:36:03 UTC
Created attachment 249831 [details]
codec register dumps when playing sound
Comment 143 harryharryharry 2017-01-03 07:36:24 UTC
Created attachment 249841 [details]
codec register-nocache dumps when playing sound
Comment 144 Bard Liao 2017-01-03 07:46:25 UTC
@harryharryharry:
The register dump is very similar to Marco Bo's dump except the "SPK MIXL DAC L1 Switch" and "SPK MIXR DAC R1 Switch" are off on your dump.
So, please set the clk_src parameter as RT5645_CLK_SEL_I2S2_ASRC when you call rt5645_sel_asrc_clk_src.
Comment 145 harryharryharry 2017-01-03 07:58:37 UTC
How do I set the clk_src parameter as RT5645_CLK_SEL_I2S2_ASRC when you call rt5645_sel_asrc_clk_src ? Is this also a setting in alsamixer ?
Comment 146 Bard Liao 2017-01-03 08:10:26 UTC
No, it should be in machine driver source code. I don't know the exact name of the machine driver. It should be in kernel/sound/soc/intel/ filder. Find rt5645_sel_asrc_clk_src in the file, replace RT5645_CLK_SEL_I2S1_ASRC with RT5645_CLK_SEL_I2S2_ASRC and rebuild the kernel.
Comment 147 KBT 2017-01-03 10:12:59 UTC
Would that be sound/soc/intel/boards/cht_bsw_rt5645.c ?

        /* Select clk_i2s2_asrc as ASRC clock source */
        rt5645_sel_asrc_clk_src(codec,
                                RT5645_DA_STEREO_FILTER |  
                                RT5645_DA_MONO_L_FILTER |
                                RT5645_DA_MONO_R_FILTER |
                                RT5645_AD_STEREO_FILTER,
                                RT5645_CLK_SEL_I2S2_ASRC);


[2017-01-03 09:10] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #146 from Bard Liao <bardliao@realtek.com> ---
>No, it should be in machine driver source code. I don't know the exact name of
>the machine driver. It should be in kernel/sound/soc/intel/ filder. Find
>rt5645_sel_asrc_clk_src in the file, replace RT5645_CLK_SEL_I2S1_ASRC with
>RT5645_CLK_SEL_I2S2_ASRC and rebuild the kernel.
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 148 Bard Liao 2017-01-03 10:46:52 UTC
Yes, t should be. Was it 
	rt5645_sel_asrc_clk_src(codec,
				RT5645_DA_STEREO_FILTER |
				RT5645_DA_MONO_L_FILTER |
				RT5645_DA_MONO_R_FILTER |
				RT5645_AD_STEREO_FILTER,
				RT5645_CLK_SEL_I2S1_ASRC); ?
Comment 149 KBT 2017-01-03 11:48:59 UTC
Yes. but sound still does not work

pulseaudio initially crashed but started up after i ran the 5645_mixers.sh attached to this thread.

also i now see the "would be setting to 0Hz" that i was asked by Pierre include as a debug statement.

so the following gets triggered:
                ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_RCCLK,
-                                       0, SND_SOC_CLOCK_IN);
+                                       3072000, SND_SOC_CLOCK_IN);

my local changes:

@@ -115,8 +115,9 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
                 * runtime suspended. Codec needs clock for jack detection and button
                 * press. MCLK is turned off with clock framework or ACPI.
                 */
+               dev_info(card->dev, "would be setting to 0Hz");
                ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_RCCLK,
-                                       0, SND_SOC_CLOCK_IN);
+                                       3072000, SND_SOC_CLOCK_IN);
                if (ret < 0) {
                        dev_err(card->dev, "can't set codec sysclk: %d\n", ret);
                        return ret;
@@ -265,13 +266,13 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
        struct snd_soc_dai *codec_dai = runtime->codec_dai;
        struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
 
-       /* Select clk_i2s1_asrc as ASRC clock source */
+       /* Select clk_i2s2_asrc as ASRC clock source */
        rt5645_sel_asrc_clk_src(codec,
                                RT5645_DA_STEREO_FILTER |
                                RT5645_DA_MONO_L_FILTER |
                                RT5645_DA_MONO_R_FILTER |
                                RT5645_AD_STEREO_FILTER,
-                               RT5645_CLK_SEL_I2S1_ASRC);
+                               RT5645_CLK_SEL_I2S2_ASRC);
 
        if (cht_rt5645_quirk & CHT_RT5645_SSP2_AIF2) {
                ret = snd_soc_dapm_add_routes(&card->dapm,



[2017-01-03 12:15] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #148 from Bard Liao <bardliao@realtek.com> ---
>Yes, t should be. Was it
>    rt5645_sel_asrc_clk_src(codec,
>                RT5645_DA_STEREO_FILTER |
>                RT5645_DA_MONO_L_FILTER |
>                RT5645_DA_MONO_R_FILTER |
>                RT5645_AD_STEREO_FILTER,
>                RT5645_CLK_SEL_I2S1_ASRC); ?
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 150 Pierre Bossart 2017-01-03 14:43:59 UTC
thanks Bard for the comment. We need to handle the ASRC change in a quirk dependent manner with the following patch (also pushed to my branch).

Regarding the other suggestion (Set "SPK MIXL DAC L1 Switch" and "SPK MIXR DAC R1 Switch" off before playback), is this really required? I was trying to have a single UCM file that would work for both AIF1 and AIF2 routings. is there any side effect if the two paths are enabled in UCM but with DAPM triggering one path vs. the other at run time?

There are no processing elements on the SOC side by default and the distorsion is only heard on Baytrail devices using AIF2, I have no issues with CHT using AIF1.

diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 09bb498..c0cdc9d 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -265,13 +265,24 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
        struct snd_soc_dai *codec_dai = runtime->codec_dai;
        struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
 
-       /* Select clk_i2s1_asrc as ASRC clock source */
-       rt5645_sel_asrc_clk_src(codec,
-                               RT5645_DA_STEREO_FILTER |
-                               RT5645_DA_MONO_L_FILTER |
-                               RT5645_DA_MONO_R_FILTER |
-                               RT5645_AD_STEREO_FILTER,
-                               RT5645_CLK_SEL_I2S1_ASRC);
+       if ((cht_rt5645_quirk & CHT_RT5645_SSP2_AIF2) ||
+           (cht_rt5645_quirk & CHT_RT5645_SSP0_AIF2)) {
+               /* Select clk_i2s2_asrc as ASRC clock source */
+               rt5645_sel_asrc_clk_src(codec,
+                                       RT5645_DA_STEREO_FILTER |
+                                       RT5645_DA_MONO_L_FILTER |
+                                       RT5645_DA_MONO_R_FILTER |
+                                       RT5645_AD_STEREO_FILTER,
+                                       RT5645_CLK_SEL_I2S2_ASRC);
+       } else {
+               /* Select clk_i2s1_asrc as ASRC clock source */
+               rt5645_sel_asrc_clk_src(codec,
+                                       RT5645_DA_STEREO_FILTER |
+                                       RT5645_DA_MONO_L_FILTER |
+                                       RT5645_DA_MONO_R_FILTER |
+                                       RT5645_AD_STEREO_FILTER,
+                                       RT5645_CLK_SEL_I2S1_ASRC);
+       }
Comment 151 harryharryharry 2017-01-03 19:44:25 UTC
I did a git pull from Pierre's git and recompiled the kernel. I also made sure SPK MIXL DAC L1 Switch and SPK MIXR DAC R1 Switch were off. 

There is still distortion, and the right speaker is still completely silent. The distortion sounds a little different to me however (but I might be imagining things :) )

I will upload the register dumps again (If this is not necessary with every change please let me know).
Comment 152 harryharryharry 2017-01-03 19:47:16 UTC
Created attachment 249961 [details]
register dump after: set clk_src parameter as RT5645_CLK_SEL_I2S2_ASRC
Comment 153 harryharryharry 2017-01-03 19:48:01 UTC
Created attachment 249971 [details]
register-nocache dump after: set clk_src parameter as RT5645_CLK_SEL_I2S2_ASRC
Comment 154 Bard Liao 2017-01-04 05:35:30 UTC
(In reply to Pierre Bossart from comment #150)
> Regarding the other suggestion (Set "SPK MIXL DAC L1 Switch" and "SPK MIXR
> DAC R1 Switch" off before playback), is this really required? I was trying
> to have a single UCM file that would work for both AIF1 and AIF2 routings.
> is there any side effect if the two paths are enabled in UCM but with DAPM
> triggering one path vs. the other at run time?

I think there is no side effect if we turn on both routings since we won't power up the routing which is not using.

> 
> There are no processing elements on the SOC side by default and the
> distorsion is only heard on Baytrail devices using AIF2, I have no issues
> with CHT using AIF1.
> 

Did you meet the issue that Marco Bo reported?
"I get "Front Left" coming from the right speaker at a very low volume, and "front right" coming from both speakers at a louder volume."

We didn't do swap or mix on codec's mixer. That's why I am thinking if that is done by SoC side?
Comment 155 Bard Liao 2017-01-04 07:34:09 UTC
I just got a bad news. rt5648 can't support Intel TDM format (100fs/200fs). So, I think the only way that we can get sound working on ASUS X205TA is using normal i2s format.

@Pierre Bossart
Is it possible to use normal i2s format on ASUS X205TA?
Comment 156 Pierre Bossart 2017-01-04 16:00:21 UTC
The TDM mode works fine on Asus T100HA with ALC3270.

The I2S mode is already used for X205TA since the SSP0-AIF2 link is 2ch 16 bit only (not TDM as for SSP2). See https://github.com/plbossart/sound/blob/experimental/codecs/sound/soc/intel/boards/cht_bsw_rt5645.c#L367
This I2S mode works on all other Baytrail devices with RT5640 so I guess we should be ok?
Comment 157 Pierre Bossart 2017-01-04 16:01:20 UTC
(In reply to Bard Liao from comment #154)
> (In reply to Pierre Bossart from comment #150)
> > Regarding the other suggestion (Set "SPK MIXL DAC L1 Switch" and "SPK MIXR
> > DAC R1 Switch" off before playback), is this really required? I was trying
> > to have a single UCM file that would work for both AIF1 and AIF2 routings.
> > is there any side effect if the two paths are enabled in UCM but with DAPM
> > triggering one path vs. the other at run time?
> 
> I think there is no side effect if we turn on both routings since we won't
> power up the routing which is not using.
> 
> > 
> > There are no processing elements on the SOC side by default and the
> > distorsion is only heard on Baytrail devices using AIF2, I have no issues
> > with CHT using AIF1.
> > 
> 
> Did you meet the issue that Marco Bo reported?
> "I get "Front Left" coming from the right speaker at a very low volume, and
> "front right" coming from both speakers at a louder volume."
> 
> We didn't do swap or mix on codec's mixer. That's why I am thinking if that
> is done by SoC side?

No, the same settings are used on T100HA and the right channel comes out ok.
Comment 158 Pierre Bossart 2017-01-06 22:33:44 UTC
I added a couple of tentative fixes on my branch https://github.com/plbossart/sound/commits/experimental/codecs

Bard Liao @ Realtek pointed out a problem in I2S mode which I think is corrected now. I used the AIF2 interface on T100HA and the sound is fine - same as with AIF1- , the same fix should work for X205TA for speaker playback.

There is still a problem on the Intel driver side with a polarity inversion, if they work there will be additional work and rebases on this branch. Test but don't take the code as is please :-)

As usual start with low volume when testing...
Comment 159 harryharryharry 2017-01-06 23:59:15 UTC
Yes! Result!
These fixes solve the distortion AND the muted right speaker !

I tested with higher volumes and it goes really loud (without distortion), louder than under windows. I don't know whether or not this could be detrimental to the speakers in the long run. The speakers don't sound like they are under too much stress,  but fair warning to other experimenters.

Pierre; Bard; Is there anything I can test or provide in terms of feedback/logs ?

Gr. Harry
btw: Thanks again to you both (and others) for putting in the energy and time ! This is really awesome !
Comment 160 Pierre Bossart 2017-01-07 02:00:48 UTC
Good to hear. That's the kind of thing that make me get up in the morning.
Next step is to fix the jack detection for headset playback, if you can provide a dmesg + register dump before and after jack insertion it'd be great. I'll do the same on T100HA and we'll see how it goes.
The microphone capture will also require some work, there are digital microphones on the T100HA and analog mics on X205TA, so different configs are likely.
Comment 161 harryharryharry 2017-01-07 02:34:35 UTC
Created attachment 250611 [details]
dmesg before jack insertion
Comment 162 harryharryharry 2017-01-07 02:35:13 UTC
Created attachment 250621 [details]
registers before jack insertion
Comment 163 harryharryharry 2017-01-07 02:35:41 UTC
Created attachment 250631 [details]
registers-nocache before jack insertion
Comment 164 harryharryharry 2017-01-07 02:36:03 UTC
Created attachment 250641 [details]
dmesg after jack insertion
Comment 165 harryharryharry 2017-01-07 02:36:23 UTC
Created attachment 250651 [details]
registers after jack insertion
Comment 166 harryharryharry 2017-01-07 02:36:48 UTC
Created attachment 250661 [details]
registers-nocache after jack insertion
Comment 167 Thibaut 2017-01-07 11:14:44 UTC
I have an Asus X206HA/E200HA which look similar to the X205TA, could I help you by testing your work on it ?
I don't know much things about linux kernel so if there's an easy way to test I could give you my feedback.
Comment 168 Ekyo 2017-01-08 08:35:31 UTC
There's no "easy way" to test, you must recompile the kernel, but it's not complicated. You can follow harry's tutorial here : https://ubuntuforums.org/showthread.php?t=2254322&p=13592053#post13592053

I did it and i can confirm that sound is working :)

So i just wanted to say : THANK YOU to every one involved in this hard work !

If i can do anything to send reports, tests, i'll do it.

Thank you again :)
Comment 169 calimero 2017-01-09 07:12:31 UTC
Created attachment 250831 [details]
attachment-26913-0.html

Awesome.

You're all awesome

2017-01-08 9:35 GMT+01:00 <bugzilla-daemon@bugzilla.kernel.org>:

> https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
> --- Comment #168 from Ekyo <remy.aparisi@free.fr> ---
> There's no "easy way" to test, you must recompile the kernel, but it's not
> complicated. You can follow harry's tutorial here :
> https://ubuntuforums.org/showthread.php?t=2254322&p=13592053#post13592053
>
> I did it and i can confirm that sound is working :)
>
> So i just wanted to say : THANK YOU to every one involved in this hard
> work !
>
> If i can do anything to send reports, tests, i'll do it.
>
> Thank you again :)
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 170 Marco Bo 2017-01-09 21:45:00 UTC
Thank you all :)
I can confirm audio is working well now.

Still missing input mic & headphone.
Comment 171 KBT 2017-01-09 22:07:12 UTC
It also works for me, though using the script attached to this thread i still have to set DAC L2 Mux to IF2 DAC manually


[2017-01-09 22:45] bugzilla-daemon@bugzilla.kernel.org <bugzilla-daemon@bugzilla.kernel.org> wrote:
>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
>--- Comment #170 from Marco Bo <black_painkiller@yahoo.it> ---
>Thank you all :)
>I can confirm audio is working well now.
>
>Still missing input mic & headphone.
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
Comment 172 KBT 2017-01-09 22:08:22 UTC
So some clean setup that demonstrates how it's meant to be would be wonderful! :)

cheers :)

[2017-01-09 23:07] Dr. Christian Bahls - qb352.de <kbt@qb352.de> wrote:
>It also works for me, though using the script attached to this thread i still
>have to set DAC L2 Mux to IF2 DAC manually
>
>
>[2017-01-09 22:45] bugzilla-daemon@bugzilla.kernel.org
><bugzilla-daemon@bugzilla.kernel.org> wrote:
>>https://bugzilla.kernel.org/show_bug.cgi?id=95681
>>
>>--- Comment #170 from Marco Bo <black_painkiller@yahoo.it> ---
>>Thank you all :)
>>I can confirm audio is working well now.
>>
>>Still missing input mic & headphone.
>>
>>-- 
>>You are receiving this mail because:
>>You are on the CC list for the bug.
Comment 173 harryharryharry 2017-01-09 22:27:15 UTC
I know I didn't have sound out of the box either: so I md5sum'ed the /usr/share/alsa/ucm/chtrt5645/HiFi.conf on my drive to the one on Pierre's github (https://github.com/plbossart/UCM/blob/master/chtrt5645/HiFi.conf) and they weren't the same so I copied Pierre's version over my local one.

After I did that no added manual configurations in alsamixer were needed anymore. You might want to check if that works for you too. (I stupidly didn't check what exactly the differences between the files were...)
Comment 174 Pierre Bossart 2017-01-09 22:28:22 UTC
the only things I see missing between the original shell script for speaker playback and the UCM file is:

amixer cset name="DAC2 Playback Switch" on
amixer cset name="Ext Spk Switch" on
Comment 175 Evan Anderson 2017-01-11 03:56:16 UTC
Pierre, thanks for your work on this. This also solves audio issues on braswell with rt5650. This configuration is present in the Acer Chromebook 14.

When should this be expected to hit mainline?
Comment 176 KBT 2017-01-11 11:23:26 UTC
BTW: i still have to audio using Pulseaudio (how can i make sure it uses the HiFi.conf?)

additionally i got:

E: [alsa-sink-1] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write.
E: [alsa-sink-1] alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_soc_sst_cht_bsw_rt5645'. Please report this issue to the ALSA developers.
E: [alsa-sink-1] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Comment 177 Pierre Bossart 2017-01-11 14:32:56 UTC
(In reply to Evan Anderson from comment #175)
> Pierre, thanks for your work on this. This also solves audio issues on
> braswell with rt5650. This configuration is present in the Acer Chromebook
> 14.
> 
> When should this be expected to hit mainline?

4.11 at best. There is a dependency on clock-related patches that are still being debated between audio, clock and x86 domains. I also want to fix the headphone and capture before submitting upstream.
Comment 178 Pierre Bossart 2017-01-11 14:34:28 UTC
(In reply to KBT from comment #176)
> BTW: i still have to audio using Pulseaudio (how can i make sure it uses the
> HiFi.conf?)

if you have chtrt5645 in /usr/share/alsa/ucm it should work out the box

> 
> additionally i got:
> 
> E: [alsa-sink-1] alsa-sink.c: ALSA woke us up to write new data to the
> device, but there was actually nothing to write.
> E: [alsa-sink-1] alsa-sink.c: Most likely this is a bug in the ALSA driver
> 'snd_soc_sst_cht_bsw_rt5645'. Please report this issue to the ALSA
> developers.
> E: [alsa-sink-1] alsa-sink.c: We were woken up with POLLOUT set -- however a
> subsequent snd_pcm_avail() returned 0 or another value < min_avail.

yes, it's a known issue but there are more important things to fix, it doesn't affect functionality.
Comment 179 harryharryharry 2017-01-15 20:02:12 UTC
I think I've isolated the random failure to initialize the soundcard to Fedora. When the soundcard fails to start I can start it manually by modprobing snd_intel_sst_acpi
I haven't experienced the issue since I've built the module into initramfs by adding it to dracut.conf after rd.driver.pre 
Is this something that needs to be fixed in the source code, is this a bug that needs to submitted to Red Hat, or is this something to be expected to be configured/circumvented by the end-user ?
 
(I posted a dmesg from a boot where the soundcard fails to initialize with fedora in comment 128: https://bugzilla.kernel.org/show_bug.cgi?id=95681#c128 )

p.s.: @Pierre: is there any update on when the polarity inversion fixes will be pushed to Github ? And will this also be when the branch experimental/codecs will be rebased ?
Comment 180 Pierre Bossart 2017-01-16 00:11:24 UTC
 
> p.s.: @Pierre: is there any update on when the polarity inversion fixes will
> be pushed to Github ? And will this also be when the branch
> experimental/codecs will be rebased ?

I am trying to fix the mic capture and jack detection before I push the update. So far no luck.
Comment 181 harryharryharry 2017-01-16 09:51:59 UTC
OK thanks for the update! With the mic capture (also jack detection ?) there were some fundamental difference between the x205ta en the t100ha, right ?
If there is anything preliminary I can test on the x205ta, let me know.
Comment 182 Pierre Bossart 2017-01-16 19:39:30 UTC
I pushed a tentative fix for jack detection on T100HA and DMIC capture. You can try on X205TA (not sure how analog capture will work). both playback on headphone and dmic capture are not perfect quality-wise so there is more work needed.

I had to invert the jack detection logic, it may or may not be required on X205TA, see the hack in sound/soc/codecs/rt5645.c

code at https://github.com/plbossart/sound/commits/experimental/codecs
updated UCM at https://github.com/plbossart/UCM
Comment 183 harryharryharry 2017-01-16 21:53:44 UTC
I tried the new commits:

Headphone output works. (Yay!)
Jack detection does not work (no dmesg output shows up when the jack is inserted)
Microphone does not work (tried analog and digital in pavucontrol)

On a sidenode, touchpad and built-in keyboard do not work with 4.10-rc3. on boot dmesg shows the i2c_hid module "failed to reset device". When the laptop is finished booting, pressing one key on the built-in keyboard instantly powers off the laptop.

Several people have been reporting this issue on ubuntuforums as of late:
https://ubuntuforums.org/showthread.php?t=2254322&page=132
would you know what causes this issue ?
Comment 184 Pierre Bossart 2017-01-16 22:08:30 UTC
Surprising. For me jack detection was required to enable the headphone output....and I still have quality issues. Can you hear any sort of noise on the headphone output or does it sound right?

I'll need additional guidance from Realtek on the analog mic enablement, not sure if I need an explicit quirk or not.

No idea for the touchpad/keyboard, it works on CHT for me and Asus T100TAF (baytrail CE as well)
Comment 185 harryharryharry 2017-01-16 22:46:08 UTC
Headphone output sounds okay to me (only very slight crackling when volume is adjusted, also on speakers).

I'll keep trying out the new commits to see if I run into any irregularities.

Do you have any hints as to how I can (temporarily) solve the mouse/keyboard issue ? because testing is a pita if I need to use external keyboard and mouse.
Comment 186 harryharryharry 2017-01-16 23:28:16 UTC
@pierre dismiss that last paragraph, time for bed ;)
Comment 187 Evan Anderson 2017-01-17 04:20:59 UTC
Just to add another datapoint, my CB14's integrated mic does not work properly either. It seems to get high impulse signal close to the mic (clap or snap) but that's it. The rest is noise. Jack detection works fine without the invert hack. The headphone output has slight hiss that sustains immediately after an audio stream plays, but then cuts off suddenly. I am using the chtrt5645 UCM.

@harry I had some keyboard and touchpad problems on 4.9 and 4.10 that seem to be related to interrupts, but haven't found an appropriate cause yet. It may or may not be related.
Comment 188 Pellegrino Prevete 2017-01-17 11:29:06 UTC
You are the most awesome people I will ever know of.
Comment 189 Pellegrino Prevete 2017-01-17 11:30:50 UTC
harryharryharry, the issue with every key causing the pc to shutdown is happening to me also on stable kernel 4.8.0-34. I
Comment 190 Pellegrino Prevete 2017-01-17 11:31:32 UTC
harryharryharry, the issue with every key causing the pc to shutdown is happening to me also on stable ubuntu kernel 4.8.0-34.
Comment 191 Pierre Bossart 2017-01-17 15:45:37 UTC
(In reply to Evan Anderson from comment #187)
> Just to add another datapoint, my CB14's integrated mic does not work
> properly either. It seems to get high impulse signal close to the mic (clap
> or snap) but that's it. The rest is noise. Jack detection works fine without
> the invert hack. The headphone output has slight hiss that sustains
> immediately after an audio stream plays, but then cuts off suddenly. I am
> using the chtrt5645 UCM.
 
do you happen to have access to the schematics and know what sort of mics you have (dmic, amic)?
Comment 192 Evan Anderson 2017-01-17 15:59:41 UTC
(In reply to Pierre Bossart from comment #191)
> do you happen to have access to the schematics and know what sort of mics
> you have (dmic, amic)?

I do not unfortunately. I can try to trace out the inputs on the board and supply the pins that the mic uses if that would be helpful.
Comment 193 Pierre Bossart 2017-01-17 16:03:22 UTC
That would be useful. Alternatively you can try to enable a DMI-based quirk and set the DMIC lines as show in the existing ones (not fun but looks like we need knowledge of hardware to enable DMICs).
Comment 194 Evan Anderson 2017-01-22 22:03:12 UTC
I have not had a chance to look into the hardware for microphone, but I did notice another issue. I'm getting this log line spammed. Not sure how to reproduce it exactly, but it seems to be related to input.

intel_sst_acpi 808622A8:00: sst: Busy wait failed, cant send this msg
Comment 195 Pierre Bossart 2017-01-23 15:23:16 UTC
(In reply to Evan Anderson from comment #194)
> I have not had a chance to look into the hardware for microphone, but I did
> notice another issue. I'm getting this log line spammed. Not sure how to
> reproduce it exactly, but it seems to be related to input.
> 
> intel_sst_acpi 808622A8:00: sst: Busy wait failed, cant send this msg

Never seen that one, you'll have to provide more details but I suspect something is very wrong with IPC and firmware handling.
Comment 196 harryharryharry 2017-01-23 15:55:06 UTC
Now that you mention it, I remember I also have an intel sst firmware loading error in dmesg.

This maybe due to the fact I reverted the git kernel sources back to 31-12-2016 and applied patches to get speakers and headphones working(If I don't revert the keyboard breaks due to kernel v4.10.0)

I'll try to compile the kernel again with a git clone that is up-to-date to see if the firmware loading error is still there.
Comment 197 harryharryharry 2017-01-23 18:19:01 UTC
addition to previous comment:
I built the kernel and yes the up-to-date kernel has a fw error in dmesg:
[   28.585840] intel_sst_acpi 80860F28:00: Direct firmware load for intel/fw_sst_0f28.bin failed with error -2
[   28.585846] intel_sst_acpi 80860F28:00: request fw failed

speakers and headphones work though...

full log:
http://sprunge.us/ZfXH
Comment 198 harryharryharry 2017-01-27 22:10:17 UTC
I don't know if this is of any added value, but when I compile the kernel I get a unused variable warning:

  AS      arch/x86/lib/rwsem.o
  CC      arch/x86/lib/usercopy.o
sound/soc/intel/boards/cht_bsw_rt5645.c: In function ‘cht_codec_init’:
sound/soc/intel/boards/cht_bsw_rt5645.c:265:22: warning: unused variable ‘codec_dai’ [-Wunused-variable]
  struct snd_soc_dai *codec_dai = runtime->codec_dai;
                      ^~~~~~~~~
  CC      drivers/acpi/acpica/tbdata.o
  CC      net/core/skbuff.o
Comment 199 Pierre Bossart 2017-01-30 18:19:38 UTC
(In reply to harryharryharry from comment #198)
> I don't know if this is of any added value, but when I compile the kernel I
> get a unused variable warning:
> 
>   AS      arch/x86/lib/rwsem.o
>   CC      arch/x86/lib/usercopy.o
> sound/soc/intel/boards/cht_bsw_rt5645.c: In function ‘cht_codec_init’:
> sound/soc/intel/boards/cht_bsw_rt5645.c:265:22: warning: unused variable
> ‘codec_dai’ [-Wunused-variable]
>   struct snd_soc_dai *codec_dai = runtime->codec_dai;
>                       ^~~~~~~~~
>   CC      drivers/acpi/acpica/tbdata.o
>   CC      net/core/skbuff.o

yes indeed, I missed that one. Gah. pushed now.
Comment 200 Tom Ketola 2017-02-02 05:01:24 UTC
Created attachment 253831 [details]
DSDT - Radius9 - 4.10rc3+ Intel kernel

Pierre-Louis Bossart asked me to send logs from his 4.10rc3 experimental/codec branch.
Comment 201 Tom Ketola 2017-02-02 05:02:39 UTC
Created attachment 253841 [details]
cat /sys/bus/acpi/devices/10EC*/status

"cat /sys/bus/acpi/devices/10EC*/status > this file" from 4.10rc3+ kernel and non-working sound
Comment 202 Tom Ketola 2017-02-02 05:04:10 UTC
Created attachment 253851 [details]
dmesg from failed audio - Radius9 - 4.10rc3+

dmesg log from 4.10rc+ and no audio w/ rt5645.
Comment 203 Tom Ketola 2017-02-02 05:04:41 UTC
Created attachment 253861 [details]
Pulseaudio log from 4.10rc3+
Comment 204 Pierre Bossart 2017-02-02 06:05:29 UTC
The DSDT is likely from an Android program, they enable the AMCR device but this is not used in the mainline driver. For some reason they have 2 GPIOs listed in this AMCR device but only 1 in the RTEK one. Clearly someone has a bad day copying half of what's needed. Probably doesn't matter though.

The DSDT does not contain the CHAN package and the autodetection of routing won't work. So you'll have to figure out if this is SSP0-AIF1 or SSP0-AIF2. Insyde devices tend to use SSP0-AIF1 w/ rt5640, it'd be ready to bet it's the same.

For SSP0 you *have* to use I2S 16 bit but that should already work.

No obvious root cause for the issue I am afraid. I would try to do a loopback from playback to capture inside of the codec to see if the samples make it across the SSP0, Bard Liao and the Realtek team may be able to help here when they are back next week (Chinese New Year).
Comment 205 Tom Ketola 2017-02-06 16:27:28 UTC
I wanted to follow up and let you know that I got this working with the following changes:
I switched the default routing from SSP0-AIF2 to SSP0-AIF1
I also had to remove commit c3b8f25196b21b03a25b560e983faa193c0ba674 from the experimental/codecs branch, this one had a description marked "ASoC: rt5645: Hack to invert jack detection status". Switching that back to a non-inverted status enabled the audio on my headphones correctly.

Thank you for the help, Pierre!
Comment 206 Pierre Bossart 2017-02-06 17:16:38 UTC
please send the output of 'dmidecode' so that we can add a quirk for your machine. Or you can send a patch similar to this:
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-January/116246.html

While I am at it, is the audio quality fine on the headphone output? I am still getting some noise with the Asus T100HA and can't figure out what's wrong.
Comment 207 harryharryharry 2017-02-06 18:07:07 UTC
I've heard people mention on ubuntuforums they also have a quality issue with the headphones output on the x205ta (they amongst others heard a 'pop' when playback started and stopped). I haven't noticed it myself, but I don't use the headphones jack that much, and maybe I'm not critical enough. Is it a real heavy noise or just some pops and crackles here and there ?
Is there anything we could supply to help you pinpoint the cause of the noise ?
Comment 208 Pierre Bossart 2017-02-06 20:26:03 UTC
Yes I hear the pops on start/stop and some sort of low-volume background noise. It's not white noise for sure, more modulated, almost like power supply issues or clock stability.
On the DMIC input it's more of a grainy/clicky low-volume noise.
Comment 209 s.guillot 2017-02-15 13:20:53 UTC
Just a little feedback on my experiences trying to make sound work on my x205ta under Ubuntu 16.04. 

After compiling a kernel, I got sound working properly on the inbuilt speakers but the headphones only work if I don’t plug the jack entirely (it needs to be about 3/4 of the way). If I plug the jack completely, then sound disappear (not even the typical white-noise is being heard).

I used to be on dual-boot and the headphones were working just fine on Windows. 

I tried different headphones (including regular 3-pin stereo jacks and a 4-pin stereo + mic jack) and the problem remains. 

Another Ubuntu user has posted about the same issue on Ubuntu forums.

I did compile the kernel a couple of times as well as installing a fresh version of Ubuntu just in case…

Any thoughts about where this issue could come from ? (jack detection maybe ?)

Let me know if I can provide any more details or logs and thanks to everyone for your work on this machine.
Comment 210 Alps 2017-02-28 18:32:13 UTC
Thanks for all the work that has been put into this device so far. I wanted to report that I experience the same problem with the headset jack as s.guillot on the X205TA.
Comment 211 Pierre Bossart 2017-02-28 20:50:09 UTC
On T100HA, the jack insertion logic needs to be inverted, can you try the following patch to see if this might be useful on X205TA? value of 32 means jack in, 0 jack out.

https://github.com/plbossart/sound/commit/320c60f28bfac6a95e1f8b092250e1879d98651e
Comment 212 Takashi Iwai 2017-03-01 08:09:08 UTC
Funny that the very same problem was encountered now on GPD Win.  See openSUSE Bugzilla:
  http://bugzilla.opensuse.org/show_bug.cgi?id=1019316

After talking to Bard, he provided a patch to implement the proper jd_invert flag, but it didn't seem working on GPD Win.  His patch is found at:
  https://bugzilla.opensuse.org/attachment.cgi?id=715718

I also implemented to flip the jack state in software side, in a bit more generic way.  See the patch:
  https://bugzilla.opensuse.org/attachment.cgi?id=715700

In both patches, you'll need to add the DMI quirk entry to match with your device.
Comment 213 Alps 2017-03-01 22:10:51 UTC
Hi Pierre,

I built a kernel from the latest experimental/codecs branch and made sure the inversion patch is part of it https://github.com/plbossart/sound/commit/320c60f28bfac6a95e1f8b092250e1879d98651e but the behavior was exactly the same. When plugging in the jack I saw 32 and 0 when removing it. Put playback over the headset only worked when inserted 3/4 and headset was selected manual.
I tried to apply the patches from Takashi on Pierre's experimentel kernel tree but failed. Can someone please give me a hand here? I'm happy to try something out or provide feedback.
Comment 214 Pierre Bossart 2017-03-02 00:10:20 UTC
@Takashi: I tried Bard's patch and it didn't work for me either. Rather than wait for more information on what the hardware does it might indeed be a better idea to use a DMI-based software inversion (which is pretty much what I did with my hack).

@Alps: it looks like you don't need the inversion on X205TA then... I have no idea why the detection fails. FWIW, I connected an eval board for RT5645 to a MinnowMax board and I don't have any of these problems, so it's not Baytrail or RT5645 that are the problem but the way the hardware was designed I am afraid.
Comment 215 Skullnet 2017-03-06 17:36:35 UTC
amixer cset name="DAC L2 Mux" "IF2 DAC"
amixer cset name="DAC R2 Mux" "IF2 DAC"
amixer cset name="Mono DAC MIXL DAC L2 Switch" 1
amixer cset name="Mono DAC MIXR DAC R2 Switch" 1
amixer cset name="SPK MIXL DAC L2 Switch" 1
amixer cset name="SPK MIXR DAC R2 Switch" 1
amixer cset name="SPKVOL L Switch" 1
amixer cset name="SPKVOL R Switch" 1
amixer cset name="SPOL MIX SPKVOL L Switch" 1
amixer cset name="SPOR MIX SPKVOL R Switch" 1

This script has activated my speakers but I still have no sound from headphones. Any suggestions?
Comment 216 Pellegrino Prevete 2017-03-11 05:01:24 UTC
news about input?
Comment 217 harryharryharry 2017-03-30 18:26:41 UTC
When I build 4.11-rc3 and add CONFIG_HDMI_LPE_AUDIO to the config, my speaker output changes to a very soft, high pitched output. I also can't enter pavucontrol anymore (Connection to pulseaudio failed).
Comment 218 Takashi Iwai 2017-03-30 19:29:00 UTC
There is a known problem with PA, and it's being handled in PA side.
Until it's fixed, blacklist / disable the HDMI LPE audio module, or disable the realtime scheduling in PA as a workaround by setting "realtime-scheduling=no" in /etc/pulse/daemon.conf.
Comment 219 harryharryharry 2017-03-31 06:53:54 UTC
Thanks for the answer! I'll keep the module out of my config for now
Comment 221 esteban 2017-04-11 21:08:54 UTC
(In reply to Skullnet from comment #220)
> https://github.com/Monsterovich/x205ta_kernel

64 Bits?
Comment 222 esteban 2017-04-11 21:22:18 UTC
(In reply to esteban from comment #221)
> (In reply to Skullnet from comment #220)
> > https://github.com/Monsterovich/x205ta_kernel
> 
> 64 Bits?

And how to apply this patches?
Comment 223 Skullnet 2017-04-12 10:50:53 UTC
(In reply to esteban from comment #222)
> (In reply to esteban from comment #221)
> > (In reply to Skullnet from comment #220)
> > > https://github.com/Monsterovich/x205ta_kernel
> > 
> > 64 Bits?
> 
> And how to apply this patches?

wget https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.11-rc6.tar.xz
tar xfv linux-4.11-rc6.tar.xz
cd linux-4.11-rc6
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/add-headphones-support.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/asus_eeebook_x205ta_keyboard_fix.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/asus_eeebook_x205ta_reboot_fix.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/i915_prevent_cstate_freezesV2.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
patch -p1 < add-headphones-support.patch
patch -p1 < asus_eeebook_x205ta_keyboard_fix.patch
patch -p1 < asus_eeebook_x205ta_reboot_fix.patch
patch -p1 < i915_prevent_cstate_freezesV2.patch
patch -p1 < v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
make nconfig
(enable 64bit kernel)
fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
Comment 224 Skullnet 2017-04-12 10:51:41 UTC
(In reply to esteban from comment #222)
> (In reply to esteban from comment #221)
> > (In reply to Skullnet from comment #220)
> > > https://github.com/Monsterovich/x205ta_kernel
> > 
> > 64 Bits?
> 
> And how to apply this patches?

wget https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.11-rc6.tar.xz
tar xfv linux-4.11-rc6.tar.xz
cd linux-4.11-rc6
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/add-headphones-support.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/asus_eeebook_x205ta_keyboard_fix.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/asus_eeebook_x205ta_reboot_fix.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/i915_prevent_cstate_freezesV2.patch
wget https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
patch -p1 < add-headphones-support.patch
patch -p1 < asus_eeebook_x205ta_keyboard_fix.patch
patch -p1 < asus_eeebook_x205ta_reboot_fix.patch
patch -p1 < i915_prevent_cstate_freezesV2.patch
patch -p1 < v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
make nconfig
(enable 64bit kernel)
fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
Comment 225 esteban 2017-04-12 13:52:45 UTC
(In reply to Skullnet from comment #224)
> (In reply to esteban from comment #222)
> > (In reply to esteban from comment #221)
> > > (In reply to Skullnet from comment #220)
> > > > https://github.com/Monsterovich/x205ta_kernel
> > > 
> > > 64 Bits?
> > 
> > And how to apply this patches?
> 
> wget
> https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.11-rc6.tar.xz
> tar xfv linux-4.11-rc6.tar.xz
> cd linux-4.11-rc6
> wget
> https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/add-
> headphones-support.patch
> wget
> https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> asus_eeebook_x205ta_keyboard_fix.patch
> wget
> https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> asus_eeebook_x205ta_reboot_fix.patch
> wget
> https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> i915_prevent_cstate_freezesV2.patch
> wget
> https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/v2-gpio-
> acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
> patch -p1 < add-headphones-support.patch
> patch -p1 < asus_eeebook_x205ta_keyboard_fix.patch
> patch -p1 < asus_eeebook_x205ta_reboot_fix.patch
> patch -p1 < i915_prevent_cstate_freezesV2.patch
> patch -p1 <
> v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
> make nconfig
> (enable 64bit kernel)
> fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image
> kernel_headers -j 4

Hi, Tnaks for your Answer

I have a problem:

ozzz@ozzz-pc:~/linux-4.11-rc6$ make nconfig
  HOSTCC  scripts/kconfig/nconf.o
In file included from scripts/kconfig/nconf.c:15:0:
scripts/kconfig/nconf.h:18:20: fatal error: curses.h: No existe el archivo o el directorio
compilation terminated.
scripts/Makefile.host:124: fallo en las instrucciones para el objetivo 'scripts/kconfig/nconf.o'
make[1]: *** [scripts/kconfig/nconf.o] Error 1
Makefile:548: fallo en las instrucciones para el objetivo 'nconfig'
make: *** [nconfig] Error 2
ozzz@ozzz-pc:~/linux-4.11-rc6$ make config
scripts/kconfig/conf  --oldaskconfig Kconfig
#
# using defaults found in /boot/config-4.11.0-041100rc6-generic
#
*
* Linux/x86 4.11.0-rc6 Kernel Configuration
*
64-bit kernel (64BIT) [Y/n/?] y
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) [] 



what i do?

thanks
Comment 226 harryharryharry 2017-04-12 14:11:15 UTC
With all due respect, this is not the right forum for your compiling issues. Try to contact each other via ubuntuforums (Skullnet is on there too). I for one already posted an extensive guide to compiling a kernel which addresses your issue (unfulfilled prerequisites):
https://ubuntuforums.org/showthread.php?t=2254322&page=158&p=13625163#post13625163ttps://goo.gl/dcXIM0 

This bugtracker is about getting audio/microphone to work properly on the X205TA.

Skullnet, I seem to remember you came on here to point out your experiences with respect to 3pin and 4pin audio jacks ? I suspect this was not clear to the other people on here, since you only linked to a github page...
Comment 227 harryharryharry 2017-04-12 14:12:10 UTC
sorry, right url to the guide is:
https://ubuntuforums.org/showthread.php?t=2254322&page=158&p=13625163#post13625163
Comment 228 Skullnet 2017-04-12 14:35:15 UTC
(In reply to esteban from comment #225)
> (In reply to Skullnet from comment #224)
> > (In reply to esteban from comment #222)
> > > (In reply to esteban from comment #221)
> > > > (In reply to Skullnet from comment #220)
> > > > > https://github.com/Monsterovich/x205ta_kernel
> > > > 
> > > > 64 Bits?
> > > 
> > > And how to apply this patches?
> > 
> > wget
> > https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.11-rc6.tar.xz
> > tar xfv linux-4.11-rc6.tar.xz
> > cd linux-4.11-rc6
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/add-
> > headphones-support.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> > asus_eeebook_x205ta_keyboard_fix.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> > asus_eeebook_x205ta_reboot_fix.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> > i915_prevent_cstate_freezesV2.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/v2-gpio-
> > acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
> > patch -p1 < add-headphones-support.patch
> > patch -p1 < asus_eeebook_x205ta_keyboard_fix.patch
> > patch -p1 < asus_eeebook_x205ta_reboot_fix.patch
> > patch -p1 < i915_prevent_cstate_freezesV2.patch
> > patch -p1 <
> > v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
> > make nconfig
> > (enable 64bit kernel)
> > fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image
> > kernel_headers -j 4
> 
> Hi, Tnaks for your Answer
> 
> I have a problem:
> 
> ozzz@ozzz-pc:~/linux-4.11-rc6$ make nconfig
>   HOSTCC  scripts/kconfig/nconf.o
> In file included from scripts/kconfig/nconf.c:15:0:
> scripts/kconfig/nconf.h:18:20: fatal error: curses.h: No existe el archivo o
> el directorio
> compilation terminated.
> scripts/Makefile.host:124: fallo en las instrucciones para el objetivo
> 'scripts/kconfig/nconf.o'
> make[1]: *** [scripts/kconfig/nconf.o] Error 1
> Makefile:548: fallo en las instrucciones para el objetivo 'nconfig'
> make: *** [nconfig] Error 2
> ozzz@ozzz-pc:~/linux-4.11-rc6$ make config
> scripts/kconfig/conf  --oldaskconfig Kconfig
> #
> # using defaults found in /boot/config-4.11.0-041100rc6-generic
> #
> *
> * Linux/x86 4.11.0-rc6 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?] y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) [] 
> 
> 
> 
> what i do?
> 
> thanks

sudo apt-get install libncurses5-dev
Comment 229 esteban 2017-04-12 14:40:14 UTC
(In reply to esteban from comment #225)
> (In reply to Skullnet from comment #224)
> > (In reply to esteban from comment #222)
> > > (In reply to esteban from comment #221)
> > > > (In reply to Skullnet from comment #220)
> > > > > https://github.com/Monsterovich/x205ta_kernel
> > > > 
> > > > 64 Bits?
> > > 
> > > And how to apply this patches?
> > 
> > wget
> > https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.11-rc6.tar.xz
> > tar xfv linux-4.11-rc6.tar.xz
> > cd linux-4.11-rc6
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/add-
> > headphones-support.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> > asus_eeebook_x205ta_keyboard_fix.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> > asus_eeebook_x205ta_reboot_fix.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/
> > i915_prevent_cstate_freezesV2.patch
> > wget
> > https://github.com/Monsterovich/x205ta_kernel/raw/master/patches/v2-gpio-
> > acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
> > patch -p1 < add-headphones-support.patch
> > patch -p1 < asus_eeebook_x205ta_keyboard_fix.patch
> > patch -p1 < asus_eeebook_x205ta_reboot_fix.patch
> > patch -p1 < i915_prevent_cstate_freezesV2.patch
> > patch -p1 <
> > v2-gpio-acpi-Call-enable_irq_wake-for-_IAE-GpioInts-with-Wake-set.patch
> > make nconfig
> > (enable 64bit kernel)
> > fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image
> > kernel_headers -j 4
> 
> Hi, Tnaks for your Answer
> 
> I have a problem:
> 
> ozzz@ozzz-pc:~/linux-4.11-rc6$ make nconfig
>   HOSTCC  scripts/kconfig/nconf.o
> In file included from scripts/kconfig/nconf.c:15:0:
> scripts/kconfig/nconf.h:18:20: fatal error: curses.h: No existe el archivo o
> el directorio
> compilation terminated.
> scripts/Makefile.host:124: fallo en las instrucciones para el objetivo
> 'scripts/kconfig/nconf.o'
> make[1]: *** [scripts/kconfig/nconf.o] Error 1
> Makefile:548: fallo en las instrucciones para el objetivo 'nconfig'
> make: *** [nconfig] Error 2
> ozzz@ozzz-pc:~/linux-4.11-rc6$ make config
> scripts/kconfig/conf  --oldaskconfig Kconfig
> #
> # using defaults found in /boot/config-4.11.0-041100rc6-generic
> #
> *
> * Linux/x86 4.11.0-rc6 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?] y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) [] 
> 
> 
> 
> what i do?
> 
> thanks

ozzz@ozzz-pc:~/linux-4.11-rc6$ make nconfig
  HOSTCC  scripts/kconfig/nconf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTCC  scripts/kconfig/nconf.gui.o
  HOSTLD  scripts/kconfig/nconf
scripts/kconfig/nconf  Kconfig
#
# using defaults found in /boot/config-4.11.0-041100rc6-generic
#
ozzz@ozzz-pc:~/linux-4.11-rc6$ fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
/usr/bin/fakeroot: línea 175: make-kpkg: orden no encontrada
ozzz@ozzz-pc:~/linux-4.11-rc6$ sudo fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
[sudo] password for ozzz: 
/usr/bin/fakeroot: línea 175: make-kpkg: orden no encontrada
ozzz@ozzz-pc:~/linux-4.11-rc6$ sudo fakeroot make-dpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
/usr/bin/fakeroot: línea 175: make-dpkg: orden no encontrada
ozzz@ozzz-pc:~/linux-4.11-rc6$ 

Command not found, thnaks really very thanks for your answer and you help Skullnet you are so great

ozzz@ozzz-pc:~/linux-4.11-rc6$ fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
/usr/bin/fakeroot: línea 175: make-kpkg: orden no encontrada
ozzz@ozzz-pc:~/linux-4.11-rc6$ sudo fakeroot make-kpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
[sudo] password for ozzz: 
/usr/bin/fakeroot: línea 175: make-kpkg: orden no encontrada
ozzz@ozzz-pc:~/linux-4.11-rc6$ sudo fakeroot make-dpkg --initrd --revision=1.1.x205ta kernel_image kernel_headers -j 4
/usr/bin/fakeroot: línea 175: make-dpkg: orden no encontrada
ozzz@ozzz-pc:~/linux-4.11-rc6$
Comment 230 harryharryharry 2017-04-12 15:38:43 UTC
guys this is getting ridiculous, you're each polluting this bugtracker with 100+ lines per comment...
Comment 231 esteban 2017-04-12 15:55:33 UTC
(In reply to harryharryharry from comment #230)
> guys this is getting ridiculous, you're each polluting this bugtracker with
> 100+ lines per comment...

sorry i'm new in this, and what can i do. my english is not very good :/
Comment 232 Skullnet 2017-04-12 15:59:18 UTC
(In reply to harryharryharry from comment #230)
> guys this is getting ridiculous, you're each polluting this bugtracker with
> 100+ lines per comment...

yeah, we need spoiler tag.
Comment 233 harryharryharry 2017-04-12 16:29:31 UTC
As I said earlier: if you have problems with your OS, head over to (something akin to) ubuntuforums. There is a specific (very elaborate) thread for the x205ta on ubuntuforums:
https://ubuntuforums.org/showthread.php?t=2254322&page=161
Comment 234 harryharryharry 2017-04-24 18:42:53 UTC
When suspending the laptop with kodi running. Kodi doesnt have sound after waking up. the following is a log from kodi:
http://ix.io/rGQ

As far as I can tell Kodi is the only program that cant produce an audio output after suspend. Could this be kernel related or is kodi the culprit ?
Comment 235 harryharryharry 2017-04-24 18:59:04 UTC
small addition:
switching back from another tty brings back sound.

dmesg after suspend (without "writing to lpe" messages) shows the following:
http://ix.io/rGV
Comment 236 Skullnet 2017-05-30 16:36:04 UTC
Any news about mic?
Comment 237 harryharryharry 2017-06-24 13:03:08 UTC
At the risk of sounding like the noob mentioning something completely unrelated:
Could the x205ta be part of the group of devices that "require a known fixup" for mic and jack detection, as mentioned here:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20170609&id=28e8af8a163ed6afe9498f1d499a5061c2214755

The group listed there sound like they could be 'related' to the x205ta
Comment 238 Pierre Bossart 2017-06-26 14:05:31 UTC
The fixes are likely controlled by a board-specific quirk (DMI-based).
I must admit I have lost track of the issues here. My understanding is that with the SSP0-AIF1 routing you can get speakers and headphones working, and that jack inversion logic is not required.
Comment 239 harryharryharry 2017-06-29 20:31:51 UTC
I have been applying these two patches from your experimental/codecs tree to the mainline kernel:
ASoC: rt5645: Hack to invert jack detection status
ASoC: rt5645: Add DMIC and jack detection support for ASUS T100HA

To gain headphones support. It doesn't detect jack insertion however and the mic is not working. Btw is there a possibility for you to submit these patches so headphones support will be available in the mainline kernel ?
Comment 240 Chris Gorman 2017-07-11 22:26:33 UTC
Hello all, 

I hope I have the right bug id for these comments.  I have a braswell model chromebook with a chtrt5650 sound card, it's an Acer Chromebook 15 CB3-532.  I installed galliumos on it and am trying to get a the microphone and headphone jack working properly.  I built a 4.12.0 kernel with all the config options built into the kernel and no modules.  There is an interesting outcome when headphone jack is plugged in.  

I get an unexpected irq trap.

[  624.131931] irq 254, desc: ffff8fdd3975d200, depth: 1, count: 0, unhandled: 0
[  624.131944] ->handle_irq():  ffffffffac150020, 
[  624.131962] handle_bad_irq+0x0/0x250
[  624.131967] ->irq_data.chip(): ffffffffad6c1380, 
[  624.131988] chv_gpio_irqchip+0x0/0x120
[  624.131993] ->action():           (null)
[  624.131998]    IRQ_NOPROBE set
[  624.132005] unexpected IRQ trap at vector fe

This loops until reboot.

Interestingly, when the kernel is built with the sound card, etc. as modules.  The headphone jack detection works and I get no irq trap.  I tried today to see if Pierre's patch for jack detection would work, but the code in 4.12 has changed too much.
Comment 241 harryharryharry 2017-07-18 18:51:01 UTC
(In reply to harryharryharry from comment #239)
> I have been applying these two patches from your experimental/codecs tree to
> the mainline kernel:
> ASoC: rt5645: Hack to invert jack detection status
> ASoC: rt5645: Add DMIC and jack detection support for ASUS T100HA
> 
> To gain headphones support. It doesn't detect jack insertion however and the
> mic is not working. Btw is there a possibility for you to submit these
> patches so headphones support will be available in the mainline kernel ?

@Pierre Bossart
Sadly the above patches for headphones support cant be succesfully applied anymore to kernel 4.13-rc1. Is there a way to still be able to get headphones support on kernel 4.13 and onwards? (or get support integrated into the mainline kernel)
Comment 242 Pierre Bossart 2017-07-24 14:40:56 UTC
The latest code from Takashi includes the ability to override default values or quirks with a module parameter, I am not planning to add any new DMI-based quirks for now...
Comment 243 Takashi Iwai 2017-07-24 15:00:13 UTC
It implies: 4.13-rc1 contains quirk option for snd-soc-rt5645 module, and you can override the whole quirk behavior by this option.

Once when it is confirmed to work on your box, feel free to cook up and submit the patch to add the quirk statically with DMI matching.
Comment 244 harryharryharry 2017-07-24 20:20:26 UTC
OK thanks for the answers guys! I found out that adding:
options snd_soc_rt5645 quirk=0x31
to a conf file in /etc/modprobe.d/ gets the headphones working again on 4.13-rc2

I'm not really well-versed in submitting patches, how would I go about submitting a patch to add the quirk statically with DMI matching ?
Comment 245 Pierre Bossart 2017-07-25 07:05:33 UTC
all you need to do is look at the output of sudo dmidecode and find strings that identify your device, e.g. 
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: X205TAW

then create a quirk with the static setting of bits and send it to alsa-devel with your sign-off.
Comment 246 Daimon 2017-07-27 10:25:00 UTC
Hi Pierre,
Please could you shed some light on my rt5645. I have a working 4.4 patched kernel binary +ucm, while need to upgrade to newer kernel for other issue. The headphone just give no sound with new kernel while device discovery looks fine.

I've open a separate bug and wait quite some time without any notice. The alsa info and dmesg can be found there: https://bugzilla.kernel.org/show_bug.cgi?id=196335
Comment 247 Chris Gorman 2017-08-03 13:41:27 UTC
(In reply to Chris Gorman from comment #240)
> Hello all, 
> 
> I hope I have the right bug id for these comments.  I have a braswell model
> chromebook with a chtrt5650 sound card, it's an Acer Chromebook 15 CB3-532. 
> I installed galliumos on it and am trying to get a the microphone and
> headphone jack working properly.  I built a 4.12.0 kernel with all the
> config options built into the kernel and no modules.  There is an
> interesting outcome when headphone jack is plugged in.  
> 
> I get an unexpected irq trap.
> 
> [  624.131931] irq 254, desc: ffff8fdd3975d200, depth: 1, count: 0,
> unhandled: 0
> [  624.131944] ->handle_irq():  ffffffffac150020, 
> [  624.131962] handle_bad_irq+0x0/0x250
> [  624.131967] ->irq_data.chip(): ffffffffad6c1380, 
> [  624.131988] chv_gpio_irqchip+0x0/0x120
> [  624.131993] ->action():           (null)
> [  624.131998]    IRQ_NOPROBE set
> [  624.132005] unexpected IRQ trap at vector fe
> 
> This loops until reboot.
> 
> Interestingly, when the kernel is built with the sound card, etc. as
> modules.  The headphone jack detection works and I get no irq trap.  I tried
> today to see if Pierre's patch for jack detection would work, but the code
> in 4.12 has changed too much.

I have now tried this with 4.13.0-rc3 built with modules.  This unexpected irq trap occurs now with a modular build. I've poked around looking for the reason, but have only gotten to

kernel/irq/debug.h

which is the reason I have this nice error message.  

Other oddities with the monolithic kernel and no modules, the computer still uses speakers when the microphone jack is inserted.  So i expect this to be a complaint as development moves on.
Comment 248 Pierre Bossart 2017-08-03 14:51:07 UTC
All my previous experimental patches are no longer needed, the bulk of the code was merged in 4.13-rc3 already. I tested yesterday on the Asus T100HA and there is only a missing inversion quirk needed which I'll submit this week. I did not see this irq message so it's probably platform specific.
Note that I still have a lot of pop noise when starting playback on the headphone and modulated noise. I haven't been able to figure out where this comes from.
Comment 249 Chris Gorman 2017-08-22 23:18:03 UTC
I started looking playing files and recording sound.  When I record sound, there is a lag of about 2.3-2.5 seconds before the recorder begins recording sounds.  Then (as mentioned by evan anderson) the microphone records a hiss and will only record something loud like a clap.  As to the playback, I get the same type of lag when I first play a sound, then the sound works properly.  Also interestingly, arecord will not record at say 60000hz it complains and says that the rate is not accurate, and drops the record rate to 48000hz.

The hardware is chtrt5650 (cht-bsw-rt5645, rt5645 i2c-10EC5650:00).
Comment 250 harryharryharry 2018-01-04 16:47:14 UTC
@ Pierre Bossart :

I saw Hans de Goede recently merged some commits that were adding analog mic support for cht_bsw_rt5645:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20180104&id=b70b309950418437bbd2a30afd169c4f09dee3e5

I tried linux-next out but sadly got no working mic. Is this commit something that can be of added value to get the mic working on the X205TA and T100HA ?
Comment 251 Pierre Bossart 2018-01-04 18:05:44 UTC
Dunno. T100HA has a digital mic so that's not helping. One possibility for X205TA is that the analog mic is not connected on the same input as what Hans configured, Realtek have usually 3 analog inputs that need to be configured in the DAPM map. the other problem is mixer settings (which is a related issue, if you don't know where things are connected you are in for a long long debug session)
Comment 252 harryharryharry 2018-01-09 00:41:06 UTC
Good news! I built the latest linux-next clone (because I saw some more commits from Bard regarding the rt5645 analog microphone)

And when I edit /usr/share/alsa/ucm/chtrt5645/HiFi.conf to include (in the "Internal Analog Microphones" section):
cset "name='RECMIXL BST2 Switch' on"
cset "name='RECMIXR BST2 Switch' on"
(from: https://www.spinics.net/lists/alsa-devel/msg71841.html)

The microphone registers input. There's a bit of background noise, but it's pretty usable!
Comment 253 Bard Liao 2018-01-09 00:48:15 UTC
Created attachment 273489 [details]
attachment-2435-0.html

I am currently on business trip and will return on Jan. 12. Slow mail response may be expected.
Please contact shumingf@realtek.com or flove@realtek.com for urgent case.

Thanks.
Comment 254 Pierre Bossart 2018-01-09 00:57:42 UTC
(In reply to harryharryharry from comment #252)
> Good news! I built the latest linux-next clone (because I saw some more
> commits from Bard regarding the rt5645 analog microphone)
> 
> And when I edit /usr/share/alsa/ucm/chtrt5645/HiFi.conf to include (in the
> "Internal Analog Microphones" section):
> cset "name='RECMIXL BST2 Switch' on"
> cset "name='RECMIXR BST2 Switch' on"
> (from: https://www.spinics.net/lists/alsa-devel/msg71841.html)
> 
> The microphone registers input. There's a bit of background noise, but it's
> pretty usable!

It may be worth testing with the in2_diff quirk - as done already by Hans for the GPD_win device?
Comment 255 Chris Gorman 2019-07-09 15:43:41 UTC
Hello All,

Sorry for posting my question here, but I can't seem to get google to help me.  I would like to find a datasheet for the realtek 5650, so I can poke around with it  to try to get the internal microphone working and I haven't been able to find one.  

The current state is the mic will accept loud claps as input, but nothing else.  Τhe input is either 0% or 100%.  Anything like talking or music fails to register. 

Thanks in advance,

Chris
Comment 256 Chris Gorman 2020-02-09 17:44:13 UTC
I have some additional information on this.  I'm not too sure if I should start a new bug report as my bug is specifically the DMIC on my machine not working.  I have a banon, braswell, Intel_Strago chromebook.  I had some high hopes recently that it would start working again with Sam McNally's patch, ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0, adebb11139029ddf1fba6f796c4a476f17eacddc.  Unfortunately this patch has not fixed my DMIC.  According to Sam this has fixed their banon machines, running chromeos kernels.

My symptom has gone from no sound whatsoever as I previously posted to white noise now.  Running arecord, I get
chris@lie:~$ arecord -vvv -f S24_LE -D hw:1,0 -d 25 /dev/null 
Recording WAVE '/dev/null' : Signed 24 bit Little Endian, Rate 8000 Hz, Mono
Warning: rate is not accurate (requested = 8000Hz, got = 48000Hz)
         please, try the plug plugin 
Hardware PCM card 1 'chtrt5650' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S24_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 6755399441055744000
  appl_ptr     : 0
  hw_ptr       : 0
Max peak (6000 samples): 0x7dacff32 #################### 25135%
Max peak (6000 samples): 0x00000001 #                    0%
Max peak (6000 samples): 0x00000001 #                    0%
Max peak (6000 samples): 0x00010000 #                    0%
Max peak (6000 samples): 0x00010000 #                    0%
Max peak (6000 samples): 0x00000000 #                    0%
Max peak (6000 samples): 0x00000000 #                    0%
Max peak (6000 samples): 0x00010000 #                    0%
Max peak (6000 samples): 0x00000000 #                    0%
Max peak (6000 samples): 0x0002fffe #                    2%
Max peak (6000 samples): 0x00000000 #                    0%
Max peak (6000 samples): 0x0008fff8 ##                   7%
Max peak (6000 samples): 0x0015ffeb ####                 17%
Max peak (6000 samples): 0x0028ffd8 #######              32%
Max peak (6000 samples): 0x0001ffff #                    1%
Max peak (6000 samples): 0x00c2ff3e #################### 152%
Max peak (6000 samples): 0x000f0007 ###                  11%
Max peak (6000 samples): 0x0010fff9 ###                  13%
Max peak (6000 samples): 0x0777f889 #################### 1493%
Max peak (6000 samples): 0x0f36f0ca #################### 3042%
Max peak (6000 samples): 0x2071f439 #################### 6489%
Max peak (6000 samples): 0x46d7b92a #################### 14168%
Max peak (6000 samples): 0x7fff9670 #################### 25599%
Max peak (6000 samples): 0x02e401cc #################### 578%
Max peak (6000 samples): 0x7fff8001 #################### 25599%
Max peak (6000 samples): 0x7fff9b40 #################### 25599%
Max peak (6000 samples): 0x7fff8158 #################### 25599%
Max peak (6000 samples): 0x7ffffae0 #################### 25600%
Max peak (6000 samples): 0x7fff81d1 #################### 25599%
Max peak (6000 samples): 0x7fff8001 #################### 25599%
Max peak (6000 samples): 0x7fff8a0c #################### 25599%
Max peak (6000 samples): 0x046f02dc #################### 886%
Max peak (6000 samples): 0x7fff9d60 #################### 25599%
Max peak (6000 samples): 0x7fff7fff #################### 25599%


When I play music I get...

root@lie:~# cat /sys/kernel/debug/clk/clk_summary 
                                 enable  prepare  protect                                duty
   clock                          count    count    count        rate   accuracy phase  cycle
---------------------------------------------------------------------------------------------
 xtal                                 1        1        0    19200000          0     0  50000
    pmc_plt_clk_5                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_4                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_3                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_2                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_1                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_0                     1        1        0    19200000          0     0  50000
 lpss_clk                             2        2        0   100000000          0     0  50000
    8086228A:00                       0        0        0   100000000          0     0  50000
       8086228A:00-div                0        0        0   100000000          0     0  50000
          8086228A:00-update          0        0        0   100000000          0     0  50000

When I try to record I get ...

root@lie:~# cat /sys/kernel/debug/clk/clk_summary 
                                 enable  prepare  protect                                duty
   clock                          count    count    count        rate   accuracy phase  cycle
---------------------------------------------------------------------------------------------
 xtal                                 0        0        0    19200000          0     0  50000
    pmc_plt_clk_5                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_4                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_3                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_2                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_1                     0        0        0    19200000          0     0  50000
    pmc_plt_clk_0                     0        0        0    19200000          0     0  50000
 lpss_clk                             2        2        0   100000000          0     0  50000
    8086228A:00                       0        0        0   100000000          0     0  50000
       8086228A:00-div                0        0        0   100000000          0     0  50000
          8086228A:00-update          0        0        0   100000000          0     0  50000

pmc_plt_clk_0 should be the same playing and recording, I believe, and it is not.  I've looked at https://bugzilla.kernel.org/show_bug.cgi?id=201787 to see what the fix was for those with chtmax98090 chromebooks and found that their pmc_plt_clk_0 is set CLK_IS_CRITICAL.  On my machine I get ...

root@lie:~# for i in /sys/kernel/debug/clk/pmc_plt_clk_?; do echo -n "$i: "; cat $i/clk_flags; echo; done
/sys/kernel/debug/clk/pmc_plt_clk_0: 
/sys/kernel/debug/clk/pmc_plt_clk_1: 
/sys/kernel/debug/clk/pmc_plt_clk_2: 
/sys/kernel/debug/clk/pmc_plt_clk_3: 
/sys/kernel/debug/clk/pmc_plt_clk_4: 
/sys/kernel/debug/clk/pmc_plt_clk_5:

Hope someone can fix this for me.  I am willing to test patches and ideas.

Thanks in advance,

Chris
Comment 257 sverx 2023-10-31 12:48:30 UTC
Hello!

I wonder what's the status of this bug - I can hear audio from the speakers (and from the headphones using a quirk) on my Asus X205TA.

But the headphones insertion and removal are unfortunately not detected. It seems to me it's some WMI or ACPI issue but I'm in a no way expert on this.

If there's some other info I can provide or tests I can run to help further investigate this issue let me know!

Thanks!
Comment 258 shankargopal 2023-10-31 15:49:11 UTC
I'm afraid I stopped using that computer about six years ago I think 
(I'm impressed you still have one - I loved it).  Never did find a 
solution to the problem you mention.


On 10/31/23 18:18, bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=95681
>
> sverx (sverx@yahoo.com) changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |sverx@yahoo.com
>
> --- Comment #257 from sverx (sverx@yahoo.com) ---
> Hello!
>
> I wonder what's the status of this bug - I can hear audio from the speakers
> (and from the headphones using a quirk) on my Asus X205TA.
>
> But the headphones insertion and removal are unfortunately not detected. It
> seems to me it's some WMI or ACPI issue but I'm in a no way expert on this.
>
> If there's some other info I can provide or tests I can run to help further
> investigate this issue let me know!
>
> Thanks!
>
Comment 259 sverx 2023-11-08 13:38:05 UTC
So after *long* searches, I found this recent-ish (Jan 2022) groups of patches that had fixed jack-detection on some various systems, including at least one from Asus.

https://lore.kernel.org/all/20220106110128.66049-7-hdegoede@redhat.com/

To me this seems very pertinent, mainly because the Asus X205TA also sports this 'AMCR0F28' device which looks like is the one responsible for triggering the headphone jack insertion/removal event.

This patch already made its way into mainline kernel (from 6.1.0 and following) but even if I tried it, I still can't get the headphone jack-detect to work. :|

I suspect now I just need to add some quirk to instruct to activate this for X205TA too, but I can't figure out what exactly I should write and in what file (I'm such a newbie!).

Any help from the knowleadgeable people here? :)

Thanks!
Comment 260 Pierre Bossart 2023-11-08 15:13:28 UTC
You need to make sure your platform indeed has an RT5640 and add a quirk for your DMI_PRODUCT_NAME with the relevant mask, similar to this:

+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
+		},
+		.driver_data = (void *)(BYT_RT5640_IN1_MAP |
+					BYT_RT5640_JD_SRC_EXT_GPIO |
+					BYT_RT5640_OVCD_TH_2000UA |
+					BYT_RT5640_OVCD_SF_0P75 |
+					BYT_RT5640_SSP0_AIF1 |
+					BYT_RT5640_MCLK_EN |
+					BYT_RT5640_USE_AMCR0F28),
+	},
Comment 261 sverx 2023-11-08 16:54:17 UTC
(In reply to Pierre Bossart from comment #260)
> You need to make sure your platform indeed has an RT5640 and add a quirk for
> your DMI_PRODUCT_NAME with the relevant mask, similar to this:

According to the DSDT file, it has an RT5648 - not sure if it's the same thing.

Before resorting to compiling the kernel myself, which is something I've never done before, wasn't there some simple way to specify quirks in a file that the module would read?

What would be the name of this file? And what should I write in there?

Basically I want this part of the code to be run:

>> if (byt_rt5640_quirk & BYT_RT5640_USE_AMCR0F28) {
>>   ret = byt_rt5640_get_amcr0f28_settings(card);
>>   if (ret)
>>     return ret;
>> }

and 'BYT_RT5640_USE_AMCR0F28' is defined as BIT(29) ... that's all I can understand from that code.

Thanks!
Comment 262 sverx 2023-11-08 17:17:53 UTC
OK I found out the Asus X205TA uses the cht-bsw-rt5645 module.

So it probably needs a similar patch? :|

Note You need to log in before you can comment on or make changes to this bug.