Messages in this thread | | | Date | Tue, 30 Mar 1999 14:45:04 +0200 | From | Benno Senoner <> | Subject | better low latency audio support in future kernels ? |
| |
Hi,
I had sound drop-outs when playing PCM data from a large RAM buffer (not from disk!) , to a 24k sound buffer (3 x 8k fragments), I have an interactive application which must have low-latency (for example user can change the playback speed in relatime and so on .)
The ram-player is scheduled with realtime priority s normally there are no drop-outs, but since I must rip audiotracks from a Plextor 20x SCSI CDROM in background, there is quite heavy disk write acrivity. (the disk is a IBM 6.4GB ATA UDMA) (I use Linux 2.2.4 the SCSI controller is an AHA2940)
My problem was : everytime cdda2wav finish to rip a track, the file buffers gets synced, and the sound drops out for a fraction of second, due to the fact that kernel blocks the for too much time, and blocks even real-time scheduled prcesses.
I tried to play with some programs to improve audio performance:
1) hdparm -u 1 /dev/hda : sound dropouts still present
2) /sbin/update -f 1 : sound drop outs still present
3) inserted an fsync / fflush after each buffer write in cdda2wav : EVEN WORSE , still many sound drop-outs
4) launched this simple script in background
while true ; do sync sleep 2 done
AND THIS IS THE ONLY THAT WORKS !!
I monitor constantly (testing this with OSS) the struct audio_buf_info.fragments which gives me the used fragments, Normally this value =0 , using the above script to sync every 2 second,
there are no more audible sound drop-outs but the fragments value goes to 1 or 2 when cdda2wav finish to rip a track.
Do you know if there are some plans for future kernels, to avoid blocking realtime scheduled processes for more than 10-20ms during heavy disk writes ?
I think this is a feature which is quite often needed in real-time multimedia applications, especially harddisk recording in conjunction with playing low-latency audio.
take for example an audio sequencer alla "Cubase VST" and a realtime synthesizer like "Generator". with enough horse-power , under windoze you can run these 2 applications at the same time and record audio while "Generator" plays in realtime (emulating an analog synth) the notes you play on a midi keyboard (with low-latency 50ms)
I think Linux should provide a base, to allow running such applications smoothly at the same time, so that we have a rock-solid platform to run not only web/file servers but high-performance audio applications.
Do you know if the kernel developers have plans to address this issue.
thank you for infos,
regards, Benno.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |