On Fri, Mar 06, 2015 at 04:24:53PM -0300, Henrique Lengler wrote: > On Fri, Mar 06, 2015 at 09:06:00AM +0100, Alexandre Ratchov wrote: > > > Also please remeber that the audio is synchronized, the lag is when I > > > want > > > to advance the video. > > > > I still don't 100% understand whether you observe an audio > > subsystem bug (>500ms latency), or you just dislike the default > > latency. > > This can't be a feature (right?), since I already use all these apps in > this same computer under linux, and they ran very fast. > > To remeber: > The behaviour that mplayer and cmus, are having, is operate with a > delay. Any change in the audio play, like advance in the audio/video, or stop > playing it, takes a time to happen. > > For example when I am in these apps and I click pause buttom, it takes a > time like 1~2 seconds to respond. And If I click more than one time, it > lags even more.
1-2 seconds is a bug. I couldn't reproduce it, unfortunately. On my box the default setup (same parameters as yours, same device) the lang is at most 500ms, as expected. IMO 500ms is too much nowadays, but before questioning it, we must fix your box to not lag 1-2s, which I consider a bug. > > If you don't like the 200-400ms latency (too conservative imo), you > > could lower sndiod buffer size, possibly patch mplayer, cmus or > > whatever to use smaller buffers as well, post diffs on ports@ and > > if this hurts no MP kernel users we'll change the defaults. This > > would improve everybody's setup. > > I already changed the buffer, and it didn't solved, as you can see here: > http://marc.info/?l=openbsd-misc&m=142368103115408&w=2 > This page have some usefull informations. > > About change the application buffers, never tried, but if these apps > worked on Linux, it should work here right, or maybe the OBSD version > have some modification. Yes we have modifications. Back around 2008, audio used to be very unsable on MP systems and sndiod used to run with lower priority. So using large buffers (around 500ms) was the only way to get stable audio. Nowadays, this is not necessary, but buffer sizes are still big because nobody tryed to reduce them. Maybe it's time now. Properly written software could probably work with 50ms buffers. Still I'm talking about 500ms. Not the 1-2s you mentioned, which I need to understand. Could you do the following: in one window, kill sndiod and start a new one as follows: sudo pkill sndiod SNDIO_DEBUG=4 sndiod -ddd 2>/tmp/log in another window: mplayer /foo/bar.mp3 after few seconds, push the right arrow key to skip forward, wait few seconds, press q, kill sndiod and send me the /tmp/log file. When you hit the right arrow key, mplayer is supposed to take 500ms to react, but on your setup it takes 1-2s, right? The file is huge, so please send it off-list. Thanks -- Alexandre