+// this makes the longest (blocking) write 1024 samples
+// if this is not done, the video can be jerky
+ AudioDevice *audio_device = device->device;
+ int frame_size = audio_device->get_ochannels() * audio_device->get_obits()/8;
+ int maxsz = 1024*frame_size, blksz = maxsz;
+ ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blksz);
+ if( blksz > maxsz ) blksz = maxsz;
+