-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wired headset buttons cause no reaction. #5
Comments
This seems to be the device: I think we need to create "apq8064-tabla-snd-card_Headset_Jack.kl" but I don't know the keycodes for this device and I don't know how to find them, too. Any idea? |
I have installed the cm 10.2 4.3.1 made by cofface in my system2: do you think I can get those keycodes using that rom? |
I don't know if that works but you could try to get the keycodes via CWM. |
I tried it, but I got no reaction... :-( |
Does this app show the keycodes? |
Unfortunately, not. |
Ivan's ROM (see the other issue #6 ) reads the Scan Code as 226. |
Hi M1cha, today, with the 3/12/2013 release, I tried again the wired headset: no luck. |
Hi Guys, I have the same problem, am using an IPhone headset. During Phone calls the mic doesn't work. I can hear the otter person, they can't hear me |
Vosje: that's a different problem and has nothing to do with this issue. |
Ok sorry, I'll make a new post for this one then. |
I’ve tested this, the internal mic doesn’t work when I connect my headset Van: M1cha [mailto:notifications@github.com] Vosje: that's a different problem and has nothing to do with this issue. — |
does that work? |
Nope. Flashed it and cannot see any change. No reaction, Key Test apk does not notice the presses either. |
the same problem with headphones on mi2, headphones from xiaomi |
can u confirm that this is fixed in latest build from linuxx? |
I don't have buttons on my headset, so I can't try, but if it should works if m1cha pushed the commit before 18-01-14 22:30 (GMT+1) |
Works only increase the volume button. |
dump the keycodes in CWM, and check with input test apps if the buttons are at least recognized |
same as before |
ah ok that's the reason. u don't have play, vol+ and vol- u have play, forward,rewind |
ah and btw please ceck the keycodes with the app I've posted above. |
Just for those interested: it appears that "vol +" and "vol -" on Apple headset use different resistance (Ohm) values than "rewind" and "forward" on some Android headsets. And what may work on one Android, may not necessarily work on another Android. I wonder, if the driver/hw in Mi2 can catch all the "key presses" of various headsets or just some. (I have only a single button headset, however.) At least Play/Pause button seems to be the same accross platforms. http://www.instructables.com/id/Galaxy-Nexus-and-others-headset-remote-with-medi/ |
On CM @ 2014-01-25: I was surprised, that presses of the single button on my headset generates different scanCodes in Keytest.apkg, namely 256, 257, 258, 263. Quite randomly, without a clear pattern. scanCode 263 maps to Keycode 25 (volume down), scanCode 257 maps to Keycode 79 (headsethook), while the others are not mapped to any Keycode. I have shot a screen cast, if needed. On ivan's ROM [1], the presses of the button alwaysgenerate the same scanCode 226 (which is mapped to Key code 79. http://xiaomi.eu/community/threads/aosp-4-4-kitkat-rom-aosp-by-ivan.22682/page-10#post-195465 Could it be a driver issue? Edit1: the same headset (Klipsch) behaves the same on another Mi2S phone with M1cha's CM11. A different headset (iFrogz audio) generates just a single scanCode 256 on the same ROM. |
@M1cha: how about opening a thread at xiaomi.eu to find out what scanCodes exist for various users with current release of your CM11? For myself, I am just fine to edit apq8064-tabla-snd-card_Headset_Jack.kl after flashing CM11, but resolving the bug might be a bit better ;-) |
Here is what I got with my philips uptown using the play/answer button with CM11 by cofface: Keycode:79 |
Same problem.
Got the m1cha recovery. |
Same problem here Volume + works as - |
I have Xiaomi Gold Pistons (headset with 3 buttons) and Xiaomi MiKey (in-jack button), both don't work correctly in CM11 (but work okay in stock MIUI, so hardware is okay). No buttons seem to work (not even play/pause button on the headset, at least it won't control Apollo player). I tried testing buttons in the CWM I have (some 6.0.x I believe), and it detects play and some volume (up or down - don't remember), but doesn't detect neither other volume button nor MiKey presses. I'm using CM11 m8 snapshot. How can I debug this thing? :) P.S. Tried KeyTest app - it, too, detects volume up and play/pause presses (though it says "keyCode=KEYCODE_UNKNOWN" for both), scan code for volume up is 262, for play is 256. |
I think I see why Xiaomi headset buttons don't work - they use different resistance values for buttons compared to what the kernel in @M1cha build expects. I've compared "sound/soc/msm/apq8064.c" in kernel source between @M1cha version and official (at least that's what I found) version from Xiaomi (https://github.com/MiCode/mi2_kernel), and they differ in the function that I understand as setting button resistances: at static void *def_tabla_mbhc_cal(void) somewhere in its code there is this:
I think I may try to compile my own fork of @M1cha kernel with those lines taken from Xiaomi to fix Xiaomi headset buttons. |
I've fixed (at least on my device) both Xiaomi Pistons (gold, v.2) and MiKey with CM11 m8. Pull requests are: |
If anyone is using CM11 m8 stable release - here's CWM-flashable patch that fixes MiKey and Xiaomi Pistons At least on my Mi2S it works perfectly after that. Give it a try and let me know if it fails. |
Thank you JustAMan, i´ll try it this evening and comment here. |
It's new kernel (based on latest cm-11 version from M1cha repos) which fixes buttons on the headset and MiKey (at least on my device). It should be applied via CWM just like any other update package - via "install zip from sdcard" menu. |
Perfect, I´ll give a try! |
Works fine on my mi2s (32GB) A lot of thanks JustAMan & Co. |
Can I commit this to cm for u? (I'll give u credits ofc) Sent from my Xiaomi Mi 2S
|
It has been merged to CM already. |
Better :P 2014-09-08 17:47 GMT+02:00 M1cha notifications@github.com:
|
Hello guys, the new values for btn_[high|low] have an affect on scan codes. My earbuds report various scan codes for a single button press - IMHO the precision of Mi2s is better than the precision of resistors in the earbuds. I can simply assign the same Key Code to the various Scan Codes in "apq8064...Button_Jack.kl" config file to resolve the problem for myself, though it would be better to have the "bigger" config file available for everyone. This is a good solution as long as the reported scan codes do not overlap with Volume Up/Down of other earbuds. To check if there is an overlap or not, I would appreciate if you can report again the Scan Codes for your earbuds. After installing the patched kernel (or at least CM nightly 2014-09-09), will you please run the Key Test app and report:
The Volume Up/Down being ignored is expected behaviour, since Apple uses a different technology for these buttons (probably capacitators instead of resistors). Thnx a lot! |
Earbud: Xiaomi Piston Keytest inside recovery(m1cha): keytest.apk in CM 11 + JustAMan patch: keytest.apk in miui |
@milankni I can provide you a "debug" kernel which dumps measured voltage in dmesg, and we can try to see if specific values need to be tuned. |
@JustAMan http://forum.xda-developers.com/showpost.php?p=34185923&postcount=24 My Klipsch earbuds may have a buggy button (worn out?) leading to some inconsistent values and now I guess a workaround of assigning mutliple scanCodes to a single Key Code should not be pushed upstream. |
@milankni does you have different scancodes in MIUI, too? It could be a kernel bug. |
@milankni You just flash it with CWM, boot your phone, wait till it finishes booting, plug your headset and press some buttons. |
Im trying to test things for u guys, but isn´t working too well. I´ve installed the test program by JustAMan, entered the console and when I wrote the line, I get the message: I´d tried Any tip? |
adb is used to establish a connection with a android device. Since you're using terminal emulator you don't need that connection. Just remove the "adb shell" part of your command. |
I´ve tried and get this (if search by "mv", I got a lot of lines, I think the good ones are lines with "determine button") Here they are (only copy those who arent repeated) <7>[ 66.280517] tabla_determine_button: micmv=18, btn=0 And this, I suppose that they are detecting when I plug it: I hope will be helpful |
@shivwolf Nevertheless it's good to see you were able to use my debug kernel :) |
Hahaha By the way,im trying to learn how to build a ROM,how it works, and how to use some commands or debugging tools. But you are un true, got the pistons and now are working. |
@M1cha |
@shivwolf @milankni |
@JustAMan
|
@milankni |
My Klipsch are the Android variant with a single button. I opened the button+mike box and cleaned the micro switch (similar like here https://d3nevzfk7ii3be.cloudfront.net/igi/PnTfYP4BawrolrqD , just a bit tinier). Now it seems that the same scanCode is always returned. |
@milankni |
I have a Mi2S 32GB bought directly from xiaomi.
I also own a wired headset from xiaomi as well, which is working fine with the MIUI rom (ok, it's not the best, but it's working... :-) )
When plugged in the phone using this rom, I can hear the sound through it, but pressing the buttons has no effect.
I even tried watching the logcat, but I couldn't notice any change in it when pressing the buttons on the headset.
The text was updated successfully, but these errors were encountered: