Bug 195195
Summary: | No audio playback/recording on Dell Venue 8 Pro 5855 tablet with cht-bsw-rt5672 | ||
---|---|---|---|
Product: | Drivers | Reporter: | RussianNeuroMancer (russianneuromancer) |
Component: | Sound(ALSA) | Assignee: | Jaroslav Kysela (perex) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | bardliao, pierre-louis.bossart, tsunghanliu, youling257 |
Priority: | P1 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 4.12 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
dsdt.dsl from Dell 5855 (HD/2GB/WiFi+LTE revision)
register dump during audio playback on headphones 5670 regmap plug in/out headphone 5640 regmap plug in/out headphone |
Description
RussianNeuroMancer
2017-03-31 18:24:47 UTC
With UCM config from https://bugzilla.kernel.org/show_bug.cgi?id=96691#c46 I get 1. When I playback audio only to left channel - left speaker playback audio. 2. When I playback audio only to right channel - there is silence. 3. Left headphone playback audio from left and right channels, but audio from left channels seems like a bit louder. At the end of audio playback there is crackling sound. 4. Right headphone playback audio from left and right channels, but audio from right channels seems like a bit louder. At the end of audio playback there is crackling sound. 5. Headset microphone is not listed in input sources. 6. Internal microphone is doesn't record anything. 7. No automatic jack detection, so no automatic switch between speakers and headphones/headset. 8. In headphones quiet sounds seems like louder, and for some reason especially voices is always quieter (for example in song - music is always louder than signer voice). Created attachment 257613 [details]
dsdt.dsl from Dell 5855 (HD/2GB/WiFi+LTE revision)
thinkpad 8 z3770,alc5672 thinkpad 8 z3795 4GB RAM,alc5672 thinkpad 10 z3795,alc5672 I ran a couple of tests with the hardware kindly provided by RussianNeuroMancer (using stock Fedora 26 and just added the UCM file for rt5670 for Lenovo platforms) There are indeed two problems 1. it doesn't look like there is a right speaker, but that can probably be sorted out by adding a new UCM output device which play right on left 2. there is a jack detection/configuration issue. The UCM file has to be commented out with the JackControl "Headphone Jack" removed to show up in the sound applet, and when I look at the alsa controls same thing [plb@Dell5585 ~]$ amixer -Dhw:1 cget numid=170 numid=170,iface=CARD,name='Headphone Jack' ; type=BOOLEAN,access=r-------,values=1 : values=off Interestingly the headphone output works even without any configuration but the left and right channels get played on both sides. @Bard, could you take a look at the registers and maybe suggest something? Created attachment 258027 [details]
register dump during audio playback on headphones
(In reply to Pierre Bossart from comment #5) > Created attachment 258027 [details] > register dump during audio playback on headphones which branch can make speaker working? i only found these,https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=grep&q=5670 https://github.com/plbossart/sound/commits/topic/cleanups-before-sof/sound/soc/intel https://github.com/plbossart/UCM/commits/master ThinkPad 10 and 8. (In reply to Pierre Bossart from comment #5) > Created attachment 258027 [details] > register dump during audio playback on headphones https://github.com/plbossart/sound/commits/topic/cleanups-before-sof/ this branch is newest ? (In reply to youling257 from comment #7) > (In reply to Pierre Bossart from comment #5) > > Created attachment 258027 [details] > > register dump during audio playback on headphones > > https://github.com/plbossart/sound/commits/topic/cleanups-before-sof/ > this branch is newest ? yes and UCM files are up-to-date. The only missing part if the internal mic but I am waiting confirmation from Realtek that I am using the right dmic input (pin 5). (In reply to Pierre Bossart from comment #4) > I ran a couple of tests with the hardware kindly provided by > RussianNeuroMancer (using stock Fedora 26 and just added the UCM file for > rt5670 for Lenovo platforms) > > There are indeed two problems > 1. it doesn't look like there is a right speaker, but that can probably be > sorted out by adding a new UCM output device which play right on left > > 2. there is a jack detection/configuration issue. The UCM file has to be > commented out with the JackControl "Headphone Jack" removed to show up in > the sound applet, and when I look at the alsa controls same thing > > [plb@Dell5585 ~]$ amixer -Dhw:1 cget numid=170 > numid=170,iface=CARD,name='Headphone Jack' > ; type=BOOLEAN,access=r-------,values=1 > : values=off > > Interestingly the headphone output works even without any configuration but > the left and right channels get played on both sides. > > @Bard, could you take a look at the registers and maybe suggest something? which Lenovo platform device ? I get sound from headphone,only headphone work,speaker no sound,ThinkPad 8. [ 11.233653] intel_sst_acpi 80860F28:00: BYT-CR not detected [ 11.233820] intel_sst_acpi 80860F28:00: LPE base: 0xd0a00000 size:0x200000 [ 11.233824] intel_sst_acpi 80860F28:00: IRAM base: 0xd0ac0000 [ 11.233884] intel_sst_acpi 80860F28:00: DRAM base: 0xd0b00000 [ 11.233892] intel_sst_acpi 80860F28:00: SHIM base: 0xd0b40000 [ 11.233901] intel_sst_acpi 80860F28:00: Mailbox base: 0xd0b44000 [ 11.233908] intel_sst_acpi 80860F28:00: DDR base: 0x20000000 [ 11.234358] intel_sst_acpi 80860F28:00: Got drv data max stream 25 [ 11.418853] cht-bsw-rt5672 cht-bsw-rt5672: snd-soc-dummy-dai <-> media-cpu-dai mapping ok [ 11.418902] cht-bsw-rt5672 cht-bsw-rt5672: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok [ 11.418927] compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping ok [ 11.421839] cht-bsw-rt5672 cht-bsw-rt5672: rt5670-aif1 <-> ssp2-port mapping ok [ 11.428388] input: cht-bsw-rt5672 Headset as /devices/platform/80860F28:00/cht-bsw-rt5672/sound/card0/input5 (In reply to Pierre Bossart from comment #5) > Created attachment 258027 [details] > register dump during audio playback on headphones I get speaker/headphone working,but same problem: Interestingly the headphone output works even without any configuration but the left and right channels get played on both sides.plug in/out headphone, if plug in/out,regmap should be different,but them same. Created attachment 258307 [details]
5670 regmap plug in/out headphone
Created attachment 258309 [details]
5640 regmap plug in/out headphone
(In reply to youling257 from comment #10) > (In reply to Pierre Bossart from comment #5) > > Created attachment 258027 [details] > > register dump during audio playback on headphones > > I get speaker/headphone working,but same problem: > Interestingly the headphone output works even without any configuration but > the left and right channels get played on both sides.plug in/out headphone, > > if plug in/out,regmap should be different,but them same. You probably don't have the right jd_mode. Before the quirks I submitted for 4.13, the headphone worked without configuration but left and right were identical. (In reply to Pierre Bossart from comment #13) > (In reply to youling257 from comment #10) > > (In reply to Pierre Bossart from comment #5) > > > Created attachment 258027 [details] > > > register dump during audio playback on headphones > > > > I get speaker/headphone working,but same problem: > > Interestingly the headphone output works even without any configuration but > > the left and right channels get played on both sides.plug in/out headphone, > > > > if plug in/out,regmap should be different,but them same. > > You probably don't have the right jd_mode. Before the quirks I submitted for > 4.13, the headphone worked without configuration but left and right were > identical. I test 4.14 rc1 [ 8.431557] intel_sst_acpi 80860F28:00: BYT-CR not detected [ 8.431701] intel_sst_acpi 80860F28:00: LPE base: 0xd0a00000 size:0x200000 [ 8.431704] intel_sst_acpi 80860F28:00: IRAM base: 0xd0ac0000 [ 8.431737] intel_sst_acpi 80860F28:00: DRAM base: 0xd0b00000 [ 8.431744] intel_sst_acpi 80860F28:00: SHIM base: 0xd0b40000 [ 8.431751] intel_sst_acpi 80860F28:00: Mailbox base: 0xd0b44000 [ 8.431756] intel_sst_acpi 80860F28:00: DDR base: 0x20000000 [ 8.431957] intel_sst_acpi 80860F28:00: Got drv data max stream 25 [ 8.473773] rt5640 i2c-10EC5640:01: Device with ID register 0x6271 is not rt5640/39 [ 8.704721] bytcr_rt5640 bytcr_rt5640: quirk DMIC1_MAP enabled [ 8.704724] bytcr_rt5640 bytcr_rt5640: quirk DMIC enabled [ 8.704727] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled [ 8.704750] bytcr_rt5640 bytcr_rt5640: ASoC: CODEC DAI rt5640-aif1 not registered [ 8.704756] bytcr_rt5640 bytcr_rt5640: devm_snd_soc_register_card failed -517 [ 8.715507] input: PC Speaker as /devices/platform/pcspkr/input/input6 [ 8.716085] bytcr_rt5640 bytcr_rt5640: quirk DMIC1_MAP enabled [ 8.716088] bytcr_rt5640 bytcr_rt5640: quirk DMIC enabled [ 8.716090] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled [ 8.716120] bytcr_rt5640 bytcr_rt5640: ASoC: CODEC DAI rt5640-aif1 not registered [ 8.716125] bytcr_rt5640 bytcr_rt5640: devm_snd_soc_register_card failed -517 [ 8.732905] rt5670 i2c-10EC5640:01: quirk dev_gpio [ 8.732909] rt5670 i2c-10EC5640:01: quirk DMIC enabled [ 8.732911] rt5670 i2c-10EC5640:01: quirk DMIC1 on IN2P pin [ 8.732913] rt5670 i2c-10EC5640:01: quirk JD mode 1 https://github.com/youling257/android-4.9/commits/4.14-rc1 .callback = byt_thinkpad10_quirk_cb, .matches = { DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"), }, is it not working on 4.14 kernel ? it working on my 4.9 kernel (In reply to youling257 from comment #10) > (In reply to Pierre Bossart from comment #5) > > Created attachment 258027 [details] > > register dump during audio playback on headphones > > I get speaker/headphone working,but same problem: > Interestingly the headphone output works even without any configuration but > the left and right channels get played on both sides.plug in/out headphone, > > if plug in/out,regmap should be different,but them same. last week,i used my 4.9 kernel,get ThinkPad 8 speaker/headphone working on Android x86 https://github.com/youling257/android-4.9/commits/August/sound https://github.com/youling257/android-4.9/commits/4.14-rc1/sound (In reply to youling257 from comment #16) > https://github.com/youling257/android-4.9/commits/August/sound > > https://github.com/youling257/android-4.9/commits/4.14-rc1/sound There is a magic tool called git bisect. If you don't provide more information on what stopped the audio from working on your platform not sure what help you expect from others. (In reply to Pierre Bossart from comment #17) > (In reply to youling257 from comment #16) > > https://github.com/youling257/android-4.9/commits/August/sound > > > > https://github.com/youling257/android-4.9/commits/4.14-rc1/sound > > There is a magic tool called git bisect. If you don't provide more > information on what stopped the audio from working on your platform not sure > what help you expect from others. you need reply my comment #14,compare dmesg with comment #9 if add thinkpad 8 acpi quirk,should be load cht-bsw_rt5672,right ? but,4.14 kernel,load bytcr-rt5640 (In reply to Pierre Bossart from comment #17) > (In reply to youling257 from comment #16) > > https://github.com/youling257/android-4.9/commits/August/sound > > > > https://github.com/youling257/android-4.9/commits/4.14-rc1/sound > > There is a magic tool called git bisect. If you don't provide more > information on what stopped the audio from working on your platform not sure > what help you expect from others. i just porting a lot of patches to 4.9 kernel,only one patch is add ThinkPad 8 acpi quirk the 4.14 kernel only need ThinkPad 8 acpi quirk,but quirk not working. revert 7827d66946ad3af734ed46d1d68c23fa6974595c ,can load correct machine driver for ThinkPad 8 on 4.14 kernel Android x86 [ 8.781775] intel_sst_acpi 80860F28:00: BYT-CR not detected [ 8.781959] intel_sst_acpi 80860F28:00: LPE base: 0xd0a00000 size:0x200000 [ 8.781963] intel_sst_acpi 80860F28:00: IRAM base: 0xd0ac0000 [ 8.782000] intel_sst_acpi 80860F28:00: DRAM base: 0xd0b00000 [ 8.782025] intel_sst_acpi 80860F28:00: SHIM base: 0xd0b40000 [ 8.782035] intel_sst_acpi 80860F28:00: Mailbox base: 0xd0b44000 [ 8.782046] intel_sst_acpi 80860F28:00: DDR base: 0x20000000 [ 8.782735] intel_sst_acpi 80860F28:00: Got drv data max stream 25 [ 8.820248] rt5670 i2c-10EC5640:01: quirk dev_gpio [ 8.820254] rt5670 i2c-10EC5640:01: quirk DMIC enabled [ 8.820257] rt5670 i2c-10EC5640:01: quirk DMIC1 on IN2P pin [ 8.820260] rt5670 i2c-10EC5640:01: quirk JD mode 1 [ 8.952337] cht-bsw-rt5672 cht-bsw-rt5672: snd-soc-dummy-dai <-> media-cpu-dai mapping ok [ 8.952385] cht-bsw-rt5672 cht-bsw-rt5672: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok [ 8.952410] compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping ok [ 8.953153] cht-bsw-rt5672 cht-bsw-rt5672: rt5670-aif1 <-> ssp2-port mapping ok [ 8.956659] input: cht-bsw-rt5672 Headset as /devices/platform/80860F28:00/cht-bsw-rt5672/sound/card0/input6 (In reply to youling257 from comment #20) > revert 7827d66946ad3af734ed46d1d68c23fa6974595c ,can load correct machine > driver for ThinkPad 8 on 4.14 kernel Android x86 Humm, this dates from 4.12, so it's not really related to the changes made for rt5670 in my patches. Can you please trace what is done in this patch to explain what is done wrong? just add a printk(KERN_ERR and send the log it could be a mistmatch in a quirk table. (In reply to Pierre Bossart from comment #21) > (In reply to youling257 from comment #20) > > revert 7827d66946ad3af734ed46d1d68c23fa6974595c ,can load correct machine > > driver for ThinkPad 8 on 4.14 kernel Android x86 > > Humm, this dates from 4.12, so it's not really related to the changes made > for rt5670 in my patches. > Can you please trace what is done in this patch to explain what is done > wrong? > just add a printk(KERN_ERR and send the log > it could be a mistmatch in a quirk table. static struct sst_acpi_mach byt_thinkpad_10 = { .id = "10EC5640", .drv_name = "cht-bsw-rt5672", .fw_filename = "intel/fw_sst_0f28.bin", .board = "cht-bsw", .pdata = &byt_rvp_platform_data, https://github.com/torvalds/linux/commit/7827d66946ad3af734ed46d1d68c23fa6974595c cause 10ec5640 can't load cht-bsw-rt5672,revert it can load,just my case on Androidx86. https://bugzilla.kernel.org/show_bug.cgi?id=96691#c97 Andrew Y only test 4.12 kernel,7827d66946ad3af734ed46d1d68c23fa6974595c begin in 4.13rc1 you need contact Andrew to verify,if he has same case on Ubuntu/Desktop Linux. (In reply to youling257 from comment #22) > (In reply to Pierre Bossart from comment #21) > > (In reply to youling257 from comment #20) > > > revert 7827d66946ad3af734ed46d1d68c23fa6974595c ,can load correct machine > > > driver for ThinkPad 8 on 4.14 kernel Android x86 > > > > Humm, this dates from 4.12, so it's not really related to the changes made > > for rt5670 in my patches. > > Can you please trace what is done in this patch to explain what is done > > wrong? > > just add a printk(KERN_ERR and send the log > > it could be a mistmatch in a quirk table. > > static struct sst_acpi_mach byt_thinkpad_10 = { > .id = "10EC5640", > .drv_name = "cht-bsw-rt5672", > .fw_filename = "intel/fw_sst_0f28.bin", > .board = "cht-bsw", > .pdata = &byt_rvp_platform_data, > > https://github.com/torvalds/linux/commit/ > 7827d66946ad3af734ed46d1d68c23fa6974595c > > cause 10ec5640 can't load cht-bsw-rt5672,revert it can load,just my case on > Androidx86. > > https://bugzilla.kernel.org/show_bug.cgi?id=96691#c97 > Andrew Y only test 4.12 kernel,7827d66946ad3af734ed46d1d68c23fa6974595c > begin in 4.13rc1 > > you need contact Andrew to verify,if he has same case on Ubuntu/Desktop > Linux. Sorry, this is not helping identify the issue. Keep in mind we don't have the hardware handy, so if you do not provide traces or information telling us something useful we are not going to progress. So please add traces in the routine that supposedly creates the problem as well as in the byt_quirk function. It looks like you are a quirk which is not identified and I have no idea why. Also please share the dmi information and alsa-info.sh. Actually there is something odd here, we don't assign the result of the machine quirk: can you try the fix below? struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines) { struct sst_acpi_mach *mach; for (mach = machines; mach->id[0]; mach++) { if (sst_acpi_check_hid(mach->id) == true) { if (mach->machine_quirk) mach = mach->machine_quirk(mach); return mach; // if (mach->machine_quirk == NULL) // return mach; // if (mach->machine_quirk(mach) != NULL) // return mach; } } return NULL; } EXPORT_SYMBOL_GPL(sst_acpi_find_machine); // if (mach->machine_quirk == NULL) // return mach; // if (mach->machine_quirk(mach) != NULL) // return mach; ??? what different with revert ? https://github.com/youling257/android-4.9/commit/f51bda2b0aeba23e5162e38dc2ff69fac45d718a just add a printk(KERN_ERR and send the log) ,how to do ? (In reply to youling257 from comment #25) > // if (mach->machine_quirk == NULL) > // return mach; > > // if (mach->machine_quirk(mach) != NULL) > // return mach; > > ??? the code is commented out, just use the lines above, they set the mach variable in case there is a quirk. Hello, Pierre! In Commentary 1 I mentioned "At the end of audio playback there is crackling sound" in Item 3 and Item 4. I find easy way to reproduce this issue: Playback YouTube video in web-browser, video or audio in mpv or any audio player, or somewhere else, wait until playback is finished, wait 5-15 seconds until app stop playback silence. When it happens, app is closed connection to PulseAudio, and you'll hear crackle. It's much easier to use headphones to reproduce this issue, by the way this is how this issue disturb most of the time - when, for example, Gnome playback notification sound on every notification, there is loud crackle in headphones on, for example, every new message. (However, it also possible to hear it from speaker if you increase volume level. I just tested this, and I hear it quite clearly every time.) https://github.com/plbossart/UCM/commit/9639c15027c78a5166c348d048e9ab782e3258fa#diff-ede37ed29620ae7aa535fe39fceabd69 I tested updated UCM, and can confirm that DMIC2 works on Dell 5855. I assume that automatic switch to headset's mic is not supposed to work yet? The codec data sheet shows a set of registers for pop control, not sure which ones are necessary, maybe Realtek can help. Another work-around is to let PulseAudio play all the time by removing the suspend-on-idle module. You'd take a small battery life hit but this should avoid on/off transitions which create the problem. Meanwhile, I find that 4GB/64GB version of Dell 5855 behave differently from 2GB/32GB version. So far I noticed that: 1. If Speaker output is selected as default: When headphones is not attached and I playback audio only to left channel - speaker playback audio. When headphones is not attached and I playback audio only to right channel - there is silence. When headphones is attached left headphone playback audio from left channel and right headphone playback audio from left channel So in this setup playback to headphones works as expected, while playback to speaker - not. 2. If MonoSpeaker output is selected as default: When headphones is not attached speaker playback audio from both channels. When headphones is attached and I playback audio only to left channel - left headphone playback audio. When headphones is attached and I playback audio only to right channel - both headphones playback audio. So in this setup playback to speaker works as expected, while playback to headphones - not. 3. No audio from DMIC2, which works in 2GB version case, as I stated above. For issue 2 I tried to select MonoSpeaker as starting point, and then find that executing amixer -c1 cset name="Stereo DAC MIXL DAC R1 Switch" off when Headphones is attached get audio from right channel only to right headphone, so I edited UCM like this: > SectionDevice."Headphones" { > Comment "Headphones" > > Value { > PlaybackChannels "2" > JackControl "Headphone Jack" > } > > ConflictingDevice [ > "MonoSpeaker" > ] > > EnableSequence [ > cdev "hw:chtbswrt5672" > cset "name='Headphone Switch' on" > cset "name='Stereo DAC MIXL DAC R1 Switch' off" > ] > > DisableSequence [ > cdev "hw:chtbswrt5672" > cset "name='Headphone Switch' off" > cset "name='Stereo DAC MIXL DAC R1 Switch' on" > ] > } However, according to amixer output > ~$ amixer -c1 cget name="Stereo DAC MIXL DAC R1 Switch" > numid=230,iface=MIXER,name='Stereo DAC MIXL DAC R1 Switch' > ; type=BOOLEAN,access=rw------,values=1 > : values=on This line seems like not executed or not applied on headphones attaching. Unless Headphones is selected in Gnome Settings manually, 'Stereo DAC MIXL DAC R1 Switch' remains on. Did I done something wrong with Headphones EnableSequence or it's some issue? Same story with DMIC2 mic, "Sto1 ADC MIXL ADC2 Switch" and "Sto1 ADC MIXR ADC2 Switch" was off for some reason (while "Int Mic Switch" so EnableSequence probably was executed) and as soon as I set it to on manually - recording from DMIC2 start working. Maybe it's related to fact that if you go to Gnome Settings after login Headset Mic is always (after every login) selected as default for some reason? (Even if it was set to DMIC2 before logout/reboot/poweroff.) Other findings, not sure if it's useful, but anyway: a). https://github.com/plbossart/UCM/blob/9639c15027c78a5166c348d048e9ab782e3258fa/cht-bsw-rt5672/HiFi#L272 https://github.com/plbossart/UCM/blob/9639c15027c78a5166c348d048e9ab782e3258fa/cht-bsw-rt5672/HiFi#L303 Probably should be "Stereo1 ADC L2 Mux" or "Stereo1 ADC R2 Mux" instead of "Stereo1 ADC 2 Mux"? "amixer controls -c1" doesn't mention "Stereo1 ADC 2 Mux" control. b). According to amixer output > ~$ amixer -c1 cget name="Mono ADC R1 Mux" > numid=196,iface=MIXER,name='Mono ADC R1 Mux' > ; type=ENUMERATED,access=rw------,values=1,items=2 > ; Item #0 'Mono DAC MIXR' > ; Item #1 'ADC2' > : values=0 ADC1 seems like is not an option for "Mono ADC R1 Mux". https://github.com/plbossart/UCM/blob/9639c15027c78a5166c348d048e9ab782e3258fa/cht-bsw-rt5672/HiFi#L338 https://github.com/plbossart/UCM/blob/9639c15027c78a5166c348d048e9ab782e3258fa/cht-bsw-rt5672/HiFi#L352 Is this Ok, or there should be something different in this line? > while "Int Mic Switch" so EnableSequence probably was executed
* while "Int Mic Switch" is on, so
I suggest you use the alsa_ucm sequences (see top of HiFi file) with a console and aplay to remove pulseaudio-related issues. In the case of the mono speaker, there is already a sequence which deals with the R->L mixer, e.g. https://github.com/plbossart/UCM/blob/master/cht-bsw-rt5672/HiFi#L228 I am not sure why this sequence is not executed when disabling the speaker, that looks like a bug in PulseAudio to me. As I understand all necessary patches in upstream since Linux 4.15. |