<p><br>
><br>
><br>
> I have question something about selecting logic between timer-based and IRQ scheduling.<br>
><br>
> When I tried to load 'module-alsa-sink' with 'mmap=0 tsched=1' parameters, tsched(timer-based scheduling) becomes disabled by below codes.<br>
><br>
> It seems tsched is allowed only mmap supported ALSA devices. Why tsched disabled while use non-mmap driven ALSA?</p>
<p>Do you meam irq mode not working well ?<br></p>
<p>cat /proc/asound/card0/pcm1p/sub0/hw_params<br>
access: RW_INTERLEAVED<br>
format: S16_LE<br>
subformat: STD<br>
channels: 2<br>
rate: 48000 (48000/1)<br>
period_size: 2048<br>
buffer_size: 4096</p>
<p>Seem your sound card 16K buffer size are less than default fragment * default fragment time (100 ms)</p>
<p>Can the driver increase periods_max ?</p>
<p>It is impossible to rewind safely if you sound card only support two periods and DMA_RESIDUE_GRANULARITY_SEGMENT <br>
</p>
<p>><br>
> So, I found able to use tsched with 'mmap=0' option with below workaround code.<br>
><br>
> I think it seems possible to use 'mmap=0 tsched=1' together. There are any reasons for that?<br>
></p>
<p> cat /proc/asound/card0/pcm1p/sub0/hw_params<br>
access: RW_INTERLEAVED<br>
format: S16_LE<br>
subformat: STD<br>
channels: 2<br>
rate: 48000 (48000/1)<br>
period_size: 4096<br>
buffer_size: 4096<br><br></p>
<p>Most likely your sound card need to support DMA_RESIDUE_GRANULARITY_BURST if you want to use timer scheduling<br></p>
<p><a href="http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa?id=051d82133f0ae6a57bf66fd200bc8e3591a7d5ca">http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa?id=051d82133f0ae6a57bf66fd200bc8e3591a7d5ca</a><br><br></p>
<p>#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- Sleep at least 10ms on each iteration */<br>
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms -- Wakeup at least this long before the buffer runs empty*/</p>
<p>Seem minimum latency of timer scheduling is 14ms</p>