Re: [ecasound] Overrun ...?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] Overrun ...?
From: justin (justinrosander_AT_access-4-free.com)
Date: Fri Jun 20 2003 - 05:39:15 EEST


Hey there,
Also, I'm curious what command you issued when you got that output.

Yesterday when doing some recording, I was using a *.wav file with a sample
rate of 48 kHz, sample size of 16 bits. This is an example of the command I
issued:

ecasound -r -b:2048 -B:rtlowlatency \
-a:1 -i:drums.wav \
-a:2,3 -i:alsa,ens1371 \
-a:1,2 -o:alsa,ens1371 \
-a:3 -o:bass.wav

Now, obviously I was recording a bass track over a drum track. the drum track
has the 48 kHz sample rate as I mentioned. this is the output of ecasound
after issuing this command:

****************************************************************************
* ecasound v2.2.3 (C) 1997-2003 Kai Vehmanen
****************************************************************************
- [ Session created ] ------------------------------------------------------
- [ Chainsetup created (cmdline) ] -----------------------------------------
(eca-chainsetup) Raised-priority mode enabled. (prio:50)
(eca-chainsetup-parser) Buffering mode 'rtlowlatency' selected.
(eca-chainsetup-parser) Setting buffersize to (samples) 2048.
(eca-chainsetup-parser) Option '-sr' is obsolete. Use syntax
'-f:sfmt,channels,
rate,ileaving' instead.
- [ Connecting chainsetup ] ------------------------------------------------
(eca-chainsetup) Multitrack-mode enabled.
(eca-chainsetup) 'rtlowlatency' buffering mode selected.
(eca-chainsetup) Audio object "John_drum_track.wav", mode "read".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
(eca-chainsetup) Audio object "alsa", mode "read".
(audio-io) Format: s16_le, channels 2, srate 44100, interleaved.
(eca-chainsetup) Audio object "alsa", mode "write".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
(eca-chainsetup) Audio object "bass.wav", mode "read/write".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
- [ Chainsetup connected ] -------------------------------------------------
(eca-controller) Connected chainsetup: "command-line-setup".
- [ Controller/Starting batch processing ] ---------------------------------
- [ Engine init - Driver start ] -------------------------------------------
(eca-engine) Using realtime-scheduling (SCHED_FIFO).
(eca-engine) Prefilling i/o buffers.
(audioio-alsa) warning! playback underrun - samples lost! Break was at least
3
23 ms long.
(audioio-alsa) warning! playback underrun - samples lost! Break was at least
2
40 ms long.
(audioio-alsa) warning! playback underrun - samples lost! Break was at least
2
34 ms long.
(audioio-alsa) warning! playback underrun - samples lost! Break was at least
2
35 ms long.
(audioio-alsa) warning! playback underrun - samples lost! Break was at least
2
39 ms long.
- [ Controller/Processing stopped (cond) ] ---------------------------------
(audioio-alsa) warning! playback underrun - samples lost! Break was at least
2
38 ms long.
- [ Engine exiting ] -------------------------------------------------------
(eca-controller) Disconnecting chainsetup: "command-line-setup".
- [ Chainsetup disconnected ] ----------------------------------------------
(audioio-alsa) WARNING! While writing to ALSA-pcm device C0D0, there were 6
und
rruns.
Warning: DBC_CHECK failed - "is_prepared() != true", audioio-device.cpp, 35.

So what I got as output was a bunch of garbage......... but if you look,
ecasound was reading the input file normally, but it wanted to read my ALSA
input device at 44.1 kHz, and send the output to a 48 kHz file "bass.wav"
The results was awful, though it detuned the bass track nicely, I will say
that much! So the input format and output format has to match for ALL
inputs and outputs. So when I issue a command thus:

 ecasound -r -B:rtlowlatency -b:2048 -a:1 -i:John_drum_track.wav -a:2,3
-f:s16_le,2ch,48000,i -i:alsa,ens1371 -a:1,2 -o:alsa,ens1371 -a:3 -o:bass.wav

Take note that I issued the option '-f:s16_le,2ch,48000,i' for the input
channels 2 and 3, which is the problem area for the previous command above.
As a result, I get the following output; note that ecasound is much nicer, as
are the results of the audio objects:

****************************************************************************
* ecasound v2.2.3 (C) 1997-2003 Kai Vehmanen
****************************************************************************
- [ Session created ] ------------------------------------------------------
- [ Chainsetup created (cmdline) ] -----------------------------------------
(eca-chainsetup) Raised-priority mode enabled. (prio:50)
(eca-chainsetup-parser) Buffering mode 'rtlowlatency' selected.
(eca-chainsetup-parser) Setting buffersize to (samples) 2048.
- [ Connecting chainsetup ] ------------------------------------------------
(eca-chainsetup) Multitrack-mode enabled.
(eca-chainsetup) 'rtlowlatency' buffering mode selected.
(eca-chainsetup) Audio object "John_drum_track.wav", mode "read".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
(eca-chainsetup) Audio object "alsa", mode "read".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
(eca-chainsetup) Audio object "alsa", mode "write".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
(eca-chainsetup) Audio object "bass.wav", mode "read/write".
(audio-io) Format: s16_le, channels 2, srate 48000, interleaved.
- [ Chainsetup connected ] -------------------------------------------------
(eca-controller) Connected chainsetup: "command-line-setup".
- [ Controller/Starting batch processing ] ---------------------------------
- [ Engine init - Driver start ] -------------------------------------------
(eca-engine) Using realtime-scheduling (SCHED_FIFO).
(eca-engine) Prefilling i/o buffers.
- [ Controller/Processing stopped (cond) ] ---------------------------------
- [ Engine exiting ] -------------------------------------------------------
(eca-controller) Disconnecting chainsetup: "command-line-setup".
- [ Chainsetup disconnected ] ----------------------------------------------
- [ Controller/Batch processing finished ] ---------------------------------

All inputs and outputs match the 48000 kHz sample rate, not to mention sample
format, channels, and interleaving.

Hope this helps,
Justin
On Monday 16 June 2003 01:22 pm, you wrote:
> Hi,
>
> > (audioio-alsa) warning! playback overrun - samples lost! Break was at
> > least 0.04 ms long.
>
> this is the late great buffer overrun/underrun problem every computer sound
> freak has to deal with it, so generally it's not restricted to alsa alone.
>
> Almost all operating systems today are multitasking ones, which cannot
> devote their attention to the sound process only. To keep the sound pouring
> out of your speakers while the CPU is doing something else for a short
> while, it is buffered. Imagine a bucket with a big hole in the bottom. The
> sound is taken from the harddisk and poured into the bucket, and the sound
> card keeps draining it through the bottom hole towards the output. So you
> can easily imagine that everything which disturbs this (slow harddisk,
> heavily loaded system etc, etc) can quickly result in a buffer being
> shortly empty or still too full to take on the next flush of values.
>
> Check through the available docs on linux-sound and look for the topic
> 'latency', you'll find a lot of info on this crucial point from people who
> can explain it better than I can ..
>
> -Carsten

-- 
"I drank what?"
  --Socrates


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jun 20 2003 - 05:31:02 EEST