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

Clearer explanation for exclusive sharing mode #23

Merged
merged 3 commits into from
Dec 12, 2017
Merged

Conversation

dturner
Copy link
Collaborator

@dturner dturner commented Dec 8, 2017

I have added the concept of an audio device endpoint. Feedback welcome.

FullGuide.md Outdated
A stream has a sharing mode:

* `SharingMode::Exclusive` (available on API 26+) means the stream has exclusive access to its audio device; the device cannot be used by any other audio stream. If the audio device is already in use, it might not be possible for the stream to have exclusive access. Exclusive streams provide the lowest possible latency, but they are also more likely to get disconnected. You should close exclusive streams as soon as you no longer need them, so that other apps can access the device.
* `SharingMode::Exclusive` (available on API 26+) means the stream has exclusive access to an endpoint on its audio device; the endpoint cannot be used by any other audio stream. If the exclusive endpoint is already in use, it might not be possible for the stream to obtain access to it. Exclusive streams provide the lowest possible latency by bypassing the mixer stage, but they are also more likely to get disconnected. You should close exclusive streams as soon as you no longer need them, so that other apps can access the device. Not all audio devices provide exclusive endpoints.
* `SharingMode::Shared` allows Oboe to mix audio. Oboe mixes all the shared streams assigned to the same device.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device or "endpoint"

FullGuide.md Outdated
* `SharingMode::Shared` allows Oboe to mix audio. Oboe mixes all the shared streams assigned to the same device.

You can explicitly request the sharing mode when you create a stream, although you are not guaranteed to receive that mode. By default,
the sharing mode is `Shared`.
You can explicitly request the sharing mode when you create a stream, although you are not guaranteed to receive that mode. By default, the sharing mode is `Shared`.

### Audio format

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diagram below is not exactly correct. There is generally only ONE MMAP endpoint available per device. It can be used by one EXCLUSIVE stream OR multiple SHARED streams. But not both.
So if any app opens a SHARED MMAP stream then it can prevent another app from opening an EXCLUSIVE MMAP stream.

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

Successfully merging this pull request may close these issues.

2 participants