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

Do not send extra channels for aggregate devices. #243

Open
wants to merge 1 commit into
base: trailblazer
Choose a base branch
from

Conversation

mutexlox-signal
Copy link
Contributor

We drop the first several channels if there are extras (e.g. for aggregate devices) After f8df86f, this is often incorrect
(because the first device is the input device), and also is inefficient.

So, only request the channels we're planning to use.

@mutexlox-signal
Copy link
Contributor Author

cc @Pehrsons , who I've been working with on this. You may want to do more extensive testing here; I've only tested one combination of input/output devices.

@mutexlox-signal
Copy link
Contributor Author

I believe the test failures are the same as on ToT, but I'm not sure if there are any new problems here.

After f8df86f, we drop the **first**
several channels if there are extras (e.g. for aggregate devices). This
is often incorrect (because the first device is the input device), and
also is inefficient.
Copy link
Contributor

@Pehrsons Pehrsons left a comment

Choose a reason for hiding this comment

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

Thanks, and sorry for the late review!
LGTM with some work on the comment.

Comment on lines -3615 to -3618
// Notice: when we are using aggregate device, the input_hw_desc.mChannelsPerFrame is
// the total of all the input channel count of the devices added in the aggregate device.
// Due to our aggregate device settings, the data captured by the output device's input
// channels will be put in the beginning of the raw data given by the input callback.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep this comment, but update it to make it accurate: the "our aggregate device settings" refers to the input device coming after the output device, for instance. Rather explain that the input device is set first on the aggregate device, so we only need to request those channels and CoreAudio will drop the rest automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay; I lost track of this and have now forgotten all context. Can you please suggest a specific phrasing, and I can update the PR?

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