mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Merge branch 'master' into lennartsbtfixes
This commit is contained in:
		
						commit
						6b803217ce
					
				
					 5 changed files with 41 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -31,6 +31,7 @@
 | 
			
		|||
#include <pulse/sample.h>
 | 
			
		||||
#include <pulse/xmalloc.h>
 | 
			
		||||
#include <pulse/timeval.h>
 | 
			
		||||
#include <pulse/util.h>
 | 
			
		||||
 | 
			
		||||
#include <pulsecore/log.h>
 | 
			
		||||
#include <pulsecore/macro.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -1253,7 +1254,7 @@ void pa_alsa_redirect_errors_dec(void) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
 | 
			
		||||
    char *cn, *lcn;
 | 
			
		||||
    char *cn, *lcn, *dn;
 | 
			
		||||
 | 
			
		||||
    pa_assert(p);
 | 
			
		||||
    pa_assert(card >= 0);
 | 
			
		||||
| 
						 | 
				
			
			@ -1270,6 +1271,11 @@ void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
 | 
			
		|||
        free(lcn);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((dn = pa_alsa_get_driver_name(card))) {
 | 
			
		||||
        pa_proplist_sets(p, "alsa.driver_name", dn);
 | 
			
		||||
        pa_xfree(dn);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_HAL
 | 
			
		||||
    pa_hal_get_info(c, p, card);
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -1477,3 +1483,21 @@ int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas
 | 
			
		|||
 | 
			
		||||
    return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *pa_alsa_get_driver_name(int card) {
 | 
			
		||||
    char *t, *m, *n;
 | 
			
		||||
 | 
			
		||||
    pa_assert(card >= 0);
 | 
			
		||||
 | 
			
		||||
    t = pa_sprintf_malloc("/sys/class/sound/card%i/device/driver/module", card);
 | 
			
		||||
    m = pa_readlink(t);
 | 
			
		||||
    pa_xfree(t);
 | 
			
		||||
 | 
			
		||||
    if (!m)
 | 
			
		||||
        return NULL;
 | 
			
		||||
 | 
			
		||||
    n = pa_xstrdup(pa_path_get_filename(m));
 | 
			
		||||
    pa_xfree(m);
 | 
			
		||||
 | 
			
		||||
    return n;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -129,4 +129,6 @@ pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll);
 | 
			
		|||
snd_pcm_sframes_t pa_alsa_safe_avail_update(snd_pcm_t *pcm, size_t hwbuf_size, const pa_sample_spec *ss);
 | 
			
		||||
int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas, snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames, size_t hwbuf_size, const pa_sample_spec *ss);
 | 
			
		||||
 | 
			
		||||
char *pa_alsa_get_driver_name(int card);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -278,7 +278,8 @@ void pa_log_levelv_meta(
 | 
			
		|||
            n++;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!*t)
 | 
			
		||||
        /* We ignore strings only made out of whitespace */
 | 
			
		||||
        if (t[strspn(t, "\t ")] == 0)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        switch (log_target) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -128,6 +128,7 @@ pa_sink* pa_sink_new(
 | 
			
		|||
    char st[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX];
 | 
			
		||||
    pa_source_new_data source_data;
 | 
			
		||||
    const char *dn;
 | 
			
		||||
    char *pt;
 | 
			
		||||
 | 
			
		||||
    pa_assert(core);
 | 
			
		||||
    pa_assert(data);
 | 
			
		||||
| 
						 | 
				
			
			@ -233,11 +234,14 @@ pa_sink* pa_sink_new(
 | 
			
		|||
    if (s->card)
 | 
			
		||||
        pa_assert_se(pa_idxset_put(s->card->sinks, s, NULL) >= 0);
 | 
			
		||||
 | 
			
		||||
    pa_log_info("Created sink %u \"%s\" with sample spec %s and channel map %s",
 | 
			
		||||
    pt = pa_proplist_to_string_sep(s->proplist, "\n    ");
 | 
			
		||||
    pa_log_info("Created sink %u \"%s\" with sample spec %s and channel map %s\n    %s",
 | 
			
		||||
                s->index,
 | 
			
		||||
                s->name,
 | 
			
		||||
                pa_sample_spec_snprint(st, sizeof(st), &s->sample_spec),
 | 
			
		||||
                pa_channel_map_snprint(cm, sizeof(cm), &s->channel_map));
 | 
			
		||||
                pa_channel_map_snprint(cm, sizeof(cm), &s->channel_map),
 | 
			
		||||
                pt);
 | 
			
		||||
    pa_xfree(pt);
 | 
			
		||||
 | 
			
		||||
    pa_source_new_data_init(&source_data);
 | 
			
		||||
    pa_source_new_data_set_sample_spec(&source_data, &s->sample_spec);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,6 +119,7 @@ pa_source* pa_source_new(
 | 
			
		|||
    pa_source *s;
 | 
			
		||||
    const char *name;
 | 
			
		||||
    char st[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX];
 | 
			
		||||
    char *pt;
 | 
			
		||||
 | 
			
		||||
    pa_assert(core);
 | 
			
		||||
    pa_assert(data);
 | 
			
		||||
| 
						 | 
				
			
			@ -222,11 +223,14 @@ pa_source* pa_source_new(
 | 
			
		|||
    if (s->card)
 | 
			
		||||
        pa_assert_se(pa_idxset_put(s->card->sources, s, NULL) >= 0);
 | 
			
		||||
 | 
			
		||||
    pa_log_info("Created source %u \"%s\" with sample spec %s and channel map %s",
 | 
			
		||||
    pt = pa_proplist_to_string_sep(s->proplist, "\n    ");
 | 
			
		||||
    pa_log_info("Created source %u \"%s\" with sample spec %s and channel map %s\n    %s",
 | 
			
		||||
                s->index,
 | 
			
		||||
                s->name,
 | 
			
		||||
                pa_sample_spec_snprint(st, sizeof(st), &s->sample_spec),
 | 
			
		||||
                pa_channel_map_snprint(cm, sizeof(cm), &s->channel_map));
 | 
			
		||||
                pa_channel_map_snprint(cm, sizeof(cm), &s->channel_map),
 | 
			
		||||
                pt);
 | 
			
		||||
    pa_xfree(pt);
 | 
			
		||||
 | 
			
		||||
    return s;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue