[pulseaudio-discuss] Why tsched disabled when I use module-alsa-sink with 'mmap=0 tsched=1' parameters?

Raymond Yau superquad.vortex2 at gmail.com
Fri Dec 19 17:28:24 PST 2014


>
>
> I have question something about selecting logic between timer-based and
IRQ scheduling.
>
> When I tried to load 'module-alsa-sink' with 'mmap=0 tsched=1'
parameters, tsched(timer-based scheduling) becomes disabled by below codes.
>
> It seems tsched is allowed only mmap supported ALSA devices. Why tsched
disabled while use non-mmap driven ALSA?

Do you meam irq mode not working well ?

cat /proc/asound/card0/pcm1p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 2048
buffer_size: 4096

Seem your sound card 16K buffer size are less than default fragment *
default fragment time (100 ms)

Can the driver increase periods_max ?

It is impossible to rewind safely if you sound card only support two
periods and DMA_RESIDUE_GRANULARITY_SEGMENT

>
> So, I found able to use tsched with 'mmap=0' option with below workaround
code.
>
> I think it seems possible to use 'mmap=0 tsched=1' together. There are
any reasons for that?
>

cat /proc/asound/card0/pcm1p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 4096
buffer_size: 4096

Most likely your sound card need to support DMA_RESIDUE_GRANULARITY_BURST
if you want to use timer scheduling

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa?id=051d82133f0ae6a57bf66fd200bc8e3591a7d5ca

#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC)                /* 10ms
-- Sleep at least 10ms on each iteration */
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC)                /* 4ms
-- Wakeup at least this long before the buffer runs empty*/

Seem minimum latency of timer scheduling is 14ms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20141220/4c9736b0/attachment.html>


More information about the pulseaudio-discuss mailing list