Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support USB AUDIO in effects #18

Open
dalb8 opened this issue Feb 26, 2017 · 6 comments
Open

Support USB AUDIO in effects #18

dalb8 opened this issue Feb 26, 2017 · 6 comments

Comments

@dalb8
Copy link

dalb8 commented Feb 26, 2017

The effects only support headset, headphones and loudspeaker but not audio via USB dongle.

@carlosrafaelgn
Copy link
Owner

Indeed! The problem is I do not own one of those dongles, so there is no way I could test it...

Moreover, the only references I could find regarding USB Audio were these (that work only on Android 23+ - Marshmallow+):
https://developer.android.com/reference/android/media/AudioDeviceInfo.html
https://developer.android.com/reference/android/media/AudioManager.html#getDevices(int)

Do you own one of those devices? If so, would you consider writing a code to detect usb audio, please? Then, I would merge your code into FPlay's code :)

@dalb8
Copy link
Author

dalb8 commented Feb 26, 2017 via email

@james34602
Copy link

Android USB audio sometimes quite buggy, I have a highly modified DSP Manager in my repository, my experience show some device may have conflict when using USB audio output, the system always mix up with analog output. So USB DAC can be output as analog output.
Whatever @carlosrafaelgn may experiment on USB audio :D

@dalb8
Copy link
Author

dalb8 commented Feb 27, 2017 via email

@carlosrafaelgn
Copy link
Owner

Precise detection of audio output is kinda buggy on Android... Check out methods Player._checkAudioSinkViaRoute() and Player._checkAudioSink() (lines 3318 and 3369).

They are a massive workaround, sadly, because different devices behave differently :(

Reading through the code in AudioSystem.java, I came across two constants:
public static final String DEVICE_OUT_USB_ACCESSORY_NAME = "usb_accessory";
public static final String DEVICE_OUT_USB_DEVICE_NAME = "usb_device";

Perhaps they could be used to try and detect whenever audio output is being done by the speaker or by an USB device???

@james34602
Copy link

james34602 commented Feb 28, 2017

I don't even know is it work or not, have to do experiment on that. Carlos is right, different vendor may code audio framework differently...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants