[Q] USB Audio from Lollipop with "USB-aware" application - Android Q&A, Help & Troubleshooting

Hello everyone!
First of all, I'm new to this forum and I hope I'm on the right section.
I am developing an Android app that uses USB in host mode. The USB device can stream audio (both playback and capture), but can also send/receive other data (no more than a few bytes) in interrupt/bulk mode.
The idea is to use USB Audio driver provided by Lollipop for audio, and the USB methods provided by the SDK for the other data.
When using Lollipop's USB audio driver, the OS "automatically routes audio playback and capture appropriately". However, the documentation (source.android.com/devices/audio/usb.html#hostApplications - sorry for the link, as a new user I can't post external link) also says that "the automatic routing may interfere with applications that are USB-aware".
I tried the automatic routing and it works. The problem is the following: when Android captures or plays audio, it seems that all the data sent/received in the same direction by another way are blocked (like interrupt ones, through the SDK). That is to say, if I play audio from the smartphone, I can't send any other data to the device (and if I capture, I can't receive).
Additional information:
The bandwith is not an issue: I succeeded to receive both "audio" and data using Libusb in isochronous mode for audio and the SDK for other data. But I can't write an entire driver for USB Audio with Libusb, and I'm not sure that a simple isochronous transfer does the trick correctly.
The device is recognized by a PC both as a microphone and a speaker, so this is not a device issue.
The phone is not rooted.
Is there a way to solve that?
Also, assuming I can use the Lollipop's driver, does anybody succeeded in sending and receiving audio at the same time?
Best regards,
Victor

Related

Make Android device a MIDI one

Hello! I'm thinking about this by a while. Actually the Android MIDI software you can find on Google Play use MIDI over IP or rtpMIDI technologies to send the MIDI signal via WiFi. Knowing how a network works, specially the wireless one, I think it's a waste of _time_. I thus thought why not passing the signal over USB? That's not a problem, just create a peer program on the target machine and comunicate via sockets or similar - not. My idea is to setup the application so that the target computer can see the MIDI device with no special drivers or programs or hacks (MIDI over USB is a standard).
Is it possible then to let the Android device be seen by the computer as a MIDI device, or at least "even" as a MIDI device?
Thanks.

[Q] Use android device as a USB sound card or DAC/amp?

The sound card on my laptop is ageing and was not very good to begin with but the one in my phone is great. Is there a USB (not wireless) solution for my PC to detect my phone as a sound card and have the DAC in my phone process the digital audio signal and for me to listen through my phone's headphone jack?
Basically is there a solution that allows me to use my phone as an external usb headphone DAC/amp?
I've done some googling but not found any viable solution yet.
The first one I found that works is WiFiAudio, which you can get to work over USB by enabling USB Networking.
You have to run software on the PC (I tested from Windows 10). Don't know if there's Mac software but I'll be wanting it as well.
play.google.com /store/apps/details?id=com.vnd.wifi_audio
keithkimster said:
The first one I found that works is WiFiAudio, which you can get to work over USB by enabling USB Networking.
Click to expand...
Click to collapse
it's called USB Tethering in android, which is located in Portable Hotspot section.
We'd like to elaborate here a little as it took us some time to figure out how exactly to use our android as a sound card for a PC.
There's another app out there - SoundWire, which we used and known for some time, we haven't tried WiFiAudio, but found it. Think it's pretty similar.
So what those apps do is they let you connect to your android via LAN (WiFi in most cases unless u got ethernet cable in your phone) and they let you transmit sound to your phone. It's pretty simple and straightforward. The drawback is audio delay, which increases with buffer size. But good video player like MPC let's us change audio delay so we can make it play faster than video to compensate for that, takes a little time to figure out the delay tho.
SO we wanted to try it over usb cable, maybe it'd reduce/eliminate the delay heh. (it doesn't) That's how we found this post and we got kinda stumbled on "enabling USB Networking". Tried to look it up, read wiki and all. Turns out it's called USB Tethering in android, which is located in Portable Hotspot section. After enabling that - it adds a network on the PC, provided it's connected via usb cable ofc. Turned off all networking on android (WiFi, mobile) And it works. Though had to type in IP manually.
So now it can be used as a usb sound card without WiFi or anything. Still has a delay tho.
upd: Using a usb cable allows to reduce buffer size to minimum without getting any stutter leading essentially to no noticeable delay. Which is great.

MIDI Device ?!?

I tried a lot of custom roms and on none of them would MIDI usb mode work. MIDI it's required in order to use the phone's mic as pc mic via WO MIC. I don't know what it actually means or why it only works via MIDI but i really need a solution for it, i'm posting for 2nd time here regarding this very same issue and i still haven't found a solution.

How to force Skype for Android to use USB microphone?

Hello,
I have got a "YokaTV KB2" box with Android 6.0.1.
This box has an AMLogic s912 SOC, 2 GB RAM, 32 GB ROM, 2.4/5GHz WiFi, Bluetooth 4, 2 USB, 1 HDMI, 1 AV, 1 SD card, gigabit Ethernet and 1 DC input connectors, plus a remote controller. Of course, it doesn't have a screen, speaker, microphone, camera, GPS and any sensors built-in. The device is rooted by factory and has Google Play market installed. So, this is not a classical smartphone or tablet, just a board with Android installed and video is outputted to HDMI, inputs are bluetooth or wifi keyboards, mice or its own infra red remote controller.
My issue is:
I have researched a lot in order to have a "sure fire" at choosing USB webcamera. As you may know this is not that easy task like in case of Windows. You can easily choose the "wrong one" that gives no video and/or audio (mic) on Android.
Anyway, I've found out that Microsoft LifeCam HD-3000 will be my choice, so I've bought that one. I've also checked it out by an app called CameraFi. It has perfect HD video (up to 720p) and audio (built-in USB microphone) on Android. Bingo... so far...
Then I've installed Skype for Android. Called voice test to check the connection out, but it finished "too fast" and I've not heard my voice. A bad sign...
Then I've called my other device and found out that video is going through perfectly (if we can call 640x480 resolution "perfect" for Skype), but no voice heard.
As you may know there are just a few device settings in Android Skype compared to Windows one. One for video quality (hi/lo) and that's all. No setting for sound input, so I can't select sound source (e.g. internal mic and usb audio/mic).
So, I've got a half-success regarding Skype on Android.
I guess, since internal microphone is configured in box's android, Skype is sticking to use it as default. But as the box has no internal microphone hardware, I can hear nothing (or just low volume static) on the counter side.
My questions:
1. Can I somehow "force" Skype for Android to use webcam's USB microphone instead of the phantom "built-in" mic?
I've tried to remove (comment out) built-in mic from "audio-policy.conf" file, but Skype just threw a message like "microphone is used by another app, quit that app or wait until it ends" or similar.
2. As it seems (as per the above) Skype WANTS to use (the non-existant) internal mic... is there a way to "re-route" the existant USB mic to show up as internal microphone to Skype? Are there any "build.prop" or other config file magics exists for this?
3. If none of the above, then is there a custom modded version of Skype for Android that has a bit more settings regarding audio/video ? I've found a few here but those were worked up to Android 4, but not for 5 or 6. And also I'm not sure if they has the audio settings needed...
4. As a final solution: I would also be happy with an alternative Skype client that could handle my webcam perfectly. But so far, all my searches resulted that "as a new feature:" Skype is missing from the popular clients (IM+, Imo etc.). But we never know, maybe there is one left exist...?
Thanks for reading my lengthy first post.
Is there a solution to the problem above?
I saw a "Sound Device Manager" section within Settings of Android 4.x.x on other TV-boxes.
Maybe there is a way to "enable" such a settings block within Android 6.0.1, too?
Hi, just faced same problems as DonJoee: (Scishion V88 Mini II TV Box, Rockchip RK3229,2 Gb/8Gb, Android 6.0), also after some research (tried already 3 webcams (Trust, Microsoft, No-name) :
-All cams detected by system
-All cams are showing/sending videostream perfect everywhere (skype, viber, UsbWebCameraPro etc.)
Webcam build-in microphone (also all cams): works perfect in Google voice search, UsbWebCameraPro. Problem: Does not work in messaging Apps (both Skype and Viber).
-Recommended disabling „OK Google on every screen“ does not help.
-Looks like after plugging, webcam’s microphone is detected correctly in /dev/snd/ as pcmC3D0c.
-Looks like messaging app always forced to use device internal microphone (TV boxes have no internal microphone), just ignoring others.
In addition to methods of DonJoee i have tried add in bild.prop:
usb.audio.cap.device=pcmC3D0c
audio.input.active=AUDIO_CODEC
Regretfully it does not help.
Any hint on app, that manages audio devices on Android 6.0?
Any other ideas?
Thanks
I faced a similar issue with my Huawei Honor 8 connected through USB OTG (USB C) to my USB microphone Blue Yeti. Tested on a Sony Xperia Z3 Compact as well with the same behaviour. When calling the Echo / Sound test service no audio was recorded at all. On a similar note, attempting to record using one of the few audio recording apps that allow input from USB microphones (RecForge II) was unsuccessful: when set up to use the "default" (and not the internal) microphone the recordings would not start (i.e. the visual representation of the sound input normally seen was static and zero and the time indicator did not move). However, a sound file with length "-596:-31:-23" was still created at every attempt.
I attempted a wide range of options, including enabling/disabling USB Debuggning and selecting different options in Select USB Configuration (including Audio source and MTP) in Developer options. I also made sure USB audio routing was not disabled in Developer options. No change had any effect, and I was confused that upon changing USB mode in the scrolldown menu that appears upon connecting the Blue Yeti to anything else than "Reverse charging" only made the red LED on the Blue Yeti turn off for a second, and then come back on as the phone automatically reverted the setting to Reverse charging. I also tried different USB cables and different OTG adapters to no avail.
The solution I found after much experimenting was not really related to the above. I found that, when attempting to record using the USB microphone in RecForge II, the recording would start if I disconnected and reconnected the USB microphone while recording. What happens is that the phone phone reverts to recording with the internal microphone when the USB microphone is disconnected, hence starting the recording since the audio input is valid. Upon reconnecting the USB microphone (still during recording), there is a few seconds of silence but then the phone switches to taking audio from the USB microphone input and I can record as normal.
The same applies for Skype. When calling the Echo/Sound test service with the USB microphone connected, I wait for the signal to start recording a message and then quickly disconnect and reconnect the USB microphone. This way, I am able to record a message using the USB microphone that is played back to me afterwards. I expect the same solution to apply during Skype calls (disconnecting and reconnecting should enable Skype to take audio from the USB microphone) but I have not tested this.

Bluetooth audio codec disabled

I'm trying to change Bluetooth audio settings on developer options, but they're all disables.
Anyone knows what happens or how to enable them?
Screenshot attached.
I think you have to be connected to one audio device to get those settings accessible, they're greyed out for me as well. As I'm still waiting for my Freebuds 2 to arrive, I haven't tried myself. One reported issue with this is that those settings do revert back each time you disconnect your device, thus you have to set them every damn time you want to connect your headset.
bluetooth and audio is terribe for this device... so out of sync
You do need to be connected to a Bluetooth device for those options to be selectable but it won't let you choose options that aren't supported be the connected device.
I think since Android Oreo Android automatically selects the highest quality codec that the connected device supports which is why the option to select a default codec is no longer there.
When a device is connected you can manually select options that are supported using the developer options.
I haven't had any Bluetooth issues with my M20P. Sound quality is fine, everything connects with no problems and there are no sync issues.
If someone is experiencing issues they might want to try booting into recovery and wiping the system cache.
My M20P connected more quickly to my car Bluetooth after I did that.
pafc66 said:
bluetooth and audio is terribe for this device... so out of sync
Click to expand...
Click to collapse
I have completely the opposite. This is the only phone you can watch netflix or youtube on through bluetooth which doesn't take the video and audio out of sync.
As for the OP, you can't force a bluetooth peripheral to use a coded it doesn't support.
BOSE for example uses AAC or SBC.
Ok mine are the jaybird runs .. work fine on every other device except this.
I have a range of bt devices. Two Fiio device with LDAC, Aptx-(HD) support and a Sony wh900n with the same. When connected is automatically uses LDAC (best available quality) , but in the Bluetooth setting I can switch to aptx-hd (more stable connection)

Categories

Resources