<p dir="ltr"><br>
On 09-Jun-2015 11:26 am, "Raymond Yau" <<a href="mailto:superquad.vortex2@gmail.com">superquad.vortex2@gmail.com</a>> wrote:<br>
><br>
> >><br>
> >><br>
> >> Â ><br>
> >> Â >  Â below is what the terminate shows when running pcm_avail.c<br>
> >> Â ><br>
> >> Â >  Â uid=0 gid=1007@nutshell:/ # alsactl_test<br>
> >> Â > min_period_size: 8 frames, dir: 0<br>
> >> Â > Playback hwparams: FIFO size is 8<br>
> >> Â > Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0 subdevice 0<br>
> >> Â > Its setup is:<br>
> >> Â >  Â stream  Â  Â  Â : PLAYBACK<br>
> >> Â >  Â access  Â  Â  Â : RW_INTERLEAVED<br>
> >> Â >  Â format  Â  Â  Â : S16_LE<br>
> >> Â >  Â subformat  Â  : STD<br>
> >> Â >  Â channels  Â  Â : 2<br>
> >> Â >  Â rate  Â  Â  Â  Â : 48000<br>
> >> Â >  Â exact rate  Â : 48000 (48000/1)<br>
> >> Â >  Â msbits  Â  Â  Â : 16<br>
> >> Â >  Â buffer_size  : 4096<br>
> >> Â >  Â period_size  : 1024<br>
> >> Â >  Â period_time  : 21333<br>
> >> Â >  Â tstamp_mode  : NONE<br>
> >> Â >  Â period_step  : 1<br>
> >> Â >  Â avail_min  Â  : 1024<br>
> >> Â >  Â period_event : 0<br>
> >> Â >  Â start_threshold  : 1024<br>
> >> Â >  Â stop_threshold  Â : 4096<br>
> >> Â >  Â silence_threshold: 0<br>
> >> Â >  Â silence_size : 0<br>
> >> Â >  Â boundary  Â  Â : 1073741824<br>
> >> Â >  Â appl_ptr  Â  Â : 0<br>
> >> Â >  Â hw_ptr  Â  Â  Â : 0<br>
> >> Â > Playing silence<br>
> >> Â > Available: 0, loop iteration: 0<br>
> >> Â > Available: 1024, loop iteration: 1469<br>
> >> Â > Available: 2048, loop iteration: 5609<br>
> >> Â > Available: 3072, loop iteration: 9667<br>
> >> Â ><br>
> >> Â >  All I got is just the 4 lines.<br>
> >><br>
> >> If your sound card only increment hw_ptr only at interrupt occur, you<br>
> >> need to increase default_rewind_safeguard from 256 bytes to your<br>
> >> selected period size<br>
> ><br>
> ><br>
> > No. PulseAudio, in timer-scheduling mode, does not use periods at all. You need to change the driver so that it reports SNDRV_PCM_INFO_BATCH, so that PulseAudio does not try to use this mode.<br>
> ><br>
> ><br>
> >><br>
> >> This mean that  your sound card won't work with timer scheduling or<br>
> >> dynamic latency, you can only archieve low latency by decrease period size<br>
> >> Why do pulseaudio enable timer scheduling when most sound card use IRQ ?<br>
> ><br>
> ><br>
> > Because most broken sound cards driver authors forget to report SNDRV_PCM_INFO_BATCH?<br>
><br>
> Why pulseaudio rely on the flag if your program can find out the granulatity ?</p>
<p dir="ltr">AFAIK, there isn't a way to figure out granularity. Having this would be nice as we could be more intelligent about our tsched behaviour.</p>
<p dir="ltr">-- Arun</p>