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);
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);
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;
+}
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