Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Aug 2004 16:42:07 +0100
From:      Peter Wood <peter@alastria.net>
To:        Mathew Kanner <mat@cnd.mcgill.ca>
Cc:        freebsd-chat@freebsd.org
Subject:   Re: FreeBSD pcm(4) latency (From write() to audible output)
Message-ID:  <411CE14F.3070509@alastria.net>
In-Reply-To: <20040813151230.GB280@cnd.mcgill.ca>
References:  <411C9FE9.3000905@alastria.net> <20040813151230.GB280@cnd.mcgill.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
> 	Freebsd-multimedia would be the right place.  I think what you
> want is a smaller block size.  The SNDCTL_DSP_SETBLKSIZE should be the
> right IOCTL to use, check out the oss programmers manual, I don't have
> a link right now but google should find it pretty quick.

Just to wrap this up here too:

My problem was primarly due to the fragment sizes of buffers. I don't 
know what sizes are set as default but they're to big for my 
applications. I've found with the following it killed the delay to next 
to nothing (about 5ms by my working out).

val = (2 << 16) | 9;
ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &val);

Thanks Mathew,

Pete.
-- 
Peter Wood BSc (Hons) :: <peter@alastria.net> :: Tel +44 7974 799440


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?411CE14F.3070509>