burzumishi / linux-baytrail-flexx10

Install GNU/Linux on NextBook Flexx 10.1
GNU General Public License v2.0
82 stars 18 forks source link

Possible progress on the audio #7

Closed nicman23 closed 7 years ago

nicman23 commented 8 years ago

There is some progress/traction on the kernel bugtracker, for our uncommon audio card.

the bug is tracked here.

Our is the insyde reference - see description.

PS: do not try anything from other models. It will not work. Our chip does not have 2 pins (or something technical like that) and it will timeout alsa. Basically, alsa, cannot start the chip - let alone produce sound. No amount of hacking/ trying different firmwares will do anything.

tl;dr : follow the link ; pray to Saint Gnusious

nicman23 commented 8 years ago

switching router to b/g made it connect.. however, time is slowed by 4x.

real    0m9.008s
user    0m0.010s
sys 0m0.000s
real    0m0.442s
user    0m0.007s
sys 0m0.000s

that ip being the tablet...

youling257 commented 8 years ago

i care more adjust screen brightness

ghost commented 8 years ago

youling257,

Could you post your dmidecode? I think our hardware is slightly different.

youling257 commented 8 years ago

dmidecode,http://pastebin.com/W1GjqAtc

youling257 commented 8 years ago

Left horn is broken, more than 50% volume, left horn sound isn't perfect.

youling257 commented 8 years ago

microphone can work ?

nicman23 commented 8 years ago

generally yes, but not at the moment

youling257 commented 8 years ago

alsa_cr_hp.sh,alsa_cr_spk.sh,Switching headphones and speakers ;but microphone doesn't work ; microphone on tablet,microphone on headset .

ghost commented 8 years ago

Yeah, the HPs and Mic don't seem to work.

I'm sure the answer lies somewhere in the mixer, but I'm not brave enough to muck with this. You can really phuck up your speakers if you start tinkering with this. `O~o' Too many Bayfail audio disasters for me to get too adventurous, although I'd really like to the get the headphones working...

youling257 commented 8 years ago

it should these for my tablet ,

i will compile now

if (BYT_RT5640_MAP(byt_rt5640_quirk) == BYT_RT5640_DMIC1_MAP)
    dev_info(dev, "quirk DMIC1_MAP enabled");
if (BYT_RT5640_MAP(byt_rt5640_quirk) == BYT_RT5640_DMIC2_MAP)
    dev_info(dev, "quirk DMIC2_MAP enabled");
if (BYT_RT5640_MAP(byt_rt5640_quirk) == BYT_RT5640_IN1_MAP)
    dev_info(dev, "quirk IN1_MAP enabled");
if (BYT_RT5640_MAP(byt_rt5640_quirk) == BYT_RT5640_IN3_MAP)
    dev_info(dev, "quirk IN3_MAP enabled");
if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN)
    dev_info(dev, "quirk DMIC enabled");
if (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER)
    dev_info(dev, "quirk MONO_SPEAKER enabled");
if (byt_rt5640_quirk & BYT_RT5640_DIFF_MIC)
    dev_info(dev, "quirk DIFF_MIC enabled");
if (byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2)
    dev_info(dev, "quirk SSP2_AIF2 enabled");
if (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF1)
    dev_info(dev, "quirk SSP0_AIF1 enabled");
if (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2)
    dev_info(dev, "quirk SSP0_AIF2 enabled");
if (byt_rt5640_quirk & BYT_RT5640_MCLK_EN)
    dev_info(dev, "quirk MCLK_EN enabled");
if (byt_rt5640_quirk & BYT_RT5640_MCLK_25MHZ)
    dev_info(dev, "quirk MCLK_25MHZ enabled");

}

youling257 commented 8 years ago

@jharrison022 , you said “ I'd really like to the get the headphones working” you don't know use alsa_cr_hp.sh、 alsa_cr_spk.sh ? Switching headphones and speakers it from https://groups.google.com/group/android-x86/attach/d1ffc290d6d56/alsa_bytcr_andx86.zip?part=0.1&authuser=0&view=1

In this 20 days ,I used headphones on androidx86,, sometimes, it will no sound, has Current sound ,at This moment ,again “ sh /sdcard/alsa_cr_hp.sh ” ;Then I found ,when has Current sound ,Adjust the volume ,also can solve the problem ;10 days ago, Left horn ,right horn, all broken

I test BYT_RT5640_DIFF_MIC , mic still can't work , how to use alsa swith Headset Mic and Internal Mi ?

youling257 commented 8 years ago

https://groups.google.com/d/msg/android-x86/un74okmr30g/Vm0NKfwfDQAJhttps://github.com/zefie/nxt_andx86_kernel , zefie commented 29 days ago “I don't have this tablet anymore”

nobody can help ours update alsa.sh to switch mic

youling257 commented 8 years ago

I found this https://bugzilla.kernel.org/show_bug.cgi?id=98001

Capture Mixer Settings Headset Mic

amixer -c 0 cset name='Headset Mic Switch' on amixer -c 0 cset name='Int Mic Switch' off amixer -c 0 cset name='Sto1 ADC MIXL ADC2 Switch' 0 amixer -c 0 cset name='Sto1 ADC MIXR ADC2 Switch' 0 amixer -c 0 cset name='RECMIXL BST1 Switch' 1 amixer -c 0 cset name='RECMIXR BST1 Switch' 1 amixer -c 0 cset name='Sto1 ADC MIXL ADC1 Switch' 1 amixer -c 0 cset name='Sto1 ADC MIXR ADC1 Switch' 1 amixer -c 0 cset name='ADC Capture Switch' on amixer -c 0 cset name='Stereo1 DMIC Mux' 0 amixer -c 0 cset name='Stereo1 ADC2 Mux' 1 amixer -c 0 cset name='I2S2 Func Switch' 0 amixer -c 0 cset name='pcm1_out mix 0 media_loop2_in Switch' 1 amixer -c 0 cset name='media_loop2_out mix 0 codec_in0 Switch' 1 amixer -c 0 cset name='codec_in0 Gain 0 Ramp Delay' 50 amixer -c 0 cset name='codec_in0 Gain 0 Switch' on amixer -c 0 cset name='codec_in0 Gain 0 Volume' 80% 80% amixer -c 0 cset name='media_loop2_out Gain 0 Ramp Delay' 50 amixer -c 0 cset name='media_loop2_out Gain 0 Switch' on amixer -c 0 cset name='media_loop2_out Gain 0 Volume' 80% 80% amixer -c 0 cset name='pcm1_out Gain 0 Ramp Delay' 50 amixer -c 0 cset name='pcm1_out Gain 0 Switch' on amixer -c 0 cset name='pcm1_out Gain 0 Volume' 80% 80%

amixer -c 0 cset name='ADC Boost Capture Volume' 3 amixer -c 0 cset name='Mono ADC Capture Volume' 3 amixer -c 0 cset name='Mono ADC Capture Volume' 63 amixer -c 0 cset name='IN Capture Volume' 63 amixer -c 0 cset name='ADC Capture Volume' 31 amixer -c 0 cset name='Mono ADC Boost Capture Volume' 2

ghost commented 8 years ago

@jharrison022 , you said “ I'd really like to the get the headphones working” you don't know use alsa_cr_hp.sh、 alsa_cr_spk.sh ? Switching headphones and speakers it from https://groups.google.com/group/android-x86/attach/d1ffc290d6d56/alsa_bytcr_andx86.zip?part=0.1&authuser=0&view=1

Yeah, I'm aware of these scripts but they don't work on my specific tablet.

wickedbiker commented 8 years ago

Hi I am very excited about this, it appears you have solved a very allusive issue. I am not as technical as you guys, I can flash roms and images and simple things and what I am wondering is can you please make an x86 4.4 r3 .img efi image with this fix applied for guys like me who have a baytrail flexx tablet? I have the flexx 11 but im sure it will work. Im also wondering if others would be able to use this with other baytrail 2 in 1s like the t1000 etc. I do not know how to patch kernals and such but if you can make either a complete flashable .img for efi or give me a how to for idiots on making this work. I would be extremely thankful it is the one thing keeping me from having a dual boot android windows machine.

nicman23 commented 8 years ago

Lol this is not arm (or at least uboot), this is more or less standard x86 hardware. There is no need to flash anything, you just tell the firmware to boot grub or something and then you load any distribution. The kernel is interchangeable with any package manager

youling257 commented 8 years ago

very well,the 4.9 kernel, merge sound already,https://github.com/torvalds/linux/blob/master/sound/soc/intel/boards/bytcr_rt5640.c https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/log/?h=topic/intel 4.9 kernel merge upstream already .

but,may be we still need https://patchwork.kernel.org/patch/9277989/ this patch.

nicman23 commented 8 years ago

sigh, they still do not have updated the quirk table for any of our tablets....

youling257 commented 8 years ago

https://github.com/zefie/nxt_and_x86/tree/x86/files/6/system/etc/alsa ,mic work

nicman23 commented 8 years ago

BTW did anyone figure stateless sound init with pulse?

Haxk20 commented 7 years ago

Hi i finally get to system detects my sound card im not using flexx but Lenovo miix 3 830 but they aare same only display is diferent i get only somee weird noise when playing sound and this in the logs
intel_sst_acpi 80860F28:00: fw returned err -16 intel_sst_acpi 80860F28:00: Wait timed-out condition:0x0, msg_id:0x1 fw_state 0x3 Baytrail Audio Port: sst: error code = -22 andthis goes over and over it was hard even to make system to detect it and now they weird noise like some cracking HEEEELPPP please

Haxk20 commented 7 years ago

and even this in log bytcr_rt5640 bytcr_rt5640: invalid position: , pos = -22, buffer size = 203830, period size = 1199

nicman23 commented 7 years ago

probably fixed as of https://github.com/torvalds/linux/commit/a68bc0d43e1b96c374c4b03eb9baa662778357b3#diff-ad362ef9a62cab4653b68cafab76824b

have not tested it though. Also, there is no need for any dsdt patching and adding any device to the quirk table!

Someone please test and report, so we can close the bug..

youling257 commented 7 years ago

torvalds/linux@a68bc0d#diff-ad362ef9a62cab4653b68cafab76824b ,do you know it is just 2016-08-15 ASoC: Intel: Atom: auto-detection of Baytrail-CR ? 4.9 kernel merge upstream already ,https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/log/?h=topic%2Fintel&qt=grep&q=Baytrail

the new 3 days ASoC: Intel: detect audio routing with CHAN package、3 days ASoC: Intel: bytct_rt5640: change default capture setting,really needn't DMI match quirk,use bios routing https://github.com/plbossart/sound/commits/intel/audio-latest-fixes

u0_a25@x86:/ $ su root@x86:/ # dmesg | grep 5640 [ 9.437365] bytcr_rt5640 bytcr_rt5640: BIOS Routing: AIF1 connected [ 9.447099] bytcr_rt5640 bytcr_rt5640: quirk IN3_MAP enabled [ 9.456736] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF1 enabled [ 9.466226] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled [ 9.489843] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok [ 9.499414] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok [ 9.519981] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp0-port mapping ok root@x86:/ #

Haxk20 commented 7 years ago

If kernel 4.9 will make sound working then i will be really happy im installing ubuntu 17.04 alpha right now then will update to 4.9 kernel and will add UCM and will see

Haxk20 commented 7 years ago

Installed ubuntu 17.04 and now if i type alsactl restore its says no soundcard found on ubuntu 16.10 it find soundcard at least bit here nothing helpppp

ghost commented 7 years ago

4.9-rc5 has all the driver work in place now, just need the quirks for the tablet.

I'm also happy to report I have the headphone and microphone working now by means of re-worked UCM files and new firmware. I just want to make damn sure they're working properly before I post them up on account of the reports of fried speakers. It's not automatic, you need to use the pulse mixer or ucmtool (or whatever it's called) to change the profile. Nobody really seems to have figured out how the jack can talk to the software - probably through a GPIO.

The new firmware required is in the Debian non-free firmware package: fw_sst_0f28_ssp0.bin, 073bb387eb96f8c01d039778086484ac

ghost commented 7 years ago

This is all working for me without issue. So... The the last two issues with audio are lack of automatic headphone/speaker switching and lack of internal mic support. Those two remain a mystery for now (external headset mics work).

New UCM file: http://home.ix.netcom.com/%7Ejjingber/alsa-ucm-5640.tar.gz

New firmware: http://home.ix.netcom.com/%7Ejjingber/fw_sst_0f28_ssp0.bin

"baseline" asound.state file: http://home.ix.netcom.com/%7Ejjingber/asound.state

ghost commented 7 years ago

External headset/mic needs to be wired T/R/R/S.

youling257 commented 7 years ago

speaker、Internal Mic、headset、headset mic,all can work on Android x86 . u0_a25@x86:/ $ su root@x86:/ # dmesg | grep 5640 [ 9.437365] bytcr_rt5640 bytcr_rt5640: BIOS Routing: AIF1 connected [ 9.447099] bytcr_rt5640 bytcr_rt5640: quirk IN3_MAP enabled [ 9.456736] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF1 enabled [ 9.466226] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled [ 9.489843] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok [ 9.499414] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok [ 9.519981] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp0-port mapping ok root@x86:/ #

different quick,same HiFi file,different state file .

Android x86 isn't support HiFi,but support state,use state ,/system/etc/alsa/bytcrrt5640.state,needn't HiFi .

on Ubuntu,setting sound use speaker and Internal Mic ,alsactl store bytcrrt5640 -f speaker,setting sound use headset and headset mic,alsactl store bytcrrt5640 -f headset , copy speaker and headset these two files to Android x86,alsa_ctl restore -f /sdcard/speaker ,alsa_ctl restore -f /sdcard/headset,Switching headphones and speakers on Android x86. /system/etc/alsa/bytcrrt5640.state is speaker or headset file

youling257 commented 7 years ago

“4.9-rc5 has all the driver work in place now, just need the quirks for the tablet” no,it isn't ,the 4.9 don't even has “clk: x86: Add Atom PMC platform clocks” . your tablet isn't z3735f https://github.com/plbossart/sound/tree/intel/audio-latest-fixes for z3735f .

ghost commented 7 years ago

This is a site primarily for Nextbook-style tablets and Linux, so that's where I'm speaking from.

We're happy to help everyone though, but your hardware and SW is sufficiently different that you might have different issues.

And I assure you, it does work on the Nextbooks, and the relevant code is in the kernel, because I'm listening to some great music right now.

ghost commented 7 years ago

The platform clock patch is not a requirement on my tablet if MCLK_EN is not selected.

Tuxman2 commented 7 years ago

Hello,

I've got a z3735F hybrid PC (Medion Akoya). I've got some difficulties with Baytrail bytcr-5640. Do you think that the 4.9-rc5 kernel can help me and/or the final version of the 4.9 kernel available in december ? Do I need the quirks for my tablet ? How to check it ? I think it is similar of the Acer Aspire but i am not sure.

Thanks.

youling257 commented 7 years ago

please you test ASoC: Intel: bytct_rt5640: change default capture settings ,ASoC: Intel: detect audio routing with CHAN package,https://github.com/plbossart/sound/tree/intel/audio-latest-fixeshttps://github.com/plbossart/UCM/commits/master

Tuxman2 commented 7 years ago

For now I use a 4.4.x kernel. I would try with 4.8.8 available in kernel.org website but I must compile it. Do you think it is a good to test the 4.9-rc5 kernel and compile it ?

wickedbiker commented 7 years ago

Is there a way for someone who does not have Ubuntu and limited tech know how can apply a working sound fix for a windows next book flexx 11 z3735f baytrail soc?

I have been trying for over a year now and someone could please create a guide for dummies by either making an ISO, IMG, USB files, or step by step guide for baytrail android x86 sound for dummies, I would be very very thankful as I imagine hundreds of others would be as well.

Thank you

Haxk20 commented 7 years ago

Lets say it like that do we need some patch to 4.9rc5 kernel for sound to work or we need only asound.state and firmware and UCM files ?

ghost commented 7 years ago

Instructions for * Nextbook Flexx 9 and 10 * and \ kernel 4.9-rc5 **

Patch kernel with these patches: http://home.ix.netcom.com/~jjingber/0014-rt5640_audio_on_nextbook_tablets.patch http://home.ix.netcom.com/~jjingber/0018-intel_atom_pmc_platform_clocks.patch

Configure kernel as follows: CONFIG_DW_DMAC_CORE=m, CONFIG_DW_DMAC=m CONFIG_SND_SOC_INTEL_BYTCR_RT5640=m ( * NOT * CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH ) CONFIG_SND_SOC_AC97_CODEC=m

Copy the contents of this: http://home.ix.netcom.com/%7Ejjingber/alsa-ucm-5640.tar.gz to /usr/share/alsa/ucm

Copy this: http://home.ix.netcom.com/%7Ejjingber/fw_sst_0f28_ssp0.bin to /usr/lib/firmware, and symlink it to fw_sst_0f28.bin

Copy this: http://home.ix.netcom.com/%7Ejjingber/asound.state to /var/lib/alsa.

Reboot. You should have sound.

EDIT: And make damn sure you're running PulseAudio, regardless of what you might think of it. Once you experience the rt5640 alsa mixer, PulseAudio will seem like manna from heaven.

youling257 commented 7 years ago

DMIC1_MAP,DMIC2_MAP,in1,in3,only for Internal Mic,if Internal Mic can't work,really need change quirk

ghost commented 7 years ago

Yep, you're correct. This gets the internal mic working. I updated the patch.

.driver_data = (unsigned long *)(BYT_RT5640_IN3_MAP | BYT_RT5640_MCLK_EN),

youling257 commented 7 years ago

so ,what are you dmesg | grep 5640 ?

ghost commented 7 years ago

[ 29.837686] bytcr_rt5640 bytcr_rt5640: quirk IN3_MAP enabled [ 29.837690] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled [ 29.843446] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok [ 29.843522] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok [ 29.843965] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp2-port mapping ok

Tuxman2 commented 7 years ago

Thanks to jharrison022, I will try it this week. The Netbook flexx 10.1 seems similar to my hybrid PC (Medion Akoya) (same processor, same screen (but in 11.6"), same wifi card, 2Gb ram, and bytcr rt5640 card sound). About the compilation of the kernel, what family of the processor have you defined in the kernel configuration ? Atom or Core i5 ? The z3735f processor seems to be in the Core i5 family. About the source kernel, where have you downloaded it ? From kernel.org ?

Note: I think I must modify your 0014 patch for my hybrid tablet (vendor and product name). Can I keep this line : .driver_data = (unsigned long *)(BYT_RT5640_IN3_MAP | BYT_RT5640_MCLK_EN) ?

Must I blacklist snd-soc-sst-acpi and snd_soc_sst_acpi modules ? Else I've got this message : byt-rt5640 byt-rt5640: ASoC: CPU DAI baytrail-pcm-audio not registered

wickedbiker commented 7 years ago

I really wish someone here could please,PLEASE! help me get my sound working. I have the exact same next book as the the 10 only mine is 11" all hardware and software is exact. Please, I do not know how to patch a kernal nor do I have Ubuntu to do so. There must be some way????

wickedbiker commented 7 years ago

Is it maybe possible for someone who has a next book flexx 10.1 with sound working to upload their USB files or .ISO or .IMG

nicman23 commented 7 years ago

@wickedbiker it is too soon for that. If it gets more complete and stable, i ll make a how to. Also please do not spam the issues.

wickedbiker commented 7 years ago

Whatever man! Good luck!!

Tuxman2 commented 7 years ago

@wickedbiker: it is not difficult to apply a patch for the kernel. You need the kernel source, the patches and you must know some commands to edit and compile the kernel. There are some tutorials on the net.

wickedbiker commented 7 years ago

Thank you. Can I do it in android or does it have to be Ubuntu or some other Linux?