On 24.08.2014 18:15, Kamil Ignacak wrote:
    Since libcw6 was built with OSS support, and OSS was configured
    correctly on the build machine, unixcw should be able to use OSS
    audio sink without problems.


Hi!

The attached patch fixes the problem on FreeBSD, and does not negatively influence behavior of libcw6 on other platforms.

I hope that the comment inside of the patch provides enough explanation of the fix.

Best regards,
Kamil Ignacak
upstream developer

diff --git a/src/libcw/libcw_oss.c b/src/libcw/libcw_oss.c
index 38bfc9a..1016487 100644
--- a/src/libcw/libcw_oss.c
+++ b/src/libcw/libcw_oss.c
@@ -292,12 +292,25 @@ int cw_oss_open_device_ioctls_internal(int *fd, int *sample_rate)
 		return CW_FAILURE;
         }
 
+#if 0
+	/*
+	   This ioctl call failed on FreeBSD 10, which resulted in
+	   libcw failing to open OSS device. A bit of digging on the
+	   web revealed this:
+
+	   OSS4:
+	   http://manuals.opensound.com/developer/SNDCTL_DSP_POST.html:
+	   "This ioctl call is provided for compatibility with older
+	   applications. It has no practical purpose and should in no
+	   case be used in new applications."
+	*/
 	parameter = 0; /* ignored */
 	if (ioctl(*fd, SNDCTL_DSP_POST, &parameter) == -1) {
 		cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
 			      "cw_oss: ioctl(SNDCTL_DSP_POST): \"%s\"", strerror(errno));
 		return CW_FAILURE;
         }
+#endif
 
 	/* Set the audio format to 8-bit unsigned. */
 	parameter = CW_OSS_SAMPLE_FORMAT;

Reply via email to