Jacob Meuser wrote:
On Sun, Dec 14, 2008 at 06:09:24PM +0100, Martin Toft wrote:
A small follow-up:
The problem only occurs when opening the audio device. If I queue a
number of tracks in mpd's playlist and let it play, then it does not
suddenly start making noise from one track to the next. It only happens
when I manually start a track (and only sometimes). I suspect that mpd
does not close the audio device between tracks if it is playing from its
playlist, and that is probably why the problem does not occur in that
setting.
thanks for this and your other response.
The issue I see regularly with azalia+vlc+jackd may be related maybe not.
nice jackd --silent --nozombies -t 10000 -d sun -p 4096 2>&1 1>/dev/null &
- this is how I run jackd.
Here is the scenario:
- I start vlc and play something,
- I start heavy application (like Thunderbird/Firefox @ hw.setperf=0),
- sound stutters (threads blocking?),
- at this point, with ~20% probability, I hear cyclic audio fragment
which overlaps main sound,
- the issue can be remedied by restarting jack entirely or by starting
any heavy application again (~20% probability).
For me, it looks like a junk data somewhere in a buffer.
Our audio layer and NetBSD are different wrt buffers handling so I
took a deeper look and discovered the following commit
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/audio.c.diff?r1=1.184&r2=1.184.2.27&f=h
For me, the interesting part here is
...
/*
* "used <= cb->usedlow" should be "used < blksize" ideally.
* Some HW drivers such as uaudio(4) does not call audio_pint()
* at accurate timing. If used < blksize, uaudio(4) already
* request transfer of garbage data.
*/
if (used <= cb->usedlow && !cb->copying && sc->sc_npfilters > 0) {
/* we might have data in filter pipeline */
null_fetcher.fetch_to = null_fetcher_fetch_to;
fetcher = &sc->sc_pfilters[sc->sc_npfilters - 1]->base;
sc->sc_pfilters[0]->set_fetcher(sc->sc_pfilters[0],
&null_fetcher);
used = audio_stream_get_used(sc->sc_pustream);
cc = cb->s.end - cb->s.start;
fetcher->fetch_to(fetcher, &cb->s, cc);
cb->fstamp += audio_stream_get_used(sc->sc_pustream) - used;
used = audio_stream_get_used(&cb->s);
}
...
Also, I should mention I can even hear such a cyclic fragment over
the ~2 seconds *after* I press stop button in vlc.
Alexey