>> count = (avail / period_size) * period_size; > > count = avail - avail % period_size; > >is more efficient (at least on i386 and gcc).
thanks for reminding me. alas, there is still a problem. could it just be a device-specific issue? its as if the snd_pcm_mmap_commit doesn't work on the playback stream on the trident ... source: ------- http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/jackit/jack/alsa_driver.c?rev=1.5&content-type=text/plain params: ------- period_size = 64; buffer_size = 2 * period_size; `hw_avail' = values reported by snd_pcm_avail_update() on return from poll(2) for each stream `this_time' = the minimum of the two hw_avail values, processed via the mod expression above `contiguous' = smaller of the values returned by snd_pcm_mmap_begin() for the two streams, having been passed `this_time' as an upper limit this is the number passed to snd_pcm_mmap_commit() for each stream. behaviour on a hammerfall (correct): ----------------------------------- hw avail: c:64 p:64 this time = 64 contiguous = 64 hw avail: c:64 p:64 this time = 64 contiguous = 64 hw avail: c:64 p:64 this time = 64 contiguous = 64 hw avail: c:64 p:64 this time = 64 contiguous = 64 hw avail: c:64 p:64 etc. etc. etc. behaviour on a trident (problem) ------------------------------- hw avail: c:64 p:65 this time = 64 contiguous = 64 hw avail: c:64 p:66 this time = 64 contiguous = 64 hw avail: c:0 p:65 this time = 0 hw avail: c:0 p:65 this time = 0 hw avail: c:65 p:65 this time = 64 contiguous = 64 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 hw avail: c:1 p:66 this time = 0 [ ... continues like this for quite some time ... then: ] hw avail: c:64 p:65 this time = 64 contiguous = 64 hw avail: c:64 p:66 this time = 64 contiguous = 64 hw avail: c:64 p:65 this time = 64 contiguous = 64 hw avail: c:0 p:66 this time = 0 _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel