From 143e1ba73947b1a721916243ffc6f88579fc0b12 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 3 Apr 2009 17:49:05 +0200 Subject: downgrade a few messages --- src/modules/alsa/alsa-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index 5b5270b8..bdeea06e 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -1063,7 +1063,7 @@ snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const fallback_elem = NULL; } - pa_log_warn("Cannot find fallback mixer control \"%s\" or mixer control is no combination of switch/volume.", snd_mixer_selem_id_get_name(sid)); + pa_log_info("Cannot find fallback mixer control \"%s\" or mixer control is no combination of switch/volume.", snd_mixer_selem_id_get_name(sid)); } if (elem && fallback_elem) { -- cgit From 8bcb9c6910deee9aaf1920e0e37141611cada9ee Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Wed, 1 Apr 2009 12:35:44 +0200 Subject: various spelling fixes --- src/modules/alsa/alsa-sink.c | 4 ++-- src/modules/alsa/alsa-util.c | 2 +- src/modules/module-raop-discover.c | 2 +- src/modules/module-zeroconf-discover.c | 2 +- src/modules/rtp/module-rtp-recv.c | 2 +- src/modules/rtp/rtsp_client.c | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/modules') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 0dc0e2b3..b43fa06d 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -1173,7 +1173,7 @@ static void sink_update_requested_latency_cb(pa_sink *s) { /* Let's check whether we now use only a smaller part of the buffer then before. If so, we need to make sure that subsequent - rewinds are relative to the new maxium fill level and not to the + rewinds are relative to the new maximum fill level and not to the current fill level. Thus, let's do a full rewind once, to clear things up. */ @@ -1300,7 +1300,7 @@ static void thread_func(void *userdata) { /* USB devices on ALSA seem to hit a buffer * underrun during the first iterations much * quicker then we calculate here, probably due to - * the transport latency. To accomodate for that + * the transport latency. To accommodate for that * we artificially decrease the sleep time until * we have filled the buffer at least once * completely.*/ diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index bdeea06e..be8cd1cb 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -705,7 +705,7 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto( } else { /* Hmm, so the next entry does not have the same * number of channels, so let's go backwards until we - * find the next entry with a differnt number of + * find the next entry with a different number of * channels */ for (i--; i >= 0; i--) diff --git a/src/modules/module-raop-discover.c b/src/modules/module-raop-discover.c index 5c2e0623..eaeb77fc 100644 --- a/src/modules/module-raop-discover.c +++ b/src/modules/module-raop-discover.c @@ -258,7 +258,7 @@ static void browser_cb( pa_log("avahi_service_resolver_new() failed: %s", avahi_strerror(avahi_client_errno(u->client))); /* We ignore the returned resolver object here, since the we don't - * need to attach any special data to it, and we can still destory + * need to attach any special data to it, and we can still destroy * it from the callback */ } else if (event == AVAHI_BROWSER_REMOVE) { diff --git a/src/modules/module-zeroconf-discover.c b/src/modules/module-zeroconf-discover.c index 3da946e0..1fdc1f46 100644 --- a/src/modules/module-zeroconf-discover.c +++ b/src/modules/module-zeroconf-discover.c @@ -279,7 +279,7 @@ static void browser_cb( pa_log("avahi_service_resolver_new() failed: %s", avahi_strerror(avahi_client_errno(u->client))); /* We ignore the returned resolver object here, since the we don't - * need to attach any special data to it, and we can still destory + * need to attach any special data to it, and we can still destroy * it from the callback */ } else if (event == AVAHI_BROWSER_REMOVE) { diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c index 33e23af2..23adbe1c 100644 --- a/src/modules/rtp/module-rtp-recv.c +++ b/src/modules/rtp/module-rtp-recv.c @@ -229,7 +229,7 @@ static int rtpoll_work_cb(pa_rtpoll_item *i) { } } - /* Check wheter there was a timestamp overflow */ + /* Check whether there was a timestamp overflow */ k = (int64_t) s->rtp_context.timestamp - (int64_t) s->offset; j = (int64_t) 0x100000000LL - (int64_t) s->offset + (int64_t) s->rtp_context.timestamp; diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c index 98db05dd..629328ad 100644 --- a/src/modules/rtp/rtsp_client.c +++ b/src/modules/rtp/rtsp_client.c @@ -211,7 +211,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) { } if (!strlen(s2)) { /* End of headers */ - /* We will have a header left from our looping itteration, so add it in :) */ + /* We will have a header left from our looping iteration, so add it in :) */ if (c->last_header) { /* This is not a continuation header so let's dump it into our proplist */ pa_headerlist_puts(c->response_headers, c->last_header, pa_strbuf_tostring_free(c->header_buffer)); @@ -488,7 +488,7 @@ int pa_rtsp_record(pa_rtsp_client* c, uint16_t* seq, uint32_t* rtptime) { pa_assert(c); if (!c->session) { - /* No seesion in progres */ + /* No session in progress */ return -1; } -- cgit From 77a1e3876bb11be79b32509d744136f89d76025f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 4 Apr 2009 04:12:42 +0200 Subject: refuse to initialize on modem devices --- src/modules/alsa/alsa-sink.c | 5 +++++ src/modules/alsa/alsa-source.c | 5 +++++ src/modules/alsa/alsa-util.c | 12 ++++++++++++ src/modules/alsa/alsa-util.h | 2 ++ 4 files changed, 24 insertions(+) (limited to 'src/modules') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index b43fa06d..cdf1ca80 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -1617,6 +1617,11 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca pa_assert(u->device_name); pa_log_info("Successfully opened device %s.", u->device_name); + if (pa_alsa_pcm_is_modem(u->pcm_handle)) { + pa_log_notice("Device %s is modem, refusing further initialization.", u->device_name); + goto fail; + } + if (profile) pa_log_info("Selected configuration '%s' (%s).", profile->description, profile->name); diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 348cd082..d9c60103 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -1469,6 +1469,11 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p pa_assert(u->device_name); pa_log_info("Successfully opened device %s.", u->device_name); + if (pa_alsa_pcm_is_modem(u->pcm_handle)) { + pa_log_notice("Device %s is modem, refusing further initialization.", u->device_name); + goto fail; + } + if (profile) pa_log_info("Selected configuration '%s' (%s).", profile->description, profile->name); diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index be8cd1cb..870cf0f1 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -1769,3 +1769,15 @@ pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm) { return snd_pcm_info_get_card(info) >= 0; } + +pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm) { + snd_pcm_info_t* info; + snd_pcm_info_alloca(&info); + + pa_assert(pcm); + + if (snd_pcm_info(pcm, info) < 0) + return FALSE; + + return snd_pcm_info_get_class(info) == SND_PCM_CLASS_MODEM; +} diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h index 5cad2958..94f27d14 100644 --- a/src/modules/alsa/alsa-util.h +++ b/src/modules/alsa/alsa-util.h @@ -141,4 +141,6 @@ char *pa_alsa_get_reserve_name(const char *device); pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm); +pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm); + #endif -- cgit From ca39fa2c6f9036a4c90804625842f6af38fb8008 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 4 Apr 2009 04:13:58 +0200 Subject: initialize sound cards only after the 'control' object appeared --- src/modules/module-hal-detect.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/modules') diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c index 0dd22cbd..b6139e43 100644 --- a/src/modules/module-hal-detect.c +++ b/src/modules/module-hal-detect.c @@ -121,6 +121,7 @@ static const char *strip_udi(const char *udi) { enum alsa_type { ALSA_TYPE_PLAYBACK, ALSA_TYPE_CAPTURE, + ALSA_TYPE_CONTROL, ALSA_TYPE_OTHER }; @@ -141,6 +142,8 @@ static enum alsa_type hal_alsa_device_get_type(LibHalContext *context, const cha t = ALSA_TYPE_PLAYBACK; else if (pa_streq(type, "capture")) t = ALSA_TYPE_CAPTURE; + else if (pa_streq(type, "control")) + t = ALSA_TYPE_CONTROL; libhal_free_string(type); @@ -171,7 +174,8 @@ static pa_bool_t hal_alsa_device_is_modem(LibHalContext *context, const char *ud finish: if (dbus_error_is_set(&error)) { - pa_log_error("D-Bus error while parsing HAL ALSA data: %s: %s", error.name, error.message); + if (!dbus_error_has_name(&error, "org.freedesktop.Hal.NoSuchProperty")) + pa_log_error("D-Bus error while parsing HAL ALSA data: %s: %s", error.name, error.message); dbus_error_free(&error); } @@ -193,10 +197,23 @@ static int hal_device_load_alsa(struct userdata *u, const char *udi, struct devi /* We only care for PCM devices */ type = hal_alsa_device_get_type(u->context, udi); - if (type == ALSA_TYPE_OTHER) + + /* For each ALSA card that appears the control device will be the + * last one to be created, this is considered part of the ALSA + * usperspace API. We rely on this and load our modules only when + * the control device is available assuming that *all* device + * nodes have been properly created and assigned the right ACLs at + * that time. Also see: + * + * http://mailman.alsa-project.org/pipermail/alsa-devel/2009-April/015958.html + * + * and the associated thread.*/ + + if (type != ALSA_TYPE_CONTROL) goto fail; - /* We don't care for modems */ + /* We don't care for modems -- this is most likely not set for + * control devices, so kind of pointless here. */ if (hal_alsa_device_is_modem(u->context, udi)) goto fail; @@ -411,9 +428,10 @@ static int hal_device_add_all(struct userdata *u) { for (i = 0; i < n; i++) { struct device *d; - if ((d = hal_device_add(u, udis[i]))) + if ((d = hal_device_add(u, udis[i]))) { count++; - else + pa_log_debug("Loaded device %s", udis[i]); + } else pa_log_debug("Not loaded device %s", udis[i]); } } @@ -449,6 +467,8 @@ static void device_added_cb(LibHalContext *context, const char *udi) { if (!hal_device_add(u, udi)) pa_log_debug("Not loaded device %s", udi); + else + pa_log_debug("Loaded device %s", udi); finish: if (dbus_error_is_set(&error)) { -- cgit