JACK: support connecting to no device (only creating ports)#932
Draft
tleb wants to merge 1 commit intoPortAudio:masterfrom
Draft
JACK: support connecting to no device (only creating ports)#932tleb wants to merge 1 commit intoPortAudio:masterfrom
tleb wants to merge 1 commit intoPortAudio:masterfrom
Conversation
Previously, using the JACK backend meant that for each port:
- We call jack_port_register() to create the port,
- And call jack_connect() to create a connection between the newly
created port and a target (the parameters->device argument).
In the JACK world, it is common for processes to spawn a node with ports
and let somebody else do the routing. We therefore allow creating a
stream that targets as input and/or output paNoDevice.
This cannot be done directly using:
PaStreamParameters outputParams = {
.device = paNoDevice,
// ...
};
As with this, PortAudio cannot use the right API backend.
Instead, we do this:
PaJackStreamInfo streamInfo;
PaJack_InitializeNoDeviceStreamInfo(&streamInfo);
PaStreamParameters outputParams = {
.device = paUseHostApiSpecificDeviceSpecification,
.hostApiSpecificStreamInfo = &streamInfo,
// ...
};
streamInfo contains the standard API-specific header plus a
PaDeviceIndex device field that _must_ contain paNoDevice.
Some more details of changeset in pa_jack.c:
- Move parameter validation into an helper called from both
IsFormatSupported() and OpenStream().
- If API-specific info is provided and its device field is paNoDevice,
we create ports without calling jack_connect().
- We do not allocate stream->remote_*_ports in this case. That allows
us to detect throughout the driver without storing additional
state.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Collaborator
|
I think this is worthy of discussion, especially with people who are using JACK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, using the JACK backend meant that for each port:
jack_port_register()to create the port,jack_connect()to create a connection between the newly created port and a target (thePaStreamParameters.deviceargument).In the JACK world, it is common for processes to spawn a node with ports and let somebody else do the routing. We therefore allow creating a stream that targets as input and/or output
paNoDevice.See the commit message for additional details.
I do have questions regarding this:
I'm not familiar with PortAudio's API so there might be something better to do. Maybe something that is generic across APIs? Wanting to create a stream without connecting to anything might not be specific to JACK.