GNOME Bugzilla – Bug 94429
gst_osssink_open_audio fails to open when blocked
Last modified: 2004-12-22 21:47:04 UTC
Actually found this when testing 'rhythmbox'. The osssink fails to open with the error "osssink: unable to open the sound device (in use ?)". Looked at the code for 'gst_osssink_open_audio' in 'gst-plugins/sys/oss/gstosssink.c'. When the call to open the device with O_NONBLOCK fails, the function returns false. Should it not try and open the device in blocking mode? If the device has already been opened, which it always has on my installation, this call with always fail. So the code .. sink->fd = open (sink->device, O_WRONLY | O_NONBLOCK); if (errno == EBUSY) { g_warning ("osssink: unable to open the sound device (in use ?)\n"); return FALSE; } ... could be replaced with ... sink->fd = open (sink->device, O_WRONLY | O_NONBLOCK); if (errno == EBUSY) { g_warning ("osssink: unable to open the sound device (in use ?)\n"); } ... and the rest of the function will be executed. I've tested it and it works for me!
patch looks good. Wim, any reason not to commit this fix ?
Mark, Wim is a bit unsure what this patch is meant to do. Could you please explain what problem it solved. It seems to ignore the return code, but we are not sure why you think it is a good idea to ignore errors.
This is from my testing of rhytmbox. The function as is ALWAYS fails to open the device with O_NONBLOCK (with EBUSY as it is already open), and then simply returns failure. The patch is to try to open O_NONBLOCK, and then open without it (if it fails), rather than simply returning failure after the first open. The error is not ignored, but the rest of the code in the function actually gets called. My installation of rhythmbox (which uses osssink via monkey-media) simply doesn't make a sound without this change.
ok, that makes perfect sense, will patch soon.
Is this applied now? Can I close this bug?
It wasn't applied in the latest stable version, and I cannot see the change in CVS, so I'm guessing its fallen by the way side. Change is still required to get OSS to work with mm/rb.
Patch should now be applied to cvs. closing. thanks a lot