mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
don't enabled tsched on software ALSA devices
This commit is contained in:
parent
3813034cef
commit
e3f15104cf
4 changed files with 26 additions and 1 deletions
|
|
@ -1630,6 +1630,11 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
||||||
u->use_tsched = use_tsched = FALSE;
|
u->use_tsched = use_tsched = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (use_tsched && !pa_alsa_pcm_is_hw(u->pcm_handle)) {
|
||||||
|
pa_log_info("Device is not a hardware device, disabling timer-based scheduling.");
|
||||||
|
u->use_tsched = use_tsched = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (u->use_mmap)
|
if (u->use_mmap)
|
||||||
pa_log_info("Successfully enabled mmap() mode.");
|
pa_log_info("Successfully enabled mmap() mode.");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1482,6 +1482,11 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
||||||
u->use_tsched = use_tsched = FALSE;
|
u->use_tsched = use_tsched = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (use_tsched && !pa_alsa_pcm_is_hw(u->pcm_handle)) {
|
||||||
|
pa_log_info("Device is not a hardware device, disabling timer-based scheduling.");
|
||||||
|
u->use_tsched = use_tsched = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (u->use_mmap)
|
if (u->use_mmap)
|
||||||
pa_log_info("Successfully enabled mmap() mode.");
|
pa_log_info("Successfully enabled mmap() mode.");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1716,10 +1716,11 @@ char *pa_alsa_get_driver_name(int card) {
|
||||||
|
|
||||||
char *pa_alsa_get_driver_name_by_pcm(snd_pcm_t *pcm) {
|
char *pa_alsa_get_driver_name_by_pcm(snd_pcm_t *pcm) {
|
||||||
int card;
|
int card;
|
||||||
|
|
||||||
snd_pcm_info_t* info;
|
snd_pcm_info_t* info;
|
||||||
snd_pcm_info_alloca(&info);
|
snd_pcm_info_alloca(&info);
|
||||||
|
|
||||||
|
pa_assert(pcm);
|
||||||
|
|
||||||
if (snd_pcm_info(pcm, info) < 0)
|
if (snd_pcm_info(pcm, info) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
@ -1749,3 +1750,15 @@ char *pa_alsa_get_reserve_name(const char *device) {
|
||||||
|
|
||||||
return pa_sprintf_malloc("Audio%i", i);
|
return pa_sprintf_malloc("Audio%i", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pa_bool_t pa_alsa_pcm_is_hw(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_card(info) >= 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,4 +139,6 @@ char *pa_alsa_get_driver_name_by_pcm(snd_pcm_t *pcm);
|
||||||
|
|
||||||
char *pa_alsa_get_reserve_name(const char *device);
|
char *pa_alsa_get_reserve_name(const char *device);
|
||||||
|
|
||||||
|
pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue