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

setDeviceId does not change anything #54

Closed
nocola opened this issue Feb 8, 2018 · 2 comments
Closed

setDeviceId does not change anything #54

nocola opened this issue Feb 8, 2018 · 2 comments
Assignees

Comments

@nocola
Copy link

nocola commented Feb 8, 2018

Hello! Thanks a lot for this project. I tried it for streaming input and output, and it works great. But I wanted to change mic source for input stream by setDeviceId(int sourceFromAudioManager) and it did not work, no effect for different values. Ids were given from AudioManager.java (api 23). For my app this behavior is very clitical. Are there any suggestions ?
P.S. Sory for my english :)

@nick-petrovsky
Copy link

@nocola this is not possible without AAudio when OpenSLES is used. Late I can refer the source line. Unfortunately manage source and sink not possible using public API.

@dturner
Copy link
Collaborator

dturner commented Feb 15, 2018

Thanks for filing this issue. nick-petrovsky is correct, on API < 27 OpenSLES is used and OpenSLES does not support setting the device id. There's no way around this that I'm aware of.

The recommended approach when using set* methods is to call the corresponding get method on the stream after opening it to determine whether you got what you asked for. Example:

builder.setDeviceId(123);
builder.openStream(&stream);
if (stream->getDeviceId() == 123) print("Stream is using device Id 123");

In this case I would expect stream->getDeviceId() to return oboe::kUnspecified, however, from looking at the code it looks like it will return the value set using setDeviceId even though this is not supported.

@philburk - Is this correct? If so, this is a bug which needs fixing.

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

4 participants