-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
jack: add noAutoConnect option and allow arbitrary number of channels #852
base: master
Are you sure you want to change the base?
Conversation
…ure.channels unless they are set to 0, then use the number of channels in the default device
What was your intention for the if (pContext->backend == ma_backend_jack) {
pContext->jack.channelsCapture = pConfig->capture.channels;
pContext->jack.channelsPlayback = pConfig->playback.channels;
} Any backend-specific logic like that needs to be within the backend itself, not in the cross-platform section. Just to clarify the rules. When you specify a channel count in the device config, the caller is specifying what they want. The backend (jack in this case), will use that as a hint. If it can exactly represent that channel count, it should do so, and if not, it should get as close as possible and then report via |
Oh about The number of channels set in the
and while Since I saw Oh and I think there was a reason I couldn't put Also re: the channel count config rules, I do feel it wasn't easy to understand the different |
OK just stepping through the calls to jack backend to trace things out for a better understanding:
So does it make sense to have to store |
Solves #851
I'm testing with this callback to play a sine wave over all channels
Default case:
I think this is still wrong. I have 2 audio devices with 8 outputs and 2 outputs, and here miniaudio creates 10 outputs and connects them all. I'm not sure what the "default device" is defined as with jack. Also this is with pipewire-jack.
Setting .playback.channels=2
Un-commenting that one line results in:
Setting .jack.noAutoconnect = true
Caveat that I couldn't figure out how to use
ma_context_config
without crashing, so on line 31793 I just force the value to true.The miniaudio device has 2 channels and initially not connected to anything.
I can now patch them however I want
Here's with 32 channels:
TODO
I must not be using
ma_context_config
properly, or there is a bug.On the master branch without this patch, this code will segfault in
ma_malloc
fromma_device__jack_buffer_size_callback
.If I try it on my patch here, strangely I see it worked until I uncomment
contextConfig.jack.noAutoConnect = true;
. Idk, something bad trashing the memory perhaps.TODO
dev
branch.// pContext->jack.noAutoConnect = true; // TODO I don't know how to use custom context config, it crashes