FreeBSD OSS + Alsa - what's the right behaviour for non-blocking IO?
Adrian Chadd
adrian at freebsd.org
Tue Mar 12 22:58:35 UTC 2013
On 12 March 2013 15:31, Adrian Chadd <adrian at freebsd.org> wrote:
> So I'll go and tinker with the ALSA setup side in order to see what
> the story is (it's almost certain I'm setting things up incorrectly
> for non-blocking IO here and I need to to wave the right magic wand to
> get the low watermark reset right.
>
> However, there's definitely a behavioural difference here - FreeBSD
> shouldn't be returning POLLOUT on the dsp device, only to find that
> there's no space in the playback FIFO.
As a follow-up, I hacked the alsa oss plugin to see what was going on,
and here's what is happening inside oss_pointer():
oss_pointer: bi.bytes=3764, bi.fragments=0, bi.fragstotal=32, bi.fragsize=4096
(and 100 more of the above..)
oss_pointer: bi.bytes=5644, bi.fragments=1, bi.fragstotal=32, bi.fragsize=4096
oss_pointer: bi.bytes=5644, bi.fragments=1, bi.fragstotal=32, bi.fragsize=4096
each one of those is from a trip through poll() -> alsa get navail.
So I think the kernel sound code is returning that the FD is ready
even though there's no space in the write FIFO.
Is this enough for a PR?
Thanks,
Adrian
More information about the freebsd-multimedia
mailing list