tsched disabled when I use module-alsa-sink with 'mmap=0 tsched=1' parameters.
Submitted by KimJeongYeon
Assigned to pul..@..op.org
Description
Dear developers,
I had posted a question to mailing-list before: http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-December/022822.html
When I tried to load 'module-alsa-sink' with 'mmap=0 tsched=1' parameters, tsched(timer-based scheduling) becomes disabled by default.
Currently, it seems tsched is allowed only mmap supported ALSA devices. But, I found able to use tsched with 'mmap=0' option. For instance, unix_write() function is for non-mmap driven function that was written and regarded to tsched mode together.
Please refer below test patch for supporting tsched mode on non-mmap driven ALSA configuration.
Thanks in advance, KimJeongYeon
========== diff -uNr ./a/alsa-sink.c ./b/alsa-sink.c --- ./a/alsa-sink.c 2014-12-11 21:41:13.680373375 +0900 +++ ./b/alsa-sink.c 2014-12-11 21:45:50.032371336 +0900 @@ -2210,11 +2210,6 @@ u->use_mmap = use_mmap = false; }
- if (use_tsched && (!b || !d)) {
-
pa_log_info("Cannot enable timer-based scheduling, falling back to
sound IRQ scheduling.");
-
u->use_tsched = use_tsched = false;
- }
- if (u->use_mmap) pa_log_info("Successfully enabled mmap() mode.");
diff -uNr ./a/alsa-util.c ./b/alsa-util.c --- ./a/alsa-util.c 2014-12-11 21:41:13.680373375 +0900 +++ ./b/alsa-util.c 2014-12-11 21:46:46.228370922 +0900 @@ -240,9 +240,6 @@ goto finish; }
- if (!_use_mmap)
-
_use_tsched = false;
- if (!pa_alsa_pcm_is_hw(pcm_handle)) _use_tsched = false; ==========