[Q] Audio Routing issue with microphone - Android Software/Hacking General [Developers Only]

I have an app that calls the AudioSystem class (android.media.AudioSystem) using reflection. All methods are static and no instantiation of the AudioSystem class occurs.
The method used in AudioSystem is setDeviceConnectionState.
The code also will call AudioManager methods like: audioManager().setSpeakerphoneOn(false);
What I have noticed is that a few people running stock 4.1.1 have contacted me stating that apps like Google Now, Voice Search, Camcorder will no longer work, when my app is running. I remember that Cyanogenmod had some issues with Google Now, and Voice Search and was wondering if anyone had some ideas as to what I should look at.
I know that as of 4.2 all of the microphone input constants for setDeviceConnectionState have changed, but these users are running 4.1.1.
The big problem is that I can't reproduce the issue. As you know emulators aren't much good when debugging audio issues.
Thanks in advance !

Related

[Q] Voice Search

It always concerns me when issues such as this just "fix themselves" but this is exactly what has happened to me here.
Maybe a temporary glitch in Goggle's cloud this morning.
Never mind...
For some reason, I can't get voice search to work on this tablet.
I can record and playback my voice using the "Recorder" app.
So my microphone and speaker hardware is OK.
I can see the mic level working when I try to speak into the search box.
It's as if the voice sample isn't being sent to the cloud or I have an app missing.
Any ideas? Anyone else have his working or not?
This is on a brand-new, non rooted US A700.
Build Acer_AV043_A700_1.017.00_PA_CUS1

[APP][4.0+] AudioBT: Use Bluetooth headset for GPS and notification audio

Hi
I've created a small app that automatically switch your device into Bluetooth call mode when an app is playing an audio or when your GPS is giving directions. The benefit is that it will cut what you're currently listening from your car audio system to play the incoming call audio and go back to your current listening on your CD, MP3, FM radio, etc.
There are two ways of using AudioBT.
-One is a background service that monitors the audio focus and turn on the Bluetooth SCO proile when another app is temporarily requesting the audio focus. Unfortunately the first second of the audio might be cut when using this service (to be fixed with upcoming Xposed hook). Some applications do not request the audio focus properly so this might not always work.
-The other approach is an integrated TTS engine. Any app using tne Android TTS service can use the AudioBT TTS service for sending text to speech. AudioBT will automatically turn on the Bluetooth SCO profile before playing the text. Any TTS service or language can be selected in the AudioBT TTS parameters.
It is still experimental and user's feedback is appreciated.
Thank you!
https://play.google.com/store/apps/...51bGwsMSwxLDEsImNvbS50dXJib2xlZC5hdWRpb2J0Il0
Service intents (for use with Tasker)
com.turboled.audiobtplus.ON : Cat = Default, Target = Service. Turns ON the AudioBT Plus service.
com.turboled.audiobtplus.OFF: Cat = Default, Target = Service. Turns OFF the AudioBT Plus service.
com.turboled.audiobtplus.SCO_ENABLE : Cat = Default, Target = Service. Enables Bluetooth SCO channel audio.
com.turboled.audiobtplus.SCO_DISABLE : Cat = Default, Target = Service. Disables Bluetooth SCO channel audio.
com.turboled.audiobtplus.PLAY : Cat = Default, Mime Type = audio/*, Data = file uri (file:///*), Target = Service. Plays an audio file through the bluetooth channel. No need to call SCO_ENABLE or SCO_DISABLE. Specify file name in Data.
To play notifications through Bluetooth with Tasker, create a new task with the following steps:
-Say to file (Misc), text = %NTITLE, file = /sdcard/Download/1.wav. Use standard TTS engine (Pico, Google, SVox, etc...), EnhancedTTS or AudioBT+ TTS are not supported.
-Send an intent (Misc), action = com.turboled.audiobtplus.PLAY, cat = Default, Mime type = audio/*, Data = file:///sdcard/download/1.wav, Target = Service.
Add a new profile with Event -> UI -> Notification and link with the task created above.
Add the task to any profile triggered on Notification *,*. Make sure Tasker is enabled in your Accessibility parameters.
Re: [APP][4.0+] AudioBT: Use Bluetooth incoming call for GPS audio
TurboLed said:
Hi
I've created a small app that automatically switch your device into Bluetooth call mode when an app is playing an audio or when your GPS is giving directions. The benefit is that it will cut what you're currently listening from your car audio system to play the incoming call audio and go back to your current listening on your CD, MP3, FM radio, etc.
There are two ways of using AudioBT.
-One is a background service that monitors the audio focus and turn on the Bluetooth SCO proile when another app is temporarily requesting the audio focus. Unfortunately the first second of the audio might be cut when using this service. Some applications do not request the audio focus properly so this might not always work.
-The other approach is an integrated TTS engine. Any app using tne Android TTS service can use the AudioBT TTS service for sending text to speech. AudioBT will automatically turn on the Bluetooth SCO profile before playing the text. Any TTS service or language can be selected in the AudioBT TTS parameters.
It is still experimental and user's feedback is appreciated.
Thank you!
Click to expand...
Click to collapse
Links please
Sent from my GT-N8000 using XDA Premium HD app
hoss_n2 said:
Links please
Click to expand...
Click to collapse
Well, it was right there on the Google Play image... I added an hyperlink below.
New version 2.2.0 to be published soon on Google Play. Attempt to fix compatibility issue with some devices. If you tried this app on your phone and it didn't work, try the upcoming version.
Thanks
I've tried your app with my alpine cde 133bt, but the tts-messages were still send to the normal bluetooth audio-out channel, so I have to manually switch from tuner to bluetooth mode. Both the service and the custom tts-engine didn't work. Your app is exactly what i've been looking for, so let me know if there is anything I can do, to help fix this.
my setup: I have a motorola razr running on android 4.0, which connects to the radio with the HFP and with the A2DP profile. turning a2dp off in the bluetooth settings redirected the tts-messages to the mobile speaker.
sebistan said:
I've tried your app with my alpine cde 133bt, but the tts-messages were still send to the normal bluetooth audio-out channel, so I have to manually switch from tuner to bluetooth mode. Both the service and the custom tts-engine didn't work. Your app is exactly what i've been looking for, so let me know if there is anything I can do, to help fix this.
my setup: I have a motorola razr running on android 4.0, which connects to the radio with the HFP and with the A2DP profile. turning a2dp off in the bluetooth settings redirected the tts-messages to the mobile speaker.
Click to expand...
Click to collapse
Hi,
I've got other similar complains from Motorola users. I have not been able to figure out the problem yet. Are you able to provide me with a Logcat when you start the AudioBT service ?
Also can you test BTMono, which is a similar app but that leaves the audio channel open (incoming call) ? If BTMono works my app should work. However BTMono is from a different author and uses more permissions.
Thanks
i tried btmono yesterday, it works. I will get back to you with the logcat later
sebistan said:
i tried btmono yesterday, it works. I will get back to you with the logcat later
Click to expand...
Click to collapse
At the same time, you could try 2 test versions I created. The first one adds more permissions (Bluetooth_admin and network_access). The second one use Call mode instead of Communiation mode. Please tell me if one of these works on your device.
Here's the link to both APK:
https://docs.google.com/folder/d/0B2XwV7ab33OAY2tiVVRTWGRRTVE/edit?usp=sharing
here is the logcat record, i hope it helps. i started recording, started your service and pressed the test audio button.
i also tried the two test versions, they both did not work, same behaviour as the original one
edit: aparantly i'm not allowed to post external links (or edit my post for 5 minutes). i've attached the logcat output
sebistan said:
here is the logcat record, i hope it helps. i started recording, started your service and pressed the test audio button.
i also tried the two test versions, they both did not work, same behaviour as the original one
Click to expand...
Click to collapse
Thanks for your help. Where's the log ? Ah there it is
sebistan said:
here is the logcat record, i hope it helps. i started recording, started your service and pressed the test audio button.
i also tried the two test versions, they both did not work, same behaviour as the original one
edit: aparantly i'm not allowed to post external links (or edit my post for 5 minutes). i've attached the logcat output
Click to expand...
Click to collapse
Hey sebistan, thanks A LOT for your logcat. I saw an error about a missing BROADCAST_STICKY permission. I've create a new version AudioBT-Sticky at the same link: https://docs.google.com/folder/d/0B2XwV7ab33OAY2tiVVRTWGRRTVE/edit?usp=sharing
Your help is a blessing. Now if that works, I'll be more than happy to give you the unlimited version if you send me your email address (in a private message).
yay, that would be great. unfortunately, it is still not working, but we are getting closer
when i start the new version, my car audio system switches briefly to calling mode and back to the tuner. But after that, all other sounds are still beeing routed to the standard speaker. I've attached the logcat
sebistan said:
yay, that would be great. unfortunately, it is still not working, but we are getting closer
when i start the new version, my car audio system switches briefly to calling mode and back to the tuner. But after that, all other sounds are still beeing routed to the standard speaker. I've attached the logcat
Click to expand...
Click to collapse
There is something odd going on, now that it successfully go into communication mode, it cannot track the audio focus. Your phone/ROM is acting way differently than some others.
I've attempted a fix (AudioBT-focus.apk), please test. I turn off commuication mode between audio, however I fear that it will take too long to switch on and you will lose the first seconds of audio when a message is playing.
I believe the TTS should work (even without the fix above) as it doesn't use audio focus. You can test by playing the sample in the settings.
Thanks!
After looking at Android source code I figured out the focus problem was fixed in JB Android 4.1.1 and up, so anyone running my app with ICS have the same problem. If you have success with my fix above and you don't see a significant delay when playing the audio I could publish a new version with a workaround for ICS, otherwise I will have no other choice than to put a notice regarding incompatibility with ICS.
the fix also does not work, the audio test is still coming from the music channel. the tts-service is not working either. in none of the test versions. i guess i have to wait for the jb update.
sebistan said:
the fix also does not work, the audio test is still coming from the music channel. the tts-service is not working either. in none of the test versions. i guess i have to wait for the jb update.
Click to expand...
Click to collapse
Please provide me with a logcat with the focus fix... There's probably something else going on. If you get the incoming call to come up during initialization, that's a good start.
sorry, i had a lot to do, could not make it any faster. Here is the logcat from my focus-fix-test, same procedure as last year
sebistan said:
sorry, i had a lot to do, could not make it any faster. Here is the logcat from my focus-fix-test, same procedure as last year
Click to expand...
Click to collapse
Hi seb,
I finally decided to install ICS on my phone. And indeed, it doesn't work well. I see that I cannot prevent the call mode to steal the audio focus in this Android version. For now I don't have any idea out of my head.
However, TTS works on my phone with ICS but not with the fix version. Make sure you turn off the AudioBT service when testing TTS. And maybe send me a logcat while testing the TTS (playing the "Listen to an example" in the TTS settings).
Hi I just wanted to tell you that I recently bought a dice mediabridge for my car and the only issue I was having and it was really bothering me was that when I was in Sirius satellite mode and my phone connected through Bluetooth that the phone calls would come right through but not the navigation if in use.This bothered me because it was a lack of integration that should be there. I searched the web for a few weeks pretty thoroughly and discovered that this was a very common issue reported in threads but no solution at all from anyone.The other day I came across your app and it is wonderful it does exactly what I was looking for and I'm sure once word gets out it will get alot of downloads. My only issues with it is that it does seem a little buggy which I totally understand.A few times the other day it wouldn't activate and I had to reboot my phone to get it to work I have a Verizon note 2. And also a few times the audio just came through as static and not understandable but after playing with it got it to work again.Is development still being worked on for the app? Thanks again.
bman12479 said:
Is development still being worked on for the app? Thanks again.
Click to expand...
Click to collapse
Hi bman.
First thanks for your comments, those are always appreciated. I wrote the app for myself after knowing that some older non-Android phones and iPhone had this capability. Thanks to Android, the API allows to route audio through Bluetooth SCO although only in very recent versions of Android. Hopefully someday it will be better supported by the OS.
My app has an unexpected success since the beginning, however sales have decreased in the last few weeks. About half the people downloading the trial have ICS 4.0 which is not very well supported except for the TTS engine and nothing I can do to fix it yet.
I've pretty much stopped doing updates as the app has become stable enough on most devices; however I don't have much feedback from users and am not aware of all the bugs and if they are fixable. I'm still ready to publish fix whenever one is found.
Cheers!

[Q] Google Now, Sound Search, and Voice Typing do not work!

I'm relatively experienced with rooting and romming my phone (been doing basic stuff since the first android phone), but I can't seem to figure this one out... I'm rooted and I have a 4.3 ROM running with it's respective kernel. I've tried other 4.3 ROMs and some 4.4 ROMs as well, but I'm consistently having the following problem: Google Now doesn't hear anything from the microphone, Sound Search doesn't hear anything, and Voice Typing doesn't hear anything. If I plug in a headset or headphones with a microphone they all work fine...
I tested the microphone in other apps like sound recorder, and it works fine. So I'm totally confused as to why Google's apps seem to be incapable of activating the microphone... It's quite aggrevating, as it renders these features near useless.
Anyone have any ideas?

Mic not working for voice calls (works for google voice search and speakerphone) Mi4i

Hi all,
I'm having a problem with my mi4i when I have voice calls the microphone doesn't register any sound. It works fine on speakerphone and on doing recordings which leads me to believe this is software and not hardware.
I've tried removing the google voice detection stuff by inhibiting it, as i saw elsewhere this was a problem. I couldn't find any options about noise cancellation which may be malfunctioning.
I'm currently using the most up to date MIUI rom (MIUI 7.0.3.0, android version 5.0.2 LRX22G, kernel 3.10.49) but was previously using the ressurection remix. Both times I had the same problem; I was hoping that with the update to the latest MIUI it would fix this problem, but alas it hasn't.
If anyone has any ideas of how to fix this it would be appreciated.
Also, thanks to all the people out there working on ROMs and fixes!
Thanks
zero

Samsung galaxy s8 plus audio problem during videocalls

Hello!
I have a major issue during videocalls using google duo, skype where if there are any background noise around me, i can't hear the person i am talking to. The audio cuts off. It has to be silent around me in order for me to hear the person i am talking to. Is there any fix to this problem? I have already reset the phone but the problem is still there.
mic (over) sensitivity? perhaps some will stop by and know the file and file entry to edit.
any of this type setting elsewhere (Settings, the app itself, and sound modification yo have installed, eg Viper, etc... that you can check/get to?
I have no sound modification installed. I checked the settings but there seems to be no part adressing this issue. The same problem happens when i use different apps like skype, google duo and signal. Could it be a hardware problem? The microphone works fine when i record a video or recording audio.
Maybe.
Rooted? If so, and you've done a full, clean install, and sure that the install is working ok, maybe try another custom ROM.
Normal calls work, as I get you it's (just) video calls? Another possibility, I'd consider looking up mic sensitivity and ways to decrease it. On the OnePlus One I am aware there was a configuration file folks could mess with to try and resolve that phone's mics over sampling. That was a common issue for many.
Have you tried turning the volume down and see if that has any effect?
Wish I could offer more ideas, I have used video calls maybe 3 times in 8 years.
The phone is not rooted. This problem occurs only when i use internet based videocalls (skype, google duo). The volyme is not usually high when i call. Thank you for your time, hopefully i will find a solution soon.
Frustrating. Good luck.

Categories

Resources