endpoint: make endpoints of alsa devices

Make one endpoint for each device
Make a stream for each node
This commit is contained in:
Wim Taymans 2019-11-04 17:27:41 +01:00
parent 6397db9d68
commit 8409e8be49
4 changed files with 288 additions and 5 deletions

View file

@ -30,6 +30,9 @@
#include "config.h"
#include <alsa/use-case.h>
#include <alsa/asoundlib.h>
#include <spa/node/node.h>
#include <spa/utils/hook.h>
#include <spa/utils/names.h>
@ -57,6 +60,8 @@ struct alsa_node {
struct pw_proxy *proxy;
struct spa_node *node;
struct pw_endpoint_stream_info info;
};
struct alsa_object {
@ -79,6 +84,13 @@ struct alsa_object {
unsigned int first:1;
struct spa_list node_list;
struct pw_client_endpoint_proxy *client_endpoint;
struct spa_hook client_endpoint_listener;
struct pw_endpoint_info client_endpoint_info;
unsigned int use_ucm:1;
snd_use_case_mgr_t *ucm;
};
static struct alsa_node *alsa_find_node(struct alsa_object *obj, uint32_t id)
@ -415,6 +427,7 @@ static void add_jack_timeout(struct impl *impl)
value.tv_nsec = 0;
pw_loop_update_timer(main_loop, impl->jack_timeout, &value, NULL, false);
}
static void reserve_acquired(void *data, struct rd_device *d)
{
struct alsa_object *obj = data;
@ -426,6 +439,9 @@ static void reserve_acquired(void *data, struct rd_device *d)
remove_jack_timeout(impl);
set_jack_profile(impl, 0);
set_profile(obj, 1);
setup_alsa_endpoint(obj);
}
static void sync_complete_done(void *data, int seq)