-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JACK: support connecting to no device (only creating ports)
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>
- Loading branch information
Showing
2 changed files
with
91 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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