Hi, I'm a developer from the aMSN project, which uses libsnack (for Tcl). There's been a report from a user that he can't use libsnack to record from his USB microphone. The problem is that it fails to open the device. I looked through the code (unix/jkAudIO_oss.c) and I found the cause of the issue in the function SnackAudioOpen. The problem is explained in the post of this forum thread : http://www.amsn-project.net/forums/viewtopic.php?p=19370#19370
In short, you open the device in non blocking mode with write only access first to make sure the device is not locked by another process, then you close it and reopen it in blocking mode, depending on the mode (RECORD or PLAY), either with read only or with write only access mode. The problem is that, while this would work without issues on a sound card on /dev/dsp, if users try this on a /dev/dsp1 (for example) that is a usb microphone (for example) which doesn't allow us to open it in write mode (since there is no output to a microphone), then the open will always fail on this first workaround check. While a user can give write access to /dev/dsp1, the driver behind it *could* refuse a write access open. A solution would be to replace the line 81 : A->afd = open(device, O_WRONLY|O_NONBLOCK); into something like : A->afd = open(device, (mode == PLAY ? O_WRONLY : O_RDONLY) |O_NONBLOCK); or something similar (I can't test it here). I'm sure you'll be able to fix it in a clean way. I hope you can fix this issue for a future version of libsnack. Please keep me informed on the status of this issue. Thank you, KaKaRoTo ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel