[MPlayer-dev-eng] [PATCH] Add audio support for sndio API.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Dec 11 21:10:52 CET 2013


On Wed, Dec 11, 2013 at 10:31:36AM +0100, Alexandre Ratchov wrote:
> On Wed, Dec 11, 2013 at 09:39:55AM +0100, Reimar Döffinger wrote:
> > On 10.12.2013, at 23:45, Alexandre Ratchov <alex at caoua.org> wrote:
> > > On Mon, Dec 09, 2013 at 11:11:18PM +0100, Reimar Döffinger wrote:
> > >> 
> > >> The no sound issue was a VirtualBox misconfiguration.
> > >> So -ao oss now works perfectly, but -ao sndio only hangs
> > >> without even making a beep (though accepting some data
> > >> at first, around 40k of 80k offered).
> > > 
> > > Virtual machines are known to have broken sound on OpenBSD :(
> > 
> > Problem is, sound isn't broken, OSS works fine.
> 
> no it doesn't. It might work in one particular case, with one
> device but the openbsd implementatino is broken in thousand of
> other cases/devices.
> 
> > If OSS can work, why would sndio just hang?
> 
> probably because nobody uses audio on VMs, so nobody cares about
> fixing the driver to work with the emulated device.

Well, but if OSS works, doesn't that mean the driver works?
At least well enough to play some audio...
Or does sndio use its completely separate driver?

> > I also couldn't find a way to get an error message to the user in
> > case something is wrong, for example the documentation says that
> > in case of error sio_write returns 0, so it is not even possible
> > to detect errors?!
> 
> 0 or any value different from the requested length is an error,

I can't see how that can work, there is a non-blocking mode (which I
btw. would think we should be using), and in that one certainly
return values < len are completely normal.
Not to mention that values > 0 certainly can't be an (real) error, it
accepted data after all!

> example:
> 
>     n = sio_write(hdl, data, len);
>     delay += n;
>     if (n != len)
>         return -1;
>     return n;
> 
> Still video hangs with this.

I was more thinking of "return len", but I realize that won't really
work well either.


More information about the MPlayer-dev-eng mailing list