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

Pref Sound: auto select free device channels #11859

Merged

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Aug 23, 2023

I started another coffee break project to add little helper:
when you need to configure multiple sound outputs using one device, like channels 1-2 for Main & 3-4 for headphones as with many controller soundcards, and you configured the first output it is very pleasant if the next free channel pair is selected automatically for the second output.

  1. Main: select device XY -> channels 1-2 selected (default from populating the channels box)
  2. Headphones: select device XY -> channels 3-4 are selected automatically

That saves one click (yeaiiy!!), but more importantly: it avoids mis(re-)configuration in the Heat of the Night:tm: (assign same channels twice, Apply, error, meeeh, select correct channels, Apply).

Note: this does just combobox index matching, i.e. does not check channel overlap like
Mic1: channel 1, Aux1: channels 1-2.

Closes #10163

This is still WIP but it's working nicely already.
I'll do more testing and polish it.

  • remove DEBUG commit

@github-actions github-actions bot added the ui label Aug 23, 2023
@ronso0 ronso0 force-pushed the pref-sound-auto-select-free-channels branch 2 times, most recently from f3cc4d2 to 01edc97 Compare August 23, 2023 22:01
@ronso0 ronso0 added this to the 2.4.0 milestone Aug 23, 2023
@ronso0 ronso0 force-pushed the pref-sound-auto-select-free-channels branch from 01edc97 to e47f4c5 Compare August 23, 2023 22:04
@ronso0 ronso0 force-pushed the pref-sound-auto-select-free-channels branch 3 times, most recently from 51abef3 to 8a2bce1 Compare August 24, 2023 11:04
@ronso0 ronso0 linked an issue Aug 24, 2023 that may be closed by this pull request
@ronso0 ronso0 force-pushed the pref-sound-auto-select-free-channels branch from 8a2bce1 to 550fba2 Compare August 24, 2023 21:49
@fwcd
Copy link
Member

fwcd commented Aug 28, 2023

I like this, it makes the common case very convenient, though I think it could also feel a bit "magical", especially if the user has a more esoteric device/channel configuration.

@ronso0
Copy link
Member Author

ronso0 commented Aug 28, 2023

Thanks for testing this!
I rarely use more than one IO device so real-world examples that are can be improved are welcome!

Note that the occupied channel indices are stored per device so it won't suggest weird channels for formerly unconfigured devices.
If for example a user first selected channels 3/4 and selects the same device again it'll select 1/2 as before, like for all formerly unused devices. Can't think of an example case where the auto-select would be disturbing, or more inconvenient than the current behaviour.
For scenarios where muliple mono channels are configured for a device, auto-select pick 1/2 but this is also the current behaviour. Making auto-select pick another mono channel is doable but I'm not sure it's desireable in all cases.

@ronso0 ronso0 marked this pull request as ready for review August 29, 2023 22:34
@ronso0
Copy link
Member Author

ronso0 commented Aug 29, 2023

It's working nicely, didn't encounter any hickups, incl. Query Devices.

Ready for review.

@ronso0 ronso0 force-pushed the pref-sound-auto-select-free-channels branch from 10d47b2 to cd1f858 Compare September 13, 2023 15:41
@ronso0 ronso0 requested a review from Holzhaus September 15, 2023 14:45
@ronso0
Copy link
Member Author

ronso0 commented Sep 30, 2023

bump
Is there anything left to do?

@ronso0
Copy link
Member Author

ronso0 commented Oct 28, 2023

ba-bump

@ronso0 ronso0 modified the milestones: 2.4.0, 2.4.1 Nov 30, 2023
@JoergAtGithub
Copy link
Member

Just tested this and it works very neat with my Traktor Z2 (2xOut Ch + 4x In Ch in unusual order) accross all the Windows Audio driver APIs.
Please fix the conflict.

src/coreservices.cpp Outdated Show resolved Hide resolved
@ronso0 ronso0 force-pushed the pref-sound-auto-select-free-channels branch from cd1f858 to a50fca9 Compare December 9, 2023 14:33
@ronso0
Copy link
Member Author

ronso0 commented Dec 9, 2023

Thanks for your review @JoergAtGithub !
Ready for merge.

@JoergAtGithub
Copy link
Member

LGTM! Thank you!

@JoergAtGithub JoergAtGithub merged commit 8e595a7 into mixxxdj:2.4 Dec 9, 2023
12 checks passed
@ronso0 ronso0 deleted the pref-sound-auto-select-free-channels branch December 9, 2023 15:18
@ronso0 ronso0 modified the milestones: 2.4.1, 2.4.0 Dec 9, 2023
ronso0 added a commit that referenced this pull request Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sound Hardware preferences should auto-select next free channel
4 participants