yashsingh1/xdaforums huggingface dataset:
[Samsung Captivate Glide] soadzoor:
well, not only wifi.

working: calls, skype, etc

not working: physical keyboard, virtual keyboard, wifi, the home button from the four capacitive buttons and their lights (so bln neither) , the rear camera (front is working) and probably a lil bit more, but calls are fine. That's why I think we should use every single file from the sgr source related to calls (but only to calls) and use them, we just need to know exactly which files we need.

or we should put our codes and files related to wifi, camera, capacitive buttons and all the others that are buggy to the sgr rom
[Samsung Captivate Glide] bubor:
wifi could be fix easily, just copy /lib/modules to /system/lib/modules.

Probably keyboard could be fixed with copy keychars and keylayout from /system/usr/ in any our roms to the /system/usr.
[Samsung Captivate Glide] trevd:
Hi Folks,

I'm just catching the end of this conversation ..... The only file(s) you need for telephony to work are the ril libraries ( radio interface layer ) that's were all the action happens call wise.

I recommend you guys read

http://www.kandroid.org/online-pdk/guide/telephony.html and http://www.kandroid.org/online-pdk/guide/stk.html

It will probably save you a couple of hours blindly copying files that are useless to your cause :good:
[Samsung Captivate Glide] soadzoor:
there's no such directory as lib/modules in our roms (at least in spyke's rom).. :eek:

but there is in the galaxy R's.. :confused:

Well, I tried again the calls after a dirty flash of the sgr nightly, and it was not working. After making a factory reset is was good, though...
[Samsung Captivate Glide] bubor:
copy /lib/modules directory to /system/lib

galaxy r's rom searches modules inside /system/lib/modules, our roms has modules /lib/modules (in ramdisk), so you need to make copy or just symlink, so galaxy R's rom finds them. That is about working wifi in galaxy R's rom.
[Samsung Captivate Glide] paganinia:
So, reading between the lines, that's advice to stick to ROMs we have and use those guides to copy just the files needed for bluetooth headset calls, rather than entertain this new path of of building up from Galaxy R? Isn't this what kick buttowski, spyke555, thegreatergood, etc., or maybe all this is REALLY going over my head :fingers-crossed:
[Samsung Captivate Glide] trevd:
I think you've got far more out of that than I ever put in :D My post was in response to [MENTION=4836525]soadzoor[/MENTION] comment of

Those guides tell you what files are related to calls! :good:

EDIT: Unless I've completely missed the point, if soadzoor comment should actually be read "releated to bluetooth headset calls" ? If thats the case, I'm an idiot and i'll get my coat! :D
[Samsung Captivate Glide] soadzoor:
Hm.. Meanwhile it turned out that this case is a lil bit more difficult than it seemed first. With the sgr rom, calls were not really reliable, it worked only if I had made a factory reset after intalling and booting it up once. (yea, it was that strange, if I didnt boot it up, but only make the factory reset, calls remained deaf.)

I think we should look for the solution from another way, and not from the TinyALSA-Audio.

this kind of fix uses the stock audiolibs from the sgr ics rom: http://xdaforums.com/showpost.php?p=40762738&postcount=317

The issues I had with it, are very strange as well. As you can see, there must be an additional line in framework-res.apk for "realcalls=on/off", and an additional line in phone.apk for disabling noise suppressional. Without them, the result is no voice in phone calls.

So I installed this zip, unmodified, to test how it workes. Unfortunately the framework it uses, messed up my UI, there were strange symbols in the place of the clock, and stuff. Calls were good though, only issue with it is that I had to turn the speaker on and off to have voice in calls (actually when I turn it simply on, there's voice already from the speaker).

Adam wrote something about an "xposed module". He said he'll try to use it to implement the necessary lines to our framework-res, moreover he'll try to make that manual workaround (speaker on-off) automatical. (not the most elegant solution IMHO, but maybe the only one)

Unfortunately I dont know how to build an apk (nor anything), but if some of you feel the potential in themselves, feel free to try it. To build the phone.apk with noise suppression disabled and with "automated manual workaround", and then build a framework-res.apk from our source but with the necessary "realcall on/off" lines in it.

Then I'm pretty sure it will work like a charm :fingers-crossed:
[Samsung Captivate Glide] Adam77Root:
Well, here it is. The module needs to be enabled in Xposed Framework.
[Samsung Captivate Glide] soadzoor:
!!!! :))

I can't say how thankful I am! :highfive: :good: :victory: I don't know if you're aware of it, but it solved all of our audio issues (I mean there's no need for the manual workaround either! I thought it has to be implemented in phone.apk..)

So guyz! remember to thank Adam, and update the OP, we have a solution at last! :)

EDIT: so I write down the steps below to fix the audio issue (of course do a backup and stuff, and I'm not responsible for any damage, blabla..)

1. Download the attached stocklibaudio.zip to your phone (it's the same as you can find in Adam's fix, but I removed the framework-res.apk from it, cause it messes up the UI)

2. Download the attached XposedInstaller_2.1.4.apk and install it to your phone.

3. Download the attached StockAudio-release.apk and install it as well.

4. Open the xposed installer from the appdrawer, press "install/update", grant superuser for it forever. Then check the "StockAudio[1.0]" from the modules window. Change back to framework window, and press reboot.

5. Hold volume down when rebooting the phone to enter recovery. Flash the stocklibaudio.zip

6. Reboot again, and enjoy :)
[Samsung Captivate Glide] Adam77Root:
Yes, because the speaker on-off switch is also implemented. The Samsung volume bug patch still needs to be applied, but I don't have time for that now. Will do tomorrow.

Sent from my CM10.1-powered GT-I9103
[Samsung Captivate Glide] yohan4ws:
This is really really exciting! Thank you guys so so so much for persisting with this!!

I'll do a nandroid tonight, freshly flash and then try out the patch and confirm if bluetooth HSP is fixed !! This is way better than having to go back to ICS to get bluetooth working!

Smack that thanks button for these guys!
[Samsung Captivate Glide] santimaster2000:
Thank you !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
[Samsung Captivate Glide] m1batt1:
So I installed all this over my existing setup. Unfortunately Bluetooth still doesn't work for me. Also the majority of the phone calls I made or received had no sound. I ended up dirty flashing the ROM again which seems to have reverted everything so now phone calls work again.
[Samsung Captivate Glide] xtacb4:
Hi!, also here no audio in phone call and maybe it is me, but skype audio didn't seem 100% ok, my voice sounded a really little bit deeper.

Reverting to backup now. Keep it up! we are so close thanks to you all!
[Samsung Captivate Glide] Neuntoter:
Sorry to say but no go here either.

Tried bluetooth headset, confirmed stereo audio still working but just static when attempting a call.

Haven't noticed any issue with call audio.
[Samsung Captivate Glide] soadzoor:
I dont know about bluetooth headset, cause I dont have one, but cell calls and skype (and viber and voip, things like those) works here well, keep trying..

maybe try to turn the speaker on and off when calling and stuff.

did you guys set up well that xposed module? it's way too important just to ignore it.

EDIT: hm. After a clean install of cm10.1, I did my own guide to fix the voice. At the first attempt the calls were OK, but the second had no sound. The third was okay, after that no sound..and no sound since, no matter if I do that manualworkaround.

EDIT2: I made a restore to the yesterday-setup and tested again. About twice of 10 attempts I have to turn on-off speaker to have sound, but it always fixes it. I don't know what I did differently yesterday than today..
[Samsung Captivate Glide] Adam77Root:
Elaborating on stock audio libs

I have rebuilt the needed system libs with the latest code and the Samsung volume bug patch enabled. Here they are: http://www.mediafire.com/folder/qmrh1d779mte9/libs [MENTION=4836525]soadzoor[/MENTION]: Could you test and repackage them? (I tested libmedia.so which is responsible for the volume bug patch, but didn't test libaudioflinger.so, though it has to work.)

What the Xposed module actually does: It hooks the com.android.internal.telephony.CallManager.setAudioMode() function and after it is getting called, it passes the realcall audioparameter to the library and automatically switches speakerphone on and off. Well, yes, this is not a nice solution. The hook is only applied in the Phone application.

Source code is here if anybody is interested:

package org.adam77root.stockaudio;

// Android
import android.content.Context;
import android.media.AudioManager;

// Xposed
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

public class Hooks implements IXposedHookLoadPackage {
private String TAG = "StockAudio_Hook: ";

[MENTION=439709]override[/MENTION]
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.android.phone"))
return;

final XC_MethodHook samHook = new XC_MethodHook() {
[MENTION=439709]override[/MENTION]
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Context context = (Context) XposedHelpers.callMethod(param.thisObject, "getContext");
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);

if (audioManager.getMode() == AudioManager.MODE_IN_CALL) {
XposedBridge.log(TAG + "setAudioMode(): realcall=on && speakerphone on-off");
audioManager.setParameters("realcall=on");
audioManager.setSpeakerphoneOn(true);
audioManager.setSpeakerphoneOn(false);
} else if (audioManager.getMode() == AudioManager.MODE_NORMAL) {
XposedBridge.log(TAG + "setAudioMode(): realcall=off");
audioManager.setParameters("realcall=off");
}
}
};

XposedHelpers.findAndHookMethod("com.android.internal.telephony.CallManager", lpparam.classLoader, "setAudioMode", samHook);
}
}
[Samsung Captivate Glide] soadzoor:
Okay,

So here it is, the same as the previous one, but samsung volume bug patch is enabled (thanks to Adam of course)

Feel free to try, test, and share your experiences
[Samsung Captivate Glide] Neuntoter:
The only thing I am testing is bluetooth audio and call audio. I have no VOIP apps or accounts.

bluetooth is still loud static.

i have only done 2 calls so far and no call audio issue.

I don't know what the samsung volume bug is, but my volume appears to work on all 3 output devices through multiple calls.
[Samsung Captivate Glide] salary:
worked on which build bro ?
[Samsung Captivate Glide] xtacb4:
new hypothesis, with logcats

Hi, trying to brind a report here.

- Skype works realyl nicely

- Tried this new stockaudiolibs.zip, I have attached respective logcats.

It seems the issue is totally random, to me at least.

To santimaster2000, that lazy bastard with whom I am testing this thinks the issue is related to the number formating, using or not area code.

I've made some calls dialing manually (without area code) phone call audio worked both ways (not logcat there), but when I called him from my contact list (which has country and area code because of whatsapp) it did't work at first (logcat A), he could hear me perfectly, but I heard nothing.

Afterwards, I made a call which worked (dialing manually to santimaster2000, LOGCAT B), worked, and after the audio worked I checked again dialing santimaster2000 from the contact list and it worked (LOGCAT C).

So it seems onces it works, keeps working, but not sure why it works and why doesn't, we hope this logcats and throwing (my) idea that perhaps it is related to the # formating (area code or no area code).

Anyway, anyhow, I hope this help us get a little closer to the definitive solution.

I'm running CM 10.1 RC2 lib flashed dirty this tests (plus the APKs).

Peace.
[Samsung Captivate Glide] Neuntoter:
Sorry..

I am running spyke555's CM 10.1 RC2

My last post was in reference to the updated zip posted.

I didn't think to try volume prior to that, and in fact didn't know that was an issue even though it was I guess mentioned prior.

No bluetooth headset, just static like before. Can't really test VOIP.

I don't appear to have call audio issues like others have had, but perhaps my sample size isn't big enough to comment.

All still holds true today.

In reference to above poster, I have only been dialing with area code and being dialed with area code (or at least probably), I think I have dialed at least one number from number pad and most from contacts or type a few numbers and contact pops up. No call audio issues.

Not sure if this info would be useful or not but can't hurt.
[Samsung Captivate Glide] yohan4ws:
Anybody else who tries this further, if the person on the other end can't hear you try and toggle the MUTE from the dialer... see if it makes a difference.

I reviewed the logcats posed by xtac in the one where he said it didnt work and a couple of lines showed up saying that i set mute..

06-15 14:32:25.052 D/RILJ ( 671): [0321]< SET_MUTE

This is in Logcat A where he couldn't hear the other person, but they could hear him.

Also try toggling the speaker on and off...

I've yet to try this patch. I need hands free so I reverted back to ICS .. holy crap I hate it compared to the new JB we have.. temping to buy a phone, I started looking @ the droid 4 ... tempting.
[Samsung Captivate Glide] soadzoor:
Now, for the 10th time, I was able to make a call with voice after a fresh reboot, but the second attempt is almost always deaf. If I reboot again, the first call will be ok..

EDIT: well, I was actually trying to call a service number. Now, for days of using this patch, I havent realised ANY bugs neither on regular cell calls, nor skype-like/voip based calls :thumbup:
[Samsung Captivate Glide] dEhiN:
I installed the fix yesterday night, with the latest version of stocklibaudio.zip (the link on page 14). The first few calls worked fine for me. But now no call seems to work for calls I dial out to. That is, when I dial out I cannot hear the other person respond, and when I talk into my phone, all the other side hears is static or silence.I even tried manual workarounds like turning on and off the speaker key, the mute key, sending a touchpad tone from my phone to the other phone, and vice versa. And all with no results. I just tried calling my phone and it seemed to work. However when I put my phone on speaker and said "hey" into the other phone I'm using (which is a landline) I heard the "hey" reverberating like multiple echoes and then it transformed into a feedback reverberation.

I'm not sure how to find and include any logs. However I think since right now I can't seem to make any outgoing calls that have the audio working I am going to uninstall the fix. I'm not sure how to "reset" the stocklibaudio.zip that I flashed. I know I can deselect the StockAudio.apk and uninstall the XposedInstaller.apk. The best I can think of right now is to use Titanium Backup to backup all user apps + system data (minus StockAudio and XposedInstaller), then boot into CWMR, do a backup, and reinstall CM10.1 RC2. Then restore the CWMR backup and the TB backup. I do have a CWMR backup from before I applied the fix. However I'm not sure if just uninstalling StockAudio + XposedInstaller and restoring the older backup will be enough to reset the stocklibaudio.zip flash. Also I've had some new texts and user app data added to my phone since that older backup. My fear is that if I restore the older backup, the app data (especially the new texts since apps that utilize internet access will refresh) will be lost. Any suggestions?
[Samsung Captivate Glide] yohan4ws:
You didn't do a CWM backup before the test ??? eek ...

I would try a reflash of the rom you were running overtop of what you have...
[Samsung Captivate Glide] m1batt1:
I tried the patches without a backup. And when they didn't work I just dirty flashed the ROM again and everything was overwritten.
[Samsung Captivate Glide] salary:
finally this patch worked or not ???!
[Samsung Captivate Glide] xtacb4:
I suggest you read the thread, the answer is very clear.
[Samsung Captivate Glide] hazard1nc:
Just FYI, I've done nothing and my creative labs BT headset/mic work fine. I think its something in the frequency that bugging out the hardware when using CyanogenMod because of the lower level drivers and such might be glitched. Likely a bug from default BT just making itself present.

I'm no dev and I just flashed my glide bout two hours ago.. I'd say its quite smooth. Good rebuild guys :)

Samsung SGH-I927 Cyanogenmod10.1.1

Reloaded™ JB 4.2.2 l

Sony GoogleTV - Untouched Factory

ASUS Nexus 7 32GB WiFi/4G

Custom (Almost Vanilla) Rooted Android 4.2.2|Boot loader?| CWMR Touch.
[Samsung Captivate Glide] yohan4ws:
Whaaa.. this makes me jealous..

Which build did you flash ? Did you add any patches ?

How about a log of it working ??
[Samsung Captivate Glide] scotte9999:
A2DP has worked for awhile - I believe the issue is with calls (HSP or HFP). I suspect your Creative BT stuff is just for streaming audio, no? Have you been able to make phone calls with it (not Skype, but real calls over the Cell network)?
[Samsung Captivate Glide] bubor:
I try to get tinyalsa work, that would fix audio in skype/viber.

Outgoing call may not have sound, if you dial with dialpad, you should get sound. When you call, and no sound, just push a keytone with dialpad, and mostly sound comes back.

Outgoing call without sound:

push a tone:

any idea?
[Samsung Captivate Glide] yohan4ws:
I'll dig into it later, will have to review the source ....

Which repo did you use to get the tiny alsa ?
[Samsung Captivate Glide] Adam77Root:
I assume i9103.

Sent from my LG-P880
[Samsung Captivate Glide] bubor:
Its from i9103, you can found in https://github.com/spyke555/android_device_samsung_i927 tinyalsa_audio repo.

Spyke make one cm10.1 build with it.
[Samsung Captivate Glide] yohan4ws:
[MENTION=4719724]Adam77Root[/MENTION] just to confirm, is bluetooth headset working for the 9103 ?

I was digging up info in what it takes to build a CM (was going to focus on 7.2 since GB actually works w/ decent battery) and it mentioned building the (forgive my terminology) proprietary vendor files ? ... as I have time (which is very infrequent) I wanted to attempt to build a fresh vendor proprietary from scratch ..... this is the one thing that is common across all builds that dman put together....
[Samsung Captivate Glide] yohan4ws:
Which vendor files ? dmans TheCovenant from here ? https://github.com/The-Covenant/proprietary_vendor_samsung
[Samsung Captivate Glide] bubor:
yes, I tried opensource ril too, but no luck.
[Samsung Captivate Glide] xtacb4:
crazy idea and perhaps ignorant but I want to speak it out

Crazy idea, is there anyway we could request something (or everyting to fix this) from samsung to help us with this issues on JB that would help us to fix it? be it source code, documents, whatever.

There has to be a way or something we do, gathering a lot of people or something like a petition, beg, bribe, whatever. Playing both fronts, trying to "hack it" via code patches whatever and going to the source (samsung).

Excuse my lack of grammar.
[Samsung Captivate Glide] yohan4ws:
I pulled this logcat today.. so either its TinyAlsa or the SoftAAC2 Audio Codec.

If it is SoftAAC2 codec, then this might be a fix :: https://github.com/mstorsjo/platform_frameworks_av/commit/cc9833b5db0e96f12daddb90a747fd146627377d if we build using this modified cpp. i haven't cross compared them yet.

This logcat below is only of when I opened skype and hit the call button on the "EchoText" contact, as soon as i ended the call.. audio played back again at normal rate for that sound that skype plays when you end call.

I got rid of the "4800hz not supported" that was mentioned earlier by editing /etc/audio_policy.conf I also just left 44100 for both.

D/AudioHardware( 110): ### setVoiceVolume_l
I/SoftAAC2( 110): Reconfiguring decoder: 16000 Hz, 1 channels
D/AudioHardware( 110): ### setVoiceVolume_l
D/AudioHardware( 110): AudioStreamOutALSA::setParameters() routing=1
D/AudioHardware( 110): AudioHardware pcm playback is exiting standby.
D/AudioHardware( 110): openPcmOut_l() mPcmOpenCnt: 0
D/AudioHardware( 110): AudioStreamOutALSA::setParameters() routing=1
D/AudioHardware( 110): AudioStreamInALSA::setParameters() input_source=1;routing=262144
D/AudioHardware( 110): AudioHardware pcm capture is exiting standby.
D/AudioHardware( 110): closePcmOut_l() mPcmOpenCnt: 1
D/AudioHardware( 110): openPcmOut_l() mPcmOpenCnt: 0
D/AudioHardwareInterface( 110): setMode(IN_COMMUNICATION)
I/AudioService( 373): AudioFocus requestAudioFocus() from android.media.AudioManager@421dfb68
D/AudioHardware( 110): AudioStreamOutALSA::setParameters() routing=1
D/AudioHardware( 110): AudioHardware pcm capture is going to standby.
D/AudioHardwareInterface( 110): setMode(NORMAL)
D/AudioHardware( 110): AudioStreamOutALSA::setParameters() routing=1
I/AudioService( 373): AudioFocus abandonAudioFocus() from android.media.AudioManager@421dfb68
I/SoftAAC2( 110): Reconfiguring decoder: 16000 Hz, 1 channels
D/AudioHardware( 110): AudioStreamOutALSA::setParameters() routing=2
D/AudioHardware( 110): AudioHardware pcm playback is going to standby.
D/AudioHardware( 110): closePcmOut_l() mPcmOpenCnt: 1
D/AudioHardware( 110): ### setVoiceVolume_l
D/AudioHardware( 110): AudioHardware pcm playback is exiting standby.
D/AudioHardware( 110): openPcmOut_l() mPcmOpenCnt: 0

I'm going to flash the skypefix after doing a nandroid backup to see what happens in logcat when running skype...

Something else to test ::

voip_tx {
sampling_rates 8000|16000
channel_masks AUDIO_CHANNEL_IN_MONO
formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_AMR_NB|AUDIO_FORMAT_AMR_WB|AUDIO_FORMAT_QCELP|AUDIO_FORMAT_EVRC
devices AUDIO_DEVICE_IN_COMMUNICATION

I found the above in an audiopolicy.conf here : https://github.com/TeamWin/android_device_samsung_jaspervzw/blob/master/audio/audio_policy.conf Not sure if we make that entry if it would do anything..
[Samsung Captivate Glide] santimaster2000:
Sooooooooooooo, does it work ? :)
[Samsung Captivate Glide] yohan4ws:
No ... :( ..

I tried playing with the sample rates etc, doing logcats with the samsung tablet stuff etc... really not getting anywhere :(
[Samsung Captivate Glide] santimaster2000:
Still, thanks for taking your time to look into this :)
[Samsung Captivate Glide] xtacb4:
Stoopid question ahead:

Cant we just use the drivers/libs/codecs from ICS?
[Samsung Captivate Glide] yohan4ws:
That's one idea I've been playing with but haven't had the time it takes.

I've read up a lot, when compiling ICS/GB/JB we need a device tree, it needs to be made up of somethingboard.mk which is a config file that we enter in all the information like what hardware etc.

The AT&T ICS source is obtainable from Samsungs open source tree... from there I'm lost.

What I'd like to do is build a GB CM7.2, then attempt a CM9 based on ICS ... AdamRoot77 said that the camera wouldn't work, though, so...
[Samsung Captivate Glide] Adam77Root:
We use those libs. GB ones aren't compatible at all.

I just said that camera might not work. I think now that the problem was with some missing nvidia libs. There is more chance that it would work on CM9 though, GB cameras are very complicated.
[Samsung Captivate Glide] xtacb4:
So in despite using those, we have the problems that we have, no BT phone audio, VoIP audio issues, etc (well, those are the main issues).

Thanks.