I'm sorry about the previous mail. I happened to press the wrong button and sent it prematurely. Anyway, I'll restart from the top:
Clemens Ladisch writes: > Fredrik Tolf wrote: > > Clemens Ladisch <[EMAIL PROTECTED]> writes: > > > Use "aplay something.wav", or "aplay -Dplughw:X,Y something.wav", > > > > I did that, and to my surprise it yielded the same results, > > ie. multiple aplay processes playing "short" streams blocked each > > other while "long" streams wouldn't affect anything at all. > > There are informational files below /proc/asound/card0/pcm0p/subX/, > where X is the subdevice number (your SB has 32). Please post the > contents of hw_params, info, status, and sw_params for both "short" > streams that are used when blocking (I guess the first two), and for > both "long" streams not blocking. > Some more info. I just tried the following command (test.wav is a "long" stream and click01.wav is a "short" one): aplay test.wav & aplay test.wav & aplay click01.wav & aplay click01.wav & So, all playbacks start (more or less) simultaneously. test.wav wasn't blocked at all. In fact, they were playing so simultaneously that you could hardly even hear any distortion due to phase difference. The click01.wav playbacks were blocking each other, though. The first one started playing as the test.wav playbacks started. In the light of this, I guess that a "short" stream is qualified by the entire stream fitting in a single playback buffer. I checked a little with strace on short streams of different lengths, and it seems to be the case. The first one that was larger than 8192 bytes (which is sox's buffer size) did not block. Anyway, I ran the above command again and appended the following to it: (cd /proc/asound/card0/pcm0p; \ for i in `seq 0 3`; do \ for f in hw_params info status sw_params; \ do echo sub$i/$f; \ cat sub$i/$f; \ done; \ done) And here is the output: sub0/hw_params access: RW_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 44100 (44100/1) period_size: 4096 buffer_size: 16384 tick_time: 1000 sub0/info card: 0 device: 0 subdevice: 0 stream: PLAYBACK id: emu10k1 name: EMU10K1 subname: subdevice #0 class: 0 subclass: 0 subdevices_count: 32 subdevices_avail: 28 sub0/status state: RUNNING trigger_time: 1066242726.149839000 tstamp : 1066242726.194418000 delay : 14417 avail : 1967 avail_max : 1967 ----- hw_ptr : 1967 appl_ptr : 16384 sub0/sw_params tstamp_mode: NONE period_step: 1 sleep_min: 0 avail_min: 4096 xfer_align: 4096 start_threshold: 16384 stop_threshold: 16384 silence_threshold: 0 silence_size: 0 boundary: 1073741824 sub1/hw_params access: RW_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 44100 (44100/1) period_size: 4096 buffer_size: 16384 tick_time: 1000 sub1/info card: 0 device: 0 subdevice: 1 stream: PLAYBACK id: emu10k1 name: EMU10K1 subname: subdevice #1 class: 0 subclass: 0 subdevices_count: 32 subdevices_avail: 28 sub1/status state: RUNNING trigger_time: 1066242726.152516000 tstamp : 1066242726.206890000 delay : 13985 avail : 2399 avail_max : 2399 ----- hw_ptr : 2399 appl_ptr : 16384 sub1/sw_params tstamp_mode: NONE period_step: 1 sleep_min: 0 avail_min: 4096 xfer_align: 4096 start_threshold: 16384 stop_threshold: 16384 silence_threshold: 0 silence_size: 0 boundary: 1073741824 sub2/hw_params access: RW_INTERLEAVED format: U8 subformat: STD channels: 1 rate: 22050 (22050/1) period_size: 2205 buffer_size: 11025 tick_time: 1000 sub2/info card: 0 device: 0 subdevice: 2 stream: PLAYBACK id: emu10k1 name: EMU10K1 subname: subdevice #2 class: 0 subclass: 0 subdevices_count: 32 subdevices_avail: 28 sub2/status state: DRAINING trigger_time: 1066242726.156046000 tstamp : 1066242726.219212000 delay : 3017 avail : 8008 avail_max : 8008 ----- hw_ptr : 1393 appl_ptr : 4410 sub2/sw_params tstamp_mode: NONE period_step: 1 sleep_min: 0 avail_min: 2205 xfer_align: 2205 start_threshold: 11025 stop_threshold: 11025 silence_threshold: 0 silence_size: 0 boundary: 1445068800 sub3/hw_params access: RW_INTERLEAVED format: U8 subformat: STD channels: 1 rate: 22050 (22050/1) period_size: 2205 buffer_size: 11025 tick_time: 1000 sub3/info card: 0 device: 0 subdevice: 3 stream: PLAYBACK id: emu10k1 name: EMU10K1 subname: subdevice #3 class: 0 subclass: 0 subdevices_count: 32 subdevices_avail: 28 sub3/status state: SETUP trigger_time: 0.000000000 tstamp : 1066242726.231504000 delay : 0 avail : 11025 avail_max : 0 ----- hw_ptr : 0 appl_ptr : 0 sub3/sw_params tstamp_mode: NONE period_step: 1 sleep_min: 0 avail_min: 2205 xfer_align: 2205 start_threshold: 1 stop_threshold: 11025 silence_threshold: 0 silence_size: 0 boundary: 1445068800 So I'm guessing that sub0 and sub1 are the subdevs playing the long streams, sub2 playing the short stream and sub3 blocking. Thank you very much for your time. Fredrik Tolf ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Alsa-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-user