mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
alsa: give capture stream highest priority
Make sure we always make the capture device a master. We would prefer to only do resampling on the sinks when we need to.
This commit is contained in:
parent
3c9aa2e96c
commit
b74080ea55
1 changed files with 6 additions and 5 deletions
|
|
@ -110,7 +110,7 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
|
|||
struct monitor *monitor = obj->monitor;
|
||||
struct impl *impl = monitor->impl;
|
||||
int res;
|
||||
const char *dev, *subdev;
|
||||
const char *dev, *subdev, *stream;
|
||||
int priority;
|
||||
|
||||
pw_log_debug("new node %u", id);
|
||||
|
|
@ -136,6 +136,8 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
|
|||
dev = "0";
|
||||
if ((subdev = pw_properties_get(node->props, SPA_KEY_API_ALSA_PCM_SUBDEVICE)) == NULL)
|
||||
subdev = "0";
|
||||
if ((stream = pw_properties_get(node->props, SPA_KEY_API_ALSA_PCM_STREAM)) == NULL)
|
||||
stream = "unknown";
|
||||
|
||||
if (obj->first) {
|
||||
if (atol(dev) != 0)
|
||||
|
|
@ -144,6 +146,8 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
|
|||
}
|
||||
|
||||
priority = obj->priority;
|
||||
if (!strcmp(stream, "capture"))
|
||||
priority += 1000;
|
||||
priority -= atol(dev) * 16;
|
||||
priority -= atol(subdev);
|
||||
|
||||
|
|
@ -153,12 +157,9 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
|
|||
}
|
||||
|
||||
if (pw_properties_get(node->props, SPA_KEY_NODE_NAME) == NULL) {
|
||||
const char *devname, *stream;
|
||||
const char *devname;
|
||||
if ((devname = pw_properties_get(obj->props, SPA_KEY_DEVICE_NAME)) == NULL)
|
||||
devname = "unknown";
|
||||
if ((stream = pw_properties_get(node->props, SPA_KEY_API_ALSA_PCM_STREAM)) == NULL)
|
||||
stream = "unknown";
|
||||
|
||||
pw_properties_setf(node->props, SPA_KEY_NODE_NAME, "%s.%s.%s.%s",
|
||||
devname, stream, dev, subdev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue