[Q] [AUDIO] low-level audio - Android Q&A, Help & Troubleshooting

Hello everyone, this is my first thread on xda, I hope not wrong to post.
My problem is this:
I would like to create an app that for the moment only do two things, reads from the audio in of the device, and write on the audio output.
I created the app using the classes AudioRecord and AudioTrack provided by Android but I have a latency which is about 500ms and then makes the app unusable.
I would then read and write to the lowest level possible, even using JNI. From what I understand, Android has an abstraction layer called HAL that allows a generic access to the hardware without worrying about the platform.
So my question is: can I from my app, call the functions of the HAL level? And if so, how? And how do I know what are the functions of the HAL level that I can call?
I would be very grateful if someone could solve my doubts. Or if anyone has a link to some document that explains it, understandable for beginners, I would be very grateful.
Thank you all.

Related

“Fake” a bluetooth call with RFCOMM

Hey Guys, I also posted this question on Stackoverflow.
okay, here's my problem: I am developing an app that reads out SMS while driving and therefore connects to to a bluetooth speaker (mono) using startSCO. However, there are some devices (especially car entertainment systems that lack A2DP functionality) that only react on calls.
So my idea would be to initiate a "fake" call (read: send the String with Caller ID etc to the device so it rings) and - if the user "picks up" the call - then send the normal output with the VoiceCall Stream.
As Android supports RFCOMM, this should be possible I guess. However, I can't find any information about this particular topic on the internet.
Would you say it is possible? And if yes, do you have any information you can share with? Like how to initiate the call and so on.
Thanks!
forceu said:
Hey Guys, I also posted this question on Stackoverflow.
okay, here's my problem: I am developing an app that reads out SMS while driving and therefore connects to to a bluetooth speaker (mono) using startSCO.
Thanks!
Click to expand...
Click to collapse
Whether you have code for that?(connecting to mono headset) I am in need of it
Sure ^^
http://developer.android.com/reference/android/media/AudioManager.html#startBluetoothSco()
But I think this is SDK8+ only, before that there is a function called AudioManager.setRouting or something like that =)
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

[Q] A way of streaming audio from microphone over Wi-Fi

General discussion > Questions and Answers > [Q:Android] A way of streaming sound from microphone over Wi-Fi
^ If the question could be removed from the general discussion, that would probably be ideal. I humbly appologize for misplacing it, won't happen again. ​
Hey there, how's your day going?
Now, this is not a can-it-be-done kind of question, because the IP Webcam app already does just that - it exposes the audio from microphone via http on localhost:8080/audio.wav and .ogg for anyone to access.
The thing is that the app also does a pleyhora of other things - most notably video streaming, which makes the app one hell of a bad boy when it comes to battery consumption. And not only that, the audio streaming - as implemented - is severely delayed and the format / compression used can't really be adjusted to alleviate that issue, which in turn renders it impossible to turn the droid into a remote microphone (which would be an awesome thing to do ).
And since I don't think the author has ever released a source code (I stand to be corrected), I'm asking whether there is an app dedicated just and only to audio streaming (obviously couldn't find any, hence I'm asking) or whether I'll have to act a dev once again.

[Q] Can the microphone record in 2 apps at once?

One thing I've noticed... is if I use the voice recorder app, and then go into a call, the voice recorder stops.
And so, it doesn't let you record audio using 2 apps at the same time.
My question is.... is this a feature built into the hardware, or built into the software?
Like, would it be possible to rewrite the operating system to allow 2 apps to use the record function simultaneously, or does the hardware prevent that?
Thanks.
Note: I posted this in the HTC Hero section of the site, but I'm asking, again, in general for Android... As in, IF a phone can't record with 2 apps at once, is that going to be due to hardware, or software limitations? Could the software be modified to allow it? OK. Thanks again.
For example, on Windows, I can record with Windows voice recorder, and with Audacity-- at the same time, and both produce a recording.
So I know there's no hardware limitation with my computer's hardware.
I'm wondering if this is the case with an HTC Hero.
Does anyone know the answer to this question?
I think it is software related both at kernel level (a preemptive kernel would be required) and in the dalvik vm itself.
Anyway, even if someone should be able to set the software, the way android manages multitasking would require at least a quad core phone for such a trick to work.

[Q] Best ROM for Audio/Video/Mic Quality

Folks,
I am experiencing low mic volume output after installing cm-10.1-20130411-EXPERIMENTAL-p5110-M3 on a Samsung Galaxy Tab p5113. The application we are testing is video and in this case the mic volume is really low. This is a tablet to tablet skype like video session. Here the other end perceived very low Audio coming from the Tab with the CM-10.1-20130411-EXPERIMENTAL-p5110-M3. Stock ROM mic levels were fine. I read through a bunch of the forum and saw some folks noting this issue with other older CM builds.
Is there any file/value that I can modify at the OS level to manipulate the Volume output of the Mic?
Any other ROM's that you might recommend that handle mic volume/Audio/Video better than the ROM mentioned above?
Thanks in advance.
-red
Aplha Widget
Just a follow up, This may help someone..
I was able to install the Alpha Widget app and it has a mic gain control function. Does anyone know what this gain control actually manipulates within the Android OS/Kernel? It would be great to manually manipulate this mic gain at OS / CLI level.
Thanks in advance.
-red
red_tx said:
Just a follow up, This may help someone..
I was able to install the Alpha Widget app and it has a mic gain control function. Does anyone know what this gain control actually manipulates within the Android OS/Kernel? It would be great to manually manipulate this mic gain at OS / CLI level.
Thanks in advance.
-red
Click to expand...
Click to collapse
You could take a look at this http://www.slatedroid.com/topic/38594-microphone-level-very-low/ (posts 16 & 17 onwards are quite interesting) and this
http://www.alsa-project.org/main/index.php/Main_Page
If you find any data would be interested to see what you get
sent from my still superb Google I/O 7510 (xda hd)

[Q] Audio input to output

Hay guys I'm running second generation moto e 2015 LTE. I was wondering if anyone could give me a hand in trying to figure out how to route my Androids audio output to its input. From inside the Android it self. You see I'm trying to play music and prerecorded audio. That way it streams properly and can be heard by others in the correct quality. Having the idea that it can be accomplished somehow in the root. I work with C++ but I'm kinda of at a loss here. Any help would be greatly appreciated. I apologize ahead of time for writing the title backwards.
This should be possible by manipulating the ALSA settings within Android. Unfortunately, this is not particularly easy to do.
This page has a bunch of good information that might help you:
http://stackoverflow.com/questions/...dio-creating-alternate-sound-paths-in-android

Categories

Resources