App audio capture: remove gsr-app-sink

Connect application/device audio directly to gsr recording node.
This fixes an issue for some users where gsr-app-sink got selected by
default as an output device.

Dont wait until audio node first receives audio before recording audio
from the device. This might fix audio/video desync issue when recording
from microphone for example.
This commit is contained in:
dec05eba
2025-12-07 18:10:18 +01:00
parent 2064d109ee
commit 3ac17b99a0
6 changed files with 60 additions and 106 deletions

View File

@@ -94,18 +94,12 @@ typedef struct {
size_t num_requested_links;
size_t requested_links_capacity_items;
struct pw_proxy **virtual_sink_proxies;
size_t num_virtual_sink_proxies;
size_t virtual_sink_proxies_capacity_items;
bool running;
} gsr_pipewire_audio;
bool gsr_pipewire_audio_init(gsr_pipewire_audio *self);
void gsr_pipewire_audio_deinit(gsr_pipewire_audio *self);
bool gsr_pipewire_audio_create_virtual_sink(gsr_pipewire_audio *self, const char *name);
/*
This function links audio source outputs from applications that match the name |app_names| to the input
that matches the name |stream_name_input|.
@@ -140,6 +134,17 @@ bool gsr_pipewire_audio_add_link_from_apps_to_sink(gsr_pipewire_audio *self, con
*/
bool gsr_pipewire_audio_add_link_from_apps_to_sink_inverted(gsr_pipewire_audio *self, const char **app_names, int num_app_names, const char *sink_name_input);
/*
This function links audio source outputs from devices that match the name |source_names| to the input
that matches the name |stream_name_input|.
If a device or a new device starts outputting audio after this function is called and the device name matches
then it will automatically link the audio sources.
|source_names| and |stream_name_input| are case-insensitive matches.
|source_names| can include "default_output" or "default_input" to use the default output/input
and it will automatically switch when the default output/input is changed in system audio settings.
*/
bool gsr_pipewire_audio_add_link_from_sources_to_stream(gsr_pipewire_audio *self, const char **source_names, int num_source_names, const char *stream_name_input);
/*
This function links audio source outputs from devices that match the name |source_names| to the input
that matches the name |sink_name_input|.

View File

@@ -61,12 +61,12 @@ typedef enum {
/*
Get a sound device by name, returning the device into the |device| parameter.
|device_name| can be a device name or "default_output" or "default_input".
|device_name| can be a device name or "default_output", "default_input" or "" to not connect to any device (used for app audio for example).
If the device name is "default_output" or "default_input" then it will automatically switch which
device is records from when the default output/input is changed in the system audio settings.
Returns 0 on success, or a negative value on failure.
*/
int sound_device_get_by_name(SoundDevice *device, const char *device_name, const char *description, unsigned int num_channels, unsigned int period_frame_size, AudioFormat audio_format);
int sound_device_get_by_name(SoundDevice *device, const char *node_name, const char *device_name, const char *description, unsigned int num_channels, unsigned int period_frame_size, AudioFormat audio_format);
void sound_device_close(SoundDevice *device);