yashsingh1/xdaforums huggingface dataset:
[Huawei Ideos X5 U8800] ksatta:
I will release my changes to the franco.kernel in this thread before franco includes them in his kernel for the upcoming releases. So this is a "pre-release" thread for franco.kernel, for the changes I'm making.

v2 (included in [16 SEP] franco.Kernel)

- Speakerphone echo fixed. Works with normal calls, not with Skype (or other voip apps probably). Skype still works like before, echo with speakerphone mode.

The fix can be disabled with

echo 0 > /sys/module/snd_soc_msm7kv2/parameters/speakerphone_echo_fix

You can post in this thread how it works. It always uses speaker_mono_tx instead of speaker dual mic broadside dev.

- Removed some logging from msm7x30.c (left there by Huawei. They must have a logging fetish or something :))

mod_v1 (Included in [11 SEP] franco.Kernel)

- "Use phone's mic with headset"-feature is now user configurable.

By default uses phone's mic with headset/headphones/line-out. So if you want that, no configuration is needed.

To use headset's mic create a file called "10headsetswitch" in "/system/etc/init.d/" and paste the following to it:

"echo 0 > /sys/module/snd_soc_msm7kv2/parameters/headset_mic_switch"

Future plans

- Fix speakerphone echo in Skype. Investigate the volume problems (max. volume is too high, etc..).

Flashing instructions

- Boot to recovery

- install from zip

- choose francokernel_X_ksatta_vX.zip.

Notes for devs

The latest franco.kernel has logcat disabled by default, to enable it put this in .config:

CONFIG_ANDROID_LOGGER=y

To enable kernel debug messages (can be seen with dmesg):

git checkout 0c1adc36ed u8800-kernel/kernel/printk.c

NOTE: disable logging again before releasing anything, probably slows down the phone quite a bit when logging is on.

Credits

ksatta - use phone's mic with headset

stockwell - user config for headset mic setting

franciscofranco - the franco.kernel

Thanks

wmi543

genokolar

And everyone else if I forgot to mention someone.

Files

franco.kernel-sep11+ksatta_v2.zip - Zip file to flash phone.

franco.kernel-sep11+ksatta_v2-src.zip - V2 source for devs. msm7x30.c file is from u8800-kernel/sound/soc/msm. Also includes compiling instructions.
[Huawei Ideos X5 U8800] stockwell:
To make it set to using the phone mic at boot, save the following script into /system/etc/init.d/. Call it whatever you like just with a two digit number at the start (ie. 10headsetswitch)

echo 0 > /sys/module/snd_soc_msm7kv2/parameters/headset_mic_switch

As mentioned this is already configurable in Miui using x5 settings so you don't need to worry about making the script yourself but the voice quality might not be very good (will be fixed for the next version) unless you use the kernel attached from ksatta.
[Huawei Ideos X5 U8800] vlc_marcos:
Please could explain how to install this kernel? Because I read the file that you have attache and in the end I finish like in the begginign without knowing how to do it.

Is only need to do by the recovery with the zip file ans what about the secund zip file the smaller one?

Sorry but Ian sure that I am not the only o w that is asking this.
[Huawei Ideos X5 U8800] ksatta:
Yeah I was a bit unclear, sorry. To flash boot to recovery, install from zip and choose my zip.

edit: Updated first post, flashing instructions
[Huawei Ideos X5 U8800] vlc_marcos:
Ok thanks. And for what is the small zip file?

So I will use in this last miui without any problems correct.

Will I get battery problems?
[Huawei Ideos X5 U8800] franciscofranco:
Sigh man, I'm growing tired of your questions everywhere in every thread you can find. This is just my kernel compiled with a different file to make this "Use phone's mic with headset"-feature is now user configurable." avaliable.

No it won't take coffees for you, no it won't explode your device, no it won't turn it into an airplane and fly in circles above your head, and no it won't make you rich beyond imagining.

Sorry for the smallish OT ksatta, it ****s me reading stupid questions everywhere.

Very nice job like I told you before ;)
[Huawei Ideos X5 U8800] vlc_marcos:
First of all Ian not from your family so stupidity is not in my genes. Secund if you are tired go to sleep.

I didn't ask to you, so you don't need to react like this. Don't be a small kid.

When I don't know I ask.

So Franco don't give me your ****y opinions when I don't ask for then.

Thanks
[Huawei Ideos X5 U8800] stockwell:
I think it's a fair question, I was wondering why my phone wasn't making me coffee :confused:

You can already do this in Miui, have been able to for a while. Flashing this version should make the voice quality better though.
[Huawei Ideos X5 U8800] ksatta:
Yeah, like franco said, the v1 is just user-configurability for the headset mic thing.

For anyone else wondering, I will report any changes I make in the first post. So the zips here won't have any other changes compared to franco.kernel, except the ones I report in the first post.
[Huawei Ideos X5 U8800] ksatta:
I updated the first post to be less confusing. the smaller file is only the source file, only needed by devs.
[Huawei Ideos X5 U8800] GolfCranK:
Mate, you seriously need to get a grip and settle down. Maybe lay off the espresso a bit. I know you are doing good things with your kernel and everyone appreciates that and is grateful. However, almost every post you make is aggressive and condescending. Ok so you have it all figured out, that's great. But the majority of us are just struggling and muddling along enjoying Android and trying to learn and contribute as we go. When you attack and belittle most posters it just make you look like a wanker.

May I suggest: if you don't wish to assist then simply don't respond. Someone else will or maybe no one will in which case the post will recede into the past and the poster will look elsewhere.
[Huawei Ideos X5 U8800] Tommixoft:
Maybe you, or anybody here can write me pm with very short info how to compile kernel [what parrameters should pass to it] and make zip package to be installable to phone? Once i tried to compile but image was 2x times bigger than original realese so i was afraid to test it :D

it's PASSION man! :D Who wants to read nice post i want to read **** words man! :D
[Huawei Ideos X5 U8800] ksatta:
Maybe you were looking at the uncompressed Image file? zImage is the correct file. But anyway the -src.zip contains compiling instructions, I created them today with a fresh install of Ubuntu 11.04. If you test my instructions and have any problems, inform me and I'll update the instructions.

Before you edited you asked about what v1 does, there's a whole lot of text in the first post, but yes, it only makes the headset mic switch user-configurable :) Future releases might have more changes :)
[Huawei Ideos X5 U8800] ksatta:
Actually my version uses phone's mic by default. I made it default because franco.kernel has been using phone's mic by default. So, to avoid confusion:

If you want to use headset's mic use "echo 0 > /sys/module/snd_soc_msm7kv2/parameters/headset_mic_switch" in the script.

If you want to use phone's mic, don't do anything :)

edit: This applies to the v1 kernel in this thread, miui uses headset's mic by default. Reason above.
[Huawei Ideos X5 U8800] fjsferreira:
Man, this kernel fixed the only issue I had with Oxygen, and call quality is even great! Now I won't change ROMS ever in the next months (unless Huawei releases official Gingerbread). I'm not gay but this is true, I LOVE YOU!!!!
[Huawei Ideos X5 U8800] Tommixoft:
MAN! Thanks! finally someone wrote how to properly compile. THANKS!! You're awesome :D
[Huawei Ideos X5 U8800] stockwell:
lol sorry I edited it now.
[Huawei Ideos X5 U8800] ksatta:
My theory about the speakerphone echo is that the audiolibs in 2.3 roms use the wrong routing. They're probably now using the same microphone dev. id. as normal mode, when they should be using the "speakerphone mic" dev.id.

I wasn't able to confirm this yet, didn't get my debug messages out of the kernel yet :) Normal logcat works, but the kernel debug messages don't show up in it. Also I couldn't find a syslog file.

But I'll continue another day.
[Huawei Ideos X5 U8800] Tommixoft:
Ksatta i see you good with freaking linux stuff and sound :D So can you make that recording audio and video - audio quality to be good not some arm ****?

I found that codec is here arch/arm/mach-msm/qdsp5v2/audio_amrnb.c How to make that system uses different codec or this but with better sample rate ant bit rate, i can change this in file but i can't find the specification of this codec so maybe it's not supporting 44.1Khz sample rate or even 16Khz.
[Huawei Ideos X5 U8800] ret4rt:
Thanks ksatta for this ! :) Was exactly what needed. Btw instead of setting that init script couldn't just change the value from 1 to 0 or it is restored after every reboot?
[Huawei Ideos X5 U8800] stockwell:
You need to revert the changes made to printk in this commit: https://github.com/franciscofranco/...50ded33735dadaab815ad25e92d4db5326daef#diff-2
[Huawei Ideos X5 U8800] franciscofranco:
Exactly. I disabled every type of debugging and logging, sorry 'bout that.
[Huawei Ideos X5 U8800] ksatta:
This sounds like an interesting thing to change. I might look into it later after I fix the speakerphone-mode echo. Actually I'm quite a newbie with linux kernel etc, but I spent a lot of time figuring out the headset mic / phone mic thing, so now I know something about the audio routing :)

You have to do it after every boot, that's why you need the init script.

Actually I saw that in the git but then I tried to build oxygen's default kernel etc... Got stuck on that because dev.android.org wasn't working (because of some hack attempt?). Well anyway, I kinda forgot about that git commit after all that. Thanks.

It's a good optimization and probably speeds up the phone quite a bit. No need to be sorry :)

edit: There's way too much debug logging left in the kernel by Huawei. Actually I have to remember to remove Huawei's MM_DBG etc.. lines from msm7x30.c to make it more optimal :) Also I'm working on a Java App for my phone and whenever I use logcat to debug it, I have to grep out a bunch of stuff to make any sense of it, for example there's ~10 lines of debug messages every second or so when WiFi is active :D
[Huawei Ideos X5 U8800] Tommixoft:
Yes... this phone does way too many logging!! It looks like it's main purpose :D logcat never sleeps :D even in deepsleep logs some activity and its clearly effects I/O i think and ram and battery of course.
[Huawei Ideos X5 U8800] ksatta:
It might also speed up the phone a bit if all logging lines would be batch-removed from the kernel source. But on the other hand, I don't know if there's much difference if the logging has already been disabled otherwise, like it is now.
[Huawei Ideos X5 U8800] Tommixoft:
Ksatta maybe you're thinking about putting your version of kernel in GIT? Franco does not update his Git after he makes it good :D so maybe you will :D i would like to clone it..and if you thinking about making more changes like to make change that will force android to use better audio codec for voice or video recording - i think it's good idea to share source on git :) Also others will be able to implement changes to their roms/kernels if they would like to :)

Also i hav ea question - how da hell you know what files to edit?? there are hundreds of unused files non needed processors and so on.. why nobody deletes them? :D
[Huawei Ideos X5 U8800] andreasha:
How do you know they're unused?

Sent from my Ideos x5
[Huawei Ideos X5 U8800] Tommixoft:
cause they have nothing to do with huawei :) many types of processors there and so on. Huawei uses only msm, but there is a lot of different ones too. and kernel source is almost 400MB with more then 35 thousand files in it. So i think like 20 thousand is not needed :D

For noob like me is very hard to understand what file is used and do i have to edit it or some other..that's why cleaning unused files is great idea :D
[Huawei Ideos X5 U8800] andreasha:
I don't think it's compiled with all thoose files but I could be wrong.
[Huawei Ideos X5 U8800] franciscofranco:
I'll fix it in a few hours, didnt had time before.

I would really like better audio quality, but thats really not my department.
[Huawei Ideos X5 U8800] stockwell:
I'm quite sure it's against the GPL to distribute it without them.
[Huawei Ideos X5 U8800] ksatta:
I got the speakerphone echo fixed. I'll probably compile and release it when Franco updates git (currently doesn't compile), so that this thread

will have the same version base as franco's thread. Works with normal calls, not with Skype.

Details:

I replaced dev speaker_dual_mic_broadside_tx (dev_id 12) with speaker_mono_tx (dev_id 10).

I don't think speaker_dual_mic_broadside_tx has any real use on the Huawei U8800 (probably not implemented, just uses normal mic or something).

Anyway the speaker_mono_tx dev uses probably two mics, because it removes echo and noise. Without speakerphone mode

handset_dual_mic_broadside_tx dev_id 11 is used, so replacing dev id 12 with dev id 10 shouldn't cause any problems.

Edit: I just noticed that maybe video recording or something uses the speaker_dual_mic_broadside_tx? Anyway this will be found out when ppl test it with all different apps etc.. My fix currently always uses the speaker_mono_tx instead of speaker_dual_mic_broadside_tx.

Skype speakerphone mode still has echo. I might test later if it works with 2.2 roms and if it does, figure out what the difference is. Has anyone tested skype speakerphone mode with a 2.2 rom? (stock for example).

Skype doesn't call msm_voice_put() at all, which may be the reason? Or actually now that I think about it, I think it didn't call it with stock rom either, if I remember correctly from the spring. Otherwise it seems to use the right device speaker_mono_tx.

Also Skype might have internal echo cancellation which is not working very well?

I haven't tested, but Skype will probably also have echo when using a line-out cable.

Oh yeah, and just to make it clear, Skype has echo in speakerphone mode with or without my fix, so it's an improvement :)

Edit2: Also both of my fixes would probably be possible to fix from the roms' audio libs, but since I'm now somewhat familiar with this msm7x30.c, it's fastest for me to do it like this. And if it works with no problems, it's good. That's the main thing :)
[Huawei Ideos X5 U8800] ksatta:
As Franco said, he'll fix it soon. I think it's better if I just release the source file(s) here, atleast now since I'm only editing one file. If in the future I change more files, maybe then it'd a good idea to branch out or something, but then it'd have to be merged with franco's new changes too etc.. Also, other devs can already use my changes, from the -src.zips.

This is the most time-consuming part :) In the spring I spent 1 week finding the right file to edit, then I did my mod in ~1 day. I went through Android sources (the java part), as well as kernel sources. If you want to read more about my "epic adventure", you can read my older thread http://xdaforums.com/showthread.php?t=1082974. The first file I edited I found by googling the headset mic issue, and somebody suggested in some forum it might have to do with file x.

My understanding is that it's based on the same linux kernel as desktop machines etc? And as stockwell said it might be against GPL to distribute without all the files. Also when updating the kernel to a newer version, it's much easier if most of it is identical to the generic linux kernel. This is just according to my knowledge, I'm quite a newbie in this, so correct me if I'm wrong :)
[Huawei Ideos X5 U8800] ksatta:
Looks like franco updated the git. I'll probably compile tomorrow, still have to remove all my logging etc... Clean it up. Now it's time to watch some TV then sleep :)
[Huawei Ideos X5 U8800] franciscofranco:
Suggestion: make a pull request into my git (I think that's how it's done) and when I accept it it gets automatically updated in the kernel. Obviously all due credits are and will be given.
[Huawei Ideos X5 U8800] Tommixoft:
can you or others write how should look that pull command? :D if it's not important to get all source than i don't need it.
[Huawei Ideos X5 U8800] andreasha:
If you have a fix and think it fits press edit while looking in the file on github, then do you fix there and add a comment what it does. Very easy when I first tried it.
[Huawei Ideos X5 U8800] Tommixoft:
God damn franco still not updated full of errors source.. do i ever get luck to compile it!? What's the point of GIT if it is in non working mode... it takes 30minutes to clone git and another half hour to compile and after this i always getting errors! :D Now with cpu governor :D

and why git does not have function to get only modified files not all of them again :D or it have? :D
[Huawei Ideos X5 U8800] vlc_marcos:
tommi do you know how to undervolt? because, i spoke with different persons and they are saying that the kernel of frnaco is not undervolted, do you something about this?
[Huawei Ideos X5 U8800] ksatta:
Sounds good. I'll use it with v2 (damn, I should really name my releases better :D ). It's probably a push request, not pull, but anyway I'll check it out.
[Huawei Ideos X5 U8800] Tommixoft:
I never heard of that word :) I'm just making first steps into linux, i was managing my VPS it was CentOS but it was different than this work :D I just want to make few changes that is needed for me i'm not thinking to release it :D i have 0 knowledge in C or Java.. just php and delphi but that helps too :D And the one thing that metters to me - franco kernel works on my phone so i don't care is it undervolt or no.. :) i don't even know what that means :D
[Huawei Ideos X5 U8800] andreasha:
How did you sync with git (any quick tip)? :)
[Huawei Ideos X5 U8800] stockwell:
Nice work.

The echo fix is something that absolutely should be in the audio libs. The headset mic thing can probably just stay where it is, or maybe if we move it into where it does jack detection that would be better.

I'll get the audio libs done now, shouldn't take long.
[Huawei Ideos X5 U8800] stockwell:
Might be an idea to try dzo's or my kernel since it's much more stock and should build fine. If you can't get one of those working then it's something to do with your build environment.

Getting that first kernel built is a pretty big hurdle, but once you've done one then you'll be more confident. It's lucky for you guys that I modified anykernel to work with our phones.. packing a boot image (and getting it to boot) is pretty hard the first time too, and extremely frustrating!

This might sound harsh, but if you have to ask that then you may as well quit. You need to be able to solve problems on your own otherwise you'll have no chance of doing anything productive.
[Huawei Ideos X5 U8800] vlc_marcos:
so stockwell, it means that you can do somenting about what i said? because i could be great for the battery
[Huawei Ideos X5 U8800] stockwell:
Undervolting? Yeah I'll do some experimenting. I can't remember but the kernel I distribute with my latest miui version may even have a 50mV undervolt on the lowest frequency, not sure if I ended up using that one or not though.
[Huawei Ideos X5 U8800] franciscofranco:
Getting a little off-topic here but I really have to answer this one. I completely agree with Stockwell. It took me a few days to get a working modified kernel (based on stock ofc), and I already had a vast experience building kernels for another Android phone. If you can mod the stock kernel then awesome, start to learn how the kernel works.

And yes, we all have to be very thankful to Stockwell, he managed to mod anyKernel package to work with X5. Speaking about myself it really speed up my kernel testing, and I mean really a lot, and it makes the updating process for the users way more simple and less problematic :)

For concluding, the last paragraph from Stockwell is very important, and nothing more needs to be said about it.
[Huawei Ideos X5 U8800] andreasha:
Sorry I had a typo in my username (case sensetive... -.-) when trying to clone.

I'll try compiling your kernel stockwell.
[Huawei Ideos X5 U8800] Tommixoft:
You just first need to GIT clone adress to the git

and after that if git is changed you should do: cd to working dir then GIT pull adress to the git

----------------

Ksatta - i found your work to be very cool! and superb. But i have a question, i slept only 3 hours so maybe my head don't work. But my phone do not have any problems with sound, everybody hears me good, not echo..or something. So i think my phone works as it should be so if i apply your kernel do i will lost noise cancellation function? Cause today i was outside i called my girl and only after 5minutes i somehow mentioned i'm outside and she was thinking i'm at home..so the sounds proves to be super.So i just wanted to know does this will not make bad things to good working devices? :D

BTW suggestion to you - people saying that 3.5mm jack have non standard output, so i think there should be possible via kernel to switch pins to make it "normal". I think people would love that too :D

---

Well i compiled my first demo kernel with lowered backlight min level and it seems to work :D So Franco kernel is good for me.But i may try to find Stockwells as well.

THANK all of you it's awesome to see what people can do when there is cooperation..huawei should pay you money for your work :D
[Huawei Ideos X5 U8800] andreasha:
Thanks Tommixoft.

@Stockwell well kinda harsh it was only a typo... works fine now was worried that it was the ubuntu beta that was acting up (like it does, alot it didin't like the upgrade within wubi)

Still they see me compilin', they hatin' :D
[Huawei Ideos X5 U8800] stockwell:
I modified the audio libs so that it routes to speaker_mono_tx instead of broadside and there's no echo but the mic isn't very sensitive.

Is it the same when you do it from the kernel?
[Huawei Ideos X5 U8800] ksatta:
I was just finishing my post to reply to you all, typing how great the open-source community is etc.. Then I had a kernel panic in Xubuntu :D Probably my comp. It crashed quite often in Windows even when it was new. But oh well, here goes again..

I remember in the spring I had to boot to bootloader mode, copy over the boot.img, then remove the battery etc :) Thanks to stockwell, much easier now.

I think it's ok for ppl to ask newbie questions, but maybe there should be a different thread/forum for those? I don't know.. Just my opinion.

Was this in speakerhone mode? (With phone's own speaker and mic, when you push the "speaker"-button during a call) If it was, there might be some differences in the audio hardware in different versions of the phone. I think I'll make my fix user-configurable anyway, so it's easier to test with and without it.

Do you mean that you can't have it on full volume because it "overshoots", or whatever the correct word is. The amplitude of the sound waves is too high, so it sounds distorted, don't know what the correct word is in English :) Actually I had forgotten about this. I first noticed this a while back with a 2.3 rom. It's possible it also otherwise affects audio quality, even on lower volumes. When using the 3.5mm jack as a line-out the sound should be unamplified, but now I think it's amplified (like it should be for headphones), or something like that.. I'll probably look into it later. Thanks for reminding me :)

---

Good job! Yeah, the open-source scene is great. It gets very addicting, very fast. I have to pace myself :) Maybe I'll take a break after I release my v2 today.

I tested it yesterday with one phone call and the other person said it sounded good. I'll release my fix today, with a possibility to enable/disable it so that ppl can test with and without it. Also I could send you a logging enabled kernel and if you could use that with your audiolib changes, then we could see if it does everything the same way. Both functions msm_voice_put() and msm_device_put() should get called in the kernel for it to work right. Atleast with the headset mic switch the quality was bad when the other function's fix wasn't in use.