[CLOSED] Forcing calls to go through A2DP in Android, while using the phone's built-in microphone. - Android Software/Hacking General [Developers Only]

Hello,
This issue has been driving me insane. It seems like some simple, artificial limitation that no one seems to circumvent. As the title suggests, I'm trying to force phone calls and especially VoiP calls (Discord, whatsapp..etc), to go through the high bitrate A2DP profile instead of the horrible HSP/HFP profile that butchers audio quality and uses the horrible bluetooth microphone.
For instance when music is streamed through a bot in Discord i have to listen to it in horrible earpiece-level phone call quality.
I feel like there's got to be a tweak, a Magisk module, a custom ROM functionality with root access that allow for this, something.. I found a couple old XDA posts about this but no solutions. Oh and also tried Lesser AudioSwitch on multiple Android versions, none worked.
It seems inherent to all bluetooth headphones which is a shame, they could cost 10k $, but the quality would still be sh*t in calls, both in and out, since mic is not close to the mouth.
I always loved Android for giving users more control, but sadly seems like this is more and more going away. What i want here, can very easily be done on PC.
Thank you for your time reading, really hope someone can help.

xdarobb said:
Hello,
This issue has been driving me insane. It seems like some simple, artificial limitation that no one seems to circumvent. As the title suggests, I'm trying to force phone calls and especially VoiP calls (Discord, whatsapp..etc), to go through the high bitrate A2DP profile instead of the horrible HSP/HFP profile that butchers audio quality and uses the horrible bluetooth microphone.
For instance when music is streamed through a bot in Discord i have to listen to it in horrible earpiece-level phone call quality.
I feel like there's got to be a tweak, a Magisk module, a custom ROM functionality with root access that allow for this, something.. I found a couple old XDA posts about this but no solutions. Oh and also tried Lesser AudioSwitch on multiple Android versions, none worked.
It seems inherent to all bluetooth headphones which is a shame, they could cost 10k $, but the quality would still be sh*t in calls, both in and out, since mic is not close to the mouth.
I always loved Android for giving users more control, but sadly seems like this is more and more going away. What i want here, can very easily be done on PC.
Thank you for your time reading, really hope someone can help.
Click to expand...
Click to collapse
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Related

come on guys check this out????and help this brother

there is a nokia phone that while u talking if u play a song both party will be able to listen to music.is there any software like that.that will enable listen to music for both parties while talking on the phone.nokia has a phone like this.unfortunatly i forgot the model.thanks in advance
Post Moved
Please post new threads in the proper forum. If the thread subject is not DIRECTLY (all caps for emphasis) related to the forum in which it is posted, it will be moved or if you continue to do this, deleted permanently.
What tha?
Aside from being in a wrong site, I can barely understand what you are saying.
Should this thread be moved or just closed?
ronyalam, what are you asking for? The Nokia phone model, or equivalent software for an XDA/HTC phone?
V
sound over cellphone networks is far from cd quality though
with the hardware seperation of gsm sound and pda sound that
all pocketpc phones seem to suffer from i doubt that it would work on
them though
so if thats what you are asking i'd say small chance

[Completed] Helping the blind see with the vOICe for Android and external video camera

Hi there,
I'm new to this android stuff, I use a... Uh, okay I use a different phone...
I'm blind and am exploring android with one goal... To see again. Okay, maybe that was a little over blown but let me explain before asking for some help from you lovely people.
There is an app called 'the vOICe', by seeing with sound, their home page here:
(Noticed I can't post links, do a search for seeing with sound and the voice and you'll find the one, it's also on the app market, just don't mistake it for the app accompanying the TV series...)
Who are using a system to help blind see. In a nutshell, it scans an image from left to right and layers sound using different frequencies to represent the image. I'm sorry if I'm a bit vague about this as I've not really had a chance to fully experiment with it. In short, it turns visual images into sound and it would appear that some fantastic results are coming from it and actual stimulation of the visual cortex is happening. In effect, the android device is the a to d, and the user's brain is the d to a. Amazing.
The problem is, currently it's not very usable. It can process a live stream from a video camera built into an android device but, of course, no one wants to wonder around with a 6 inch sudo-tablet strapped to their forehead. There was some excitement with the idea of google glass, however, aside from it not coming to light, I'd not really want to spend several hundred pounds on a device which I can use for just one thing. Okay, now the specifics...
I want to be able to route a webcam, or a similar camera into an android device, the device to accept the images from the camera and to process them into sound using the vOICe app. From what I understand from the Doctor who is pushing this forward and the inventor of the system, android does not yet allow external cameras to act as the native camera device. Can you help?
My perfect rig, and I'm making the huge assumption that it's the rig that most blind people would settle for, is the phone in my pocket, a hat or headband containing a camera, and a pair of headphones, preferably bone conduction as they give better awareness.
My question, my request is for someone to help make my device accept a video camera through usb and use the vOICe app to process the image.
Thank you in advance.
Olz
PS... I'm new to all of this, so I apologise if I've posted in the wrong place. If admins could move this post to the right place if I have messed up, I'd be very grateful.
O
Hi, Thanks for using XDA assist
There is a general forum for android here http://forum.xda-developers.com/android/help where you can try to ask to get expert's help.
Good luck.

[DEV] Porting call audio injection behavior from Google Pixel Dialer to AOSP Dialer

I'm working on a personal modding project, where I take the AOSP Dialer and add some features that I'd like to have. Long story short, for a component of this, I need to figure out how Google has been able to inject arbitrary audio into the conversation/call audio stream.
For years, discussion online, and especially on Stack Overflow, has insisted that:
There are too many upstream limitations, this is impossible
This is impossible, you have to play it over the speaker and hope the microphone picks it up
You can't do this, even Google says so
Indeed, even Google's up-to-date MediaPlayer documentation clearly shoots this down and doesn't mince words:
You cannot play sound files in the conversation audio during a call.
Click to expand...
Click to collapse
However, we know this isn't true. At least, not anymore, and not on Pixel devices. Google's Call Screening feature can "talk" to someone calling your phone, but that synthesized audio is never played audibly to the user. In other words, Google has been able play a Text-To-Speech stream of audio to someone calling your device, doing so silently, clearly to the listener, and without requiring the handset speaker or user's microphone to be "on."
Despite the fact that this is "possible" by virtue of "it has already happened," I can't find any discussion, documentation, info, or anything helpful about how Google has been able to do this. So, what do you do?
The next logical step is to start decompiling the app, but that's easier said than done. I'm by no means an expert in reverse engineering Android apps. Admittedly, you could consider me a beginner. Still, I've found a few things that seem useful, so here's what I've been able to find:
First off, when compared to the AOSP Dialer, the Google Dialer requires an additional privapp-permission that may be of interest: android.permission.MODIFY_AUDIO_ROUTING. I can't find much about what this permission does or how it is used, but it's definitely used by the Google Dialer, and on a stock Pixel 3 XL ROM, that permission is defined in /product/etc/permissions/privapp-permissions-google-p.xml as a privapp-permission.
Next, when decompiling the app, one of the first things I noticed is that a special "IMPL" package containing a playInternal function is class injected/loaded dynamically, and it's adjacent to MediaPlayer code that seems to play audio over a certain channel. The class it tries to load is:
Code:
com/android/dialer/audio/impl/CallAudioPlayer
However, that package isn't present in the list of decompiled classes (there's no "audio" folder under "dialer"), and despite playInternal being explicitly called by a string, there aren't any other classes that seem to define the playInternal function.
I don't know where XDA stands on posting decompiled code, but if you're using JADX, the area of interest is in defpackage/bhk.java.
But if I'm correct, this means that:
You can use MediaPlayer to play over the call stream, contrary to Google's documentation; you just need a special IMPL that allows for that behavior
This (probably?) requires the aforementioned MODIFY_AUDIO_ROUTING permission
If one were to obtain/locate and re-implement CallAudioPlayer.java, you could probably reproduce this behavior in the AOSP Dialer, or any other system app with the necessary permissions
If I'm not correct, then chasing down CallAudioPlayer will be a dead end. Still, the fact stands that Google did this somehow, so the answer must be somewhere.
So... that's where I'm at with this. I don't feel like I'll get much further without some help from more knowledgeable people, since I don't know where this CallAudioPlayer class is located. If it's in the base apk, but obfuscated, I can't find it. And if it's in a system framework or overlay APK, it must be using a different name, since no instances of CallAudioPlayer or playInternal exists in any of the relevant .apks on my system.
If this requires more sophisticated Android system/API modifications, that's fine too. This will end up on a custom ROM, so even if part of this behavior extends outside of the APK, any potential solution can be implemented in an AOSP ROM to achieve this functionality.
If you have any advice on how this may have been done, I really appreciate any and all discussion I can get on this. And if you don't know, I encourage you to ask a friend or someone who might be more knowledgeable when it comes to reverse engineering. Even if no one outright knows the answer to this, I hope to get at least some recent discussion on this topic, so that people investigating this in the future will at least have some sort of starting point.
Thanks for reading!
Hi. I'm no expert on Android (far from that haha) or Reverse Engineering. Though, I'm making an assistant installed as system app in a rooted Android and can also be compiled with the hidden and internal methods and classes so they can be used, like ITelephony, for example (https://github.com/anggrayudi/android-hidden-api) - btw, have you tried to mess with those classes and methods? (Sorry for my ignorance, I've no idea how it is to code/recode a ROM, what you need to use and stuff.) And anyways, I found something you didn't mention up there, so I'm unsure if you already know or not. From what Google says here (https://support.google.com/phoneapp/answer/9118387) in the "Screen calls manually" section, "Your Google Assistant screens the call and ask who's calling and why. You'll get a real-time transcript of how the caller responds.". Though, if it's their assistant doing that, not sure why that permission is on Dialer and not only on the assistant. Anyways, maybe that could be a good place to look at?
EDIT: Maybe also you (or anyone, of course) could look at sending DTMF tones over the call (I only made a quick search on Google, but there may be more that could help on this?). I think it's the same thing as it's inserting audio into the call. Though I can't be sure - btw, if it's really sending audio, then any Dialer app can already do that! But may not be that simple, so no idea at all. Maybe that's hardware thing and not software (>95% probable?). Just trying to give to ideas on where more to research.
Here (https://issuetracker.google.com/issues/36906273#comment107) it's said "I found this app, that can send dtmf after the call is made and active: https://play.google.com/store/apps/details?id=mobi.drupe.app (...)" - name: "drupe - Contacts & Caller ID" (just in case the app gets deleted from PlayStore and then people don't have their name to search for, only the package). If it's audio that it's being injected then it's possible, since that app seems to do it already, and the answer could be there too and might be good to look for the keys' frequencies on the code? Again, sorry for my ignorance on anything wrong I said. As I said in the beggining, I'm far from expert/experienced on Android.
I'll also be trying to search on how to send DMFT tones over a phone call. Could help, maybe. And if only a frequency could be sent for any reason, at least it's already cool to send some beep haha (preferably different from the ones of the keys or it might be confused with a key press by the other side, depending on who we're calling).
Late reply, did you solve this? I would like to build call features on Aosp. Best!

Experience with ASHA (Hearing aids)

I'm looking for information pairing bluetooth hearing aids with the 8T. Evidently there is something known as ASHA that the phone needs to be compatible with.
My problem is, I just got hearing aids for the first time and the app from the manufacturer connects fine to the hearing aids and allows me to control the volume but it does not stream audio to the devices.
Anyone with knowledge of this?
Go into accessibility, hearing enhancements, hearing aid support. Your Bluetooth should be on and link it to the device.
Does the aid manufacturer have an Android app?
blackhawk said:
Go into accessibility, hearing enhancements, hearing aid support. Your Bluetooth should be on and link it to the device.
Does the aid manufacturer have an Android app?
Click to expand...
Click to collapse
They do have an Android app. I was able to find in the accessibility settings an option to enable hearing aids, but so far still no streaming audio.
Look in Developer options too.
Sound and connection settings.
Android tends to bury advanced settings well.
blackhawk said:
Look in Developer options too.
Sound and connection settings.
Android tends to bury advanced settings well.
Click to expand...
Click to collapse
I think I'm finding out from the manufacturer of the hearing aids that it's only compatible with Androids with a separate device that goes between the hearing aids and the phone.
What do the specs for the hearing aid say?
There is only a small statement on the manufacturer's website that lists the devices they are compatable with and the 8T is in their list. It is compatable with their app that controls the volume of the hearing aids. But there is supposed to be more options like streaming media and phone calls. I'm just going to have to switch brands of hearing aids to one that works because I am not switching to an iPhone, I refuse!
You'll need to do some heavy reading to sort this out. I know very little of the protocols and what's available. Start doing searches and collecting links etc...
I am in the same boat - I have an Umidigi A9, and the Chinese devs have not yet included ASHA support (even though ASHA is available as of Android 10). I am exploring the possibility of rooting my phone to manually include ASHA support.
Do a Google search for "Android ASHA compatible phones" and see what devices your manufacturer supports.
Samsungs tend to have user and bt friendly/customizable UI's, however not sure if this extends to ASHA devices.
blackhawk said:
Do a Google search for "Android ASHA compatible phones" and see what devices your manufacturer supports.
Samsungs tend to have user and bt friendly/customizable UI's, however not sure if this extends to ASHA devices.
Click to expand...
Click to collapse
I already know my device is not officially compatible; my goal is to make it compatible.
sacrophyte said:
I already know my device is not officially compatible; my goal is to make it compatible.
Click to expand...
Click to collapse
You might find something specific for that device on the Samsung or similar forums.
The Samsung one is fairly large and occasionally helpful. Not the right manufacturer but it may give you some ideas.
blackhawk said:
You might find something specific for that device on the Samsung or similar forums.
The Samsung one is fairly large and occasionally helpful. Not the right manufacturer but it may give you some ideas.
Click to expand...
Click to collapse
will do, thanks
blackhawk said:
You might find something specific for that device on the Samsung or similar forums.
The Samsung one is fairly large and occasionally helpful. Not the right manufacturer but it may give you some ideas.
Click to expand...
Click to collapse
Sorry for another response/question - the Samsung forum is HUGE, with a ton of subforums. Have any specific forum in mind that I can post to? I was not able to find a general Samsung forum - seems like I have to pick a specific product first.
sacrophyte said:
Sorry for another response/question - the Samsung forum is HUGE, with a ton of subforums. Have any specific forum in mind that I can post to? I was not able to find a general Samsung forum - seems like I have to pick a specific product first.
Click to expand...
Click to collapse
Use Google search, that's what I do.
Just add "samsung forum" or such to the search.
Playing around with the search parameters may lead to other sites as well.
When I tried a search not a lot popped up, but I only tried for a few minutes.
Try this search if you haven't already: "One plus phone,ASHA (Hearing aids)"

[CLOSED] Record phone call "downlink" side only? [WITH ROOT]

Hi,
I'm trying to record phone calls as .wav files but I want to record the other side only. I tried using Axet's Call Recorder, but I have many issues with it. I installed the recorder as a system app in /system/priv-app and gave it all permissions. However, I noticed that no matter what source I choose (be it "voice line", "auto" or "system RAW"), it always picks up my mic and the recording would be silent if I hit mute. I have seen other apps that supposedly give you more control over what is recorded but I have yet to find one that works as intended. My solution must: 1. record the actual audio output completely digitally and be purely the "downlink" side only, i.e. what plays through the earpiece/speaker but at the level before it actually plays, and 2. be compatible with all android versions regardless of what permissions it may need.
First, I'd like to know what the source should actually be - the digital source for the output audio that guarantees purity and highest quality.
Second, I'd like to know if there is an app that does just that or otherwise what do I need to create one myself.
Keep in mind full root access is available and modding too.
Any help is appreciated tremendously!
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Categories

Resources