mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
include a few HAL properties in our card/sink/source properties for ALSA devices
This commit is contained in:
parent
54dad91f07
commit
a365c8212d
11 changed files with 186 additions and 10 deletions
|
|
@ -1436,7 +1436,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
pa_sink_new_data_set_sample_spec(&data, &ss);
|
||||
pa_sink_new_data_set_channel_map(&data, &map);
|
||||
|
||||
pa_alsa_init_proplist_pcm(data.proplist, pcm_info);
|
||||
pa_alsa_init_proplist_pcm(m->core, data.proplist, pcm_info);
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
|
||||
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) (period_frames * frame_size * nfrags));
|
||||
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", (unsigned long) (period_frames * frame_size));
|
||||
|
|
|
|||
|
|
@ -1261,7 +1261,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
pa_source_new_data_set_sample_spec(&data, &ss);
|
||||
pa_source_new_data_set_channel_map(&data, &map);
|
||||
|
||||
pa_alsa_init_proplist_pcm(data.proplist, pcm_info);
|
||||
pa_alsa_init_proplist_pcm(m->core, data.proplist, pcm_info);
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
|
||||
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) (period_frames * frame_size * nfrags));
|
||||
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", (unsigned long) (period_frames * frame_size));
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@
|
|||
|
||||
#include "alsa-util.h"
|
||||
|
||||
#ifdef HAVE_HAL
|
||||
#include "hal-util.h"
|
||||
#endif
|
||||
|
||||
struct pa_alsa_fdlist {
|
||||
unsigned num_fds;
|
||||
struct pollfd *fds;
|
||||
|
|
@ -1248,7 +1252,7 @@ void pa_alsa_redirect_errors_dec(void) {
|
|||
snd_lib_error_set_handler(NULL);
|
||||
}
|
||||
|
||||
void pa_alsa_init_proplist_card(pa_proplist *p, int card) {
|
||||
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
|
||||
char *cn, *lcn;
|
||||
|
||||
pa_assert(p);
|
||||
|
|
@ -1265,9 +1269,13 @@ void pa_alsa_init_proplist_card(pa_proplist *p, int card) {
|
|||
pa_proplist_sets(p, "alsa.long_card_name", lcn);
|
||||
free(lcn);
|
||||
}
|
||||
|
||||
#ifdef HAVE_HAL
|
||||
pa_hal_get_info(c, p, card);
|
||||
#endif
|
||||
}
|
||||
|
||||
void pa_alsa_init_proplist_pcm(pa_proplist *p, snd_pcm_info_t *pcm_info) {
|
||||
void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_info_t *pcm_info) {
|
||||
|
||||
static const char * const alsa_class_table[SND_PCM_CLASS_LAST+1] = {
|
||||
[SND_PCM_CLASS_GENERIC] = "generic",
|
||||
|
|
@ -1321,7 +1329,7 @@ void pa_alsa_init_proplist_pcm(pa_proplist *p, snd_pcm_info_t *pcm_info) {
|
|||
pa_proplist_setf(p, "alsa.device", "%u", snd_pcm_info_get_device(pcm_info));
|
||||
|
||||
if ((card = snd_pcm_info_get_card(pcm_info)) >= 0) {
|
||||
pa_alsa_init_proplist_card(p, card);
|
||||
pa_alsa_init_proplist_card(c, p, card);
|
||||
cn = pa_proplist_gets(p, "alsa.card_name");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <pulse/proplist.h>
|
||||
|
||||
#include <pulsecore/rtpoll.h>
|
||||
#include <pulsecore/core.h>
|
||||
|
||||
typedef struct pa_alsa_fdlist pa_alsa_fdlist;
|
||||
|
||||
|
|
@ -118,8 +119,8 @@ void pa_alsa_dump_status(snd_pcm_t *pcm);
|
|||
void pa_alsa_redirect_errors_inc(void);
|
||||
void pa_alsa_redirect_errors_dec(void);
|
||||
|
||||
void pa_alsa_init_proplist_pcm(pa_proplist *p, snd_pcm_info_t *pcm_info);
|
||||
void pa_alsa_init_proplist_card(pa_proplist *p, int card);
|
||||
void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_info_t *pcm_info);
|
||||
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card);
|
||||
|
||||
int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents);
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ int pa__init(pa_module*m) {
|
|||
pa_card_new_data_init(&data);
|
||||
data.driver = __FILE__;
|
||||
data.module = m;
|
||||
pa_alsa_init_proplist_card(data.proplist, alsa_card_index);
|
||||
pa_alsa_init_proplist_card(m->core, data.proplist, alsa_card_index);
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_id);
|
||||
set_card_name(&data, ma, u->device_id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue