diff -ru chuck-1.3.5.1.orig/src/RtAudio/RtAudio.cpp chuck-1.3.5.1/src/RtAudio/RtAudio.cpp
--- chuck-1.3.5.1.orig/src/RtAudio/RtAudio.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/RtAudio/RtAudio.cpp	Sat Jun 20 09:23:22 2015
@@ -58,7 +58,7 @@
   #define MUTEX_DESTROY(A)    DeleteCriticalSection(A)
   #define MUTEX_LOCK(A)       EnterCriticalSection(A)
   #define MUTEX_UNLOCK(A)     LeaveCriticalSection(A)
-#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
+#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) || defined(__OPENBSD_OSS__)
   // pthread API
   #define MUTEX_INITIALIZE(A) pthread_mutex_init(A, NULL)
   #define MUTEX_DESTROY(A)    pthread_mutex_destroy(A)
@@ -102,6 +102,9 @@
 #if defined(__MACOSX_CORE__)
   apis.push_back( MACOSX_CORE );
 #endif
+#if defined(__OPENBSD_OSS__)
+  apis.push_back( OPENBSD_OSS );
+#endif
 #if defined(__RTAUDIO_DUMMY__)
   apis.push_back( RTAUDIO_DUMMY );
 #endif
@@ -141,6 +144,10 @@
   if ( api == MACOSX_CORE )
     rtapi_ = new RtApiCore();
 #endif
+#if defined(__OPENBSD_OSS__)
+  if ( api == OPENBSD_OSS )
+    rtapi_ = new RtApiOss();
+#endif
 #if defined(__RTAUDIO_DUMMY__)
   if ( api == RTAUDIO_DUMMY )
     rtapi_ = new RtApiDummy();
@@ -7006,13 +7013,22 @@
 //******************** End of __LINUX_PULSE__ *********************//
 #endif
 
-#if defined(__LINUX_OSS__)
+#if defined(__LINUX_OSS__) || defined(__OPENBSD_OSS__)
 
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include "soundcard.h"
+#ifdef __OPENBSD_OSS__
+#undef ioctl
+#define DAC_NAME "/dev/audio"
+#define MAX_DEVICES 16
+#define MAX_CHANNELS 16
+#define SNDCTL_DSP_HALT SNDCTL_DSP_RESET
+#else
+#define _oss_ioctl ioctl
+#endif
 #include <errno.h>
 #include <math.h>
 
@@ -7040,6 +7056,7 @@
   if ( stream_.state != STREAM_CLOSED ) closeStream();
 }
 
+#if !defined(__OPENBSD_OSS__)
 unsigned int RtApiOss :: getDeviceCount( void )
 {
   int mixerfd = open( "/dev/mixer", O_RDWR, 0 );
@@ -7050,7 +7067,7 @@
   }
 
   oss_sysinfo sysinfo;
-  if ( ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ) == -1 ) {
+  if ( _oss_ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ) == -1 ) {
     close( mixerfd );
     errorText_ = "RtApiOss::getDeviceCount: error getting sysinfo, OSS version >= 4.0 is required.";
     error( RtError::WARNING );
@@ -7061,6 +7078,7 @@
   return sysinfo.numaudios;
 }
 
+
 RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
 {
   RtAudio::DeviceInfo info;
@@ -7074,7 +7092,7 @@
   }
 
   oss_sysinfo sysinfo;
-  int result = ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo );
+  int result = _oss_ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo );
   if ( result == -1 ) {
     close( mixerfd );
     errorText_ = "RtApiOss::getDeviceInfo: error getting sysinfo, OSS version >= 4.0 is required.";
@@ -7099,7 +7117,7 @@
 
   oss_audioinfo ainfo;
   ainfo.dev = device;
-  result = ioctl( mixerfd, SNDCTL_AUDIOINFO, &ainfo );
+  result = _oss_ioctl( mixerfd, SNDCTL_AUDIOINFO, &ainfo );
   close( mixerfd );
   if ( result == -1 ) {
     errorStream_ << "RtApiOss::getDeviceInfo: error getting device (" << ainfo.name << ") info.";
@@ -7170,12 +7188,284 @@
   return info;
 }
 
+#else
 
+unsigned int RtApiOss :: getDeviceCount( void )
+{
+  // Count cards and devices
+  int num = 0;
+
+  // We check /dev/dsp before probing devices.  /dev/dsp is supposed to
+  // be a link to the "default" audio device, of the form /dev/dsp0,
+  // /dev/dsp1, etc...  However, I've seen many cases where /dev/dsp was a
+  // real device, so we need to check for that.  Also, sometimes the
+  // link is to /dev/dspx and other times just dspx.  I'm not sure ho
+  // the latter works, but it does.
+  char device_name[16];
+  int i;
+
+  // The OSS API doesn't provide a routine for determining the number
+  // of devices.  Thus, we'll just pursue a brute force method.  The
+  // idea is to start with /dev/dsp(0) and continue with higher device
+  // numbers until we reach MAX_DSP_DEVICES.  This should tell us how
+  // many devices we have ... it is not a fullproof scheme, but hopefully
+  // it will work most of the time.
+  int fd = 0;
+  for (i=0; i<MAX_DEVICES; i++) {
+    sprintf(device_name, "%s%d", DAC_NAME, i);
+
+    // First try to open the device for playback, then record mode.
+    fd = open(device_name, O_WRONLY | O_NONBLOCK);
+    if (fd == -1) {
+      // Open device for playback failed ... either busy or doesn't exist.
+      if (errno != EBUSY && errno != EAGAIN) {
+        // Try to open for capture
+        fd = open(device_name, O_RDONLY | O_NONBLOCK);
+        if (fd == -1) {
+          // Open device for record failed.
+          if (errno != EBUSY && errno != EAGAIN)
+            continue;
+          else {
+            errorStream_ << "RtApiOss: OSS record device (" << device_name << ") is busy.";
+            errorText_ = errorStream_.str();
+            error(RtError::WARNING);
+            // still count it for now
+          }
+        }
+      }
+      else {
+        errorStream_ << "RtApiOss: OSS playback device (" << device_name << ") is busy.";
+        errorText_ = errorStream_.str();
+        error(RtError::WARNING);
+        // still count it for now
+      }
+    }
+
+    if (fd >= 0) close(fd);
+    num++;
+  }
+  return num;
+}
+
+
+RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
+{
+  RtAudio::DeviceInfo info;
+  info.probed = false;
+  int i, fd, channels, mask;
+
+  // The OSS API doesn't provide a means for probing the capabilities
+  // of devices.  Thus, we'll just pursue a brute force method.
+
+  char device_name[16];
+  sprintf(device_name, "%s%d", DAC_NAME, device);
+
+  // First try for playback
+  fd = open(device_name, O_WRONLY | O_NONBLOCK);
+  if (fd == -1) {
+    if (errno == EBUSY || errno == EAGAIN)
+      errorStream_ << "RtApiOss: OSS playback device (" << device_name << ") is busy and cannot be probed.";
+    else
+      errorStream_ << "RtApiOss: OSS playback device (" << device_name << ") open error.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    goto capture_probe;
+  }
+  // We have an open device ... see how many channels it can handle
+  for (i=MAX_CHANNELS; i>0; i--) {
+    channels = i;
+    if (_oss_ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) == -1) {
+      // This would normally indicate some sort of hardware error, but under ALSA's
+      // OSS emulation, it sometimes indicates an invalid channel value.  Further,
+      // the returned channel value is not changed. So, we'll ignore the possible
+      // hardware error.
+      continue;
+    }
+    // Check to see whether the device supports the requested number of channels
+    if (channels != i ) continue;
+    break;
+  }
+  info.outputChannels = i;
+  close(fd);
+
+capture_probe:
+  // Now try for capture
+  fd = open(device_name, O_RDONLY | O_NONBLOCK);
+  if (fd == -1) {
+    if (errno == EBUSY || errno == EAGAIN)
+      errorStream_ << "RtApiOss: OSS capture device (" << device_name << ") is busy and cannot be probed.";
+    else
+      errorStream_ << "RtApiOss: OSS capture device (" << device_name << ") open error.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    if (info.outputChannels == 0)
+      return info;
+    goto probe_parameters;
+  }
+
+  // We have the device open for capture ... see how many channels it can handle
+  for (i=MAX_CHANNELS; i>0; i--) {
+    channels = i;
+    if (_oss_ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) == -1 || channels != i)
+      continue;
+    break;
+  }
+  info.inputChannels = i;
+  close(fd);
+
+  if (info.outputChannels == 0 && info.inputChannels == 0) {
+    errorStream_ << "RtApiOss: device (" << device_name << ") reports zero channels for input and output.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  // If device opens for both playback and capture, we determine the channels.
+  if (info.outputChannels == 0 || info.inputChannels == 0)
+    goto probe_parameters;
+
+  fd = open(device_name, O_RDWR | O_NONBLOCK);
+  if (fd == -1)
+    goto probe_parameters;
+
+  _oss_ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
+  _oss_ioctl(fd, SNDCTL_DSP_GETCAPS, &mask);
+  if (mask & DSP_CAP_DUPLEX) {
+    // We have the device open for duplex ... see how many channels it can handle
+    for (i=MAX_CHANNELS; i>0; i--) {
+      channels = i;
+      if (_oss_ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) == -1 || channels != i)
+        continue;
+      break;
+    }
+    info.duplexChannels = i;
+  }
+  close(fd);
+
+probe_parameters:
+  // At this point, we need to figure out the supported data formats
+  // and sample rates.  We'll proceed by openning the device in the
+  // direction with the maximum number of channels, or playback if
+  // they are equal.  This might limit our sample rate options, but so
+  // be it.
+
+  if (info.outputChannels >= info.inputChannels) {
+    fd = open(device_name, O_WRONLY | O_NONBLOCK);
+    channels = info.outputChannels;
+  }
+  else {
+    fd = open(device_name, O_RDONLY | O_NONBLOCK);
+    channels = info.inputChannels;
+  }
+
+  if (fd == -1) {
+    errorStream_ << "RtApiOss: device (" << device_name << ") won't reopen during probe.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  // We have an open device ... set to maximum channels.
+  i = channels;
+  if (_oss_ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) == -1 || channels != i) {
+    close(fd);
+    errorStream_ << "RtApiOss: device (" << device_name << ") won't revert to previous channel setting.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  if (_oss_ioctl(fd, SNDCTL_DSP_GETFMTS, &mask) == -1) {
+    close(fd);
+    errorStream_ << "RtApiOss: device (" << device_name << ") can't get supported audio formats.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  // Probe the supported data formats ... we don't care about endian-ness just yet.
+  int format;
+  info.nativeFormats = 0;
+#if defined (AFMT_S32_BE)
+  // This format does not seem to be in the 2.4 kernel version of OSS soundcard.h
+  if (mask & AFMT_S32_BE) {
+    format = AFMT_S32_BE;
+    info.nativeFormats |= RTAUDIO_SINT32;
+  }
+#endif
+#if defined (AFMT_S32_LE)
+  /* This format is not in the 2.4.4 kernel version of OSS soundcard.h */
+  if (mask & AFMT_S32_LE) {
+    ormat = AFMT_S32_LE;
+    info.nativeFormats |= RTAUDIO_SINT32;
+  }
+#endif
+  if (mask & AFMT_S8) {
+    format = AFMT_S8;
+    info.nativeFormats |= RTAUDIO_SINT8;
+  }
+  if (mask & AFMT_S16_BE) {
+    format = AFMT_S16_BE;
+    info.nativeFormats |= RTAUDIO_SINT16;
+  }
+  if (mask & AFMT_S16_LE) {
+    format = AFMT_S16_LE;
+    info.nativeFormats |= RTAUDIO_SINT16;
+  }
+
+  // Check that we have at least one supported format
+  if (info.nativeFormats == 0) {
+    close(fd);
+    errorStream_ << "RtApiOss: device (" << device_name << ") data format not supported by RtAudio.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  // Set the format
+  i = format;
+  if (_oss_ioctl(fd, SNDCTL_DSP_SETFMT, &format) == -1 || format != i) {
+    close(fd);
+    errorStream_ << "RtApiOss: device (" << device_name << ") error setting data format.";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  // Probe the supported sample rates
+  info.sampleRates.clear();
+  for (unsigned int k=0; k<MAX_SAMPLE_RATES; k++) {
+    int speed = SAMPLE_RATES[k];
+    if (_oss_ioctl(fd, SNDCTL_DSP_SPEED, &speed) != -1 && speed == (int)SAMPLE_RATES[k])
+      info.sampleRates.push_back(speed);
+  }
+
+  if (info.sampleRates.size() == 0) {
+    close(fd);
+    errorStream_ << "RtApiOss: no supported sample rates found for device (" << device_name << ").";
+    errorText_ = errorStream_.str();
+    error(RtError::WARNING);
+    return info;
+  }
+
+  close(fd);
+  info.probed = true;
+  info.name = device_name;
+  return info;
+}
+#endif
+
+
 bool RtApiOss :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
                                   unsigned int firstChannel, unsigned int sampleRate,
                                   RtAudioFormat format, unsigned int *bufferSize,
                                   RtAudio::StreamOptions *options )
 {
+  char device_name[16];
+  int result;
+#if defined(__OPENBSD_OSS__)
+  sprintf(device_name, "%s%d", DAC_NAME, device);
+#else
   int mixerfd = open( "/dev/mixer", O_RDWR, 0 );
   if ( mixerfd == -1 ) {
     errorText_ = "RtApiOss::probeDeviceOpen: error opening '/dev/mixer'.";
@@ -7183,7 +7473,7 @@
   }
 
   oss_sysinfo sysinfo;
-  int result = ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo );
+  result = _oss_ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo );
   if ( result == -1 ) {
     close( mixerfd );
     errorText_ = "RtApiOss::probeDeviceOpen: error getting sysinfo, OSS version >= 4.0 is required.";
@@ -7207,7 +7497,7 @@
 
   oss_audioinfo ainfo;
   ainfo.dev = device;
-  result = ioctl( mixerfd, SNDCTL_AUDIOINFO, &ainfo );
+  result = _oss_ioctl( mixerfd, SNDCTL_AUDIOINFO, &ainfo );
   close( mixerfd );
   if ( result == -1 ) {
     errorStream_ << "RtApiOss::getDeviceInfo: error getting device (" << ainfo.name << ") info.";
@@ -7225,6 +7515,8 @@
     errorText_ = errorStream_.str();
     return FAILURE;
   }
+  device_name = ainfo.devnode;
+#endif
 
   int flags = 0;
   OssHandle *handle = (OssHandle *) stream_.apiHandle;
@@ -7235,14 +7527,16 @@
       // We just set the same device for playback ... close and reopen for duplex (OSS only).
       close( handle->id[0] );
       handle->id[0] = 0;
+#if !defined(__OPENBSD_OSS__)
       if ( !( ainfo.caps & PCM_CAP_DUPLEX ) ) {
-        errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support duplex mode.";
+        errorStream_ << "RtApiOss::probeDeviceOpen: device (" << device_name << ") does not support duplex mode.";
         errorText_ = errorStream_.str();
         return FAILURE;
       }
+#endif
       // Check that the number previously set channels is the same.
       if ( stream_.nUserChannels[0] != channels ) {
-        errorStream_ << "RtApiOss::probeDeviceOpen: input/output channels must be equal for OSS duplex device (" << ainfo.name << ").";
+        errorStream_ << "RtApiOss::probeDeviceOpen: input/output channels must be equal for OSS duplex device (" << device_name << ").";
         errorText_ = errorStream_.str();
         return FAILURE;
       }
@@ -7257,12 +7551,12 @@
 
   // Try to open the device.
   int fd;
-  fd = open( ainfo.devnode, flags, 0 );
+  fd = open( device_name, flags, 0 );
   if ( fd == -1 ) {
     if ( errno == EBUSY )
-      errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") is busy.";
+      errorStream_ << "RtApiOss::probeDeviceOpen: device (" << device_name << ") is busy.";
     else
-      errorStream_ << "RtApiOss::probeDeviceOpen: error opening device (" << ainfo.name << ").";
+      errorStream_ << "RtApiOss::probeDeviceOpen: error opening device (" << device_name << ").";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7281,19 +7575,21 @@
 
   // Check the device channel support.
   stream_.nUserChannels[mode] = channels;
+#if !defined(__OPENBSD_OSS__)
   if ( ainfo.max_channels < (int)(channels + firstChannel) ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: the device (" << ainfo.name << ") does not support requested channel parameters.";
+    errorStream_ << "RtApiOss::probeDeviceOpen: the device (" << device_name << ") does not support requested channel parameters.";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
+#endif
 
   // Set the number of channels.
   int deviceChannels = channels + firstChannel;
-  result = ioctl( fd, SNDCTL_DSP_CHANNELS, &deviceChannels );
+  result = _oss_ioctl( fd, SNDCTL_DSP_CHANNELS, &deviceChannels );
   if ( result == -1 || deviceChannels < (int)(channels + firstChannel) ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: error setting channel parameters on device (" << ainfo.name << ").";
+    errorStream_ << "RtApiOss::probeDeviceOpen: error setting channel parameters on device (" << device_name << ").";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7301,10 +7597,10 @@
 
   // Get the data format mask
   int mask;
-  result = ioctl( fd, SNDCTL_DSP_GETFMTS, &mask );
+  result = _oss_ioctl( fd, SNDCTL_DSP_GETFMTS, &mask );
   if ( result == -1 ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: error getting device (" << ainfo.name << ") data formats.";
+    errorStream_ << "RtApiOss::probeDeviceOpen: error getting device (" << device_name << ") data formats.";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7324,12 +7620,15 @@
       deviceFormat = AFMT_S16_NE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT16;
     }
+#if defined(AFMT_S16_OE)
     else if ( mask & AFMT_S16_OE ) {
       deviceFormat = AFMT_S16_OE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT16;
       stream_.doByteSwap[mode] = true;
     }
+#endif
   }
+#if defined(AFMT_S24_NE) && defined(AFMT_S24_OE)
   else if ( format == RTAUDIO_SINT24 ) {
     if ( mask & AFMT_S24_NE ) {
       deviceFormat = AFMT_S24_NE;
@@ -7341,6 +7640,8 @@
       stream_.doByteSwap[mode] = true;
     }
   }
+#endif
+#if defined(AFMT_S32_NE) && defined(AFMT_S32_OE)
   else if ( format == RTAUDIO_SINT32 ) {
     if ( mask & AFMT_S32_NE ) {
       deviceFormat = AFMT_S32_NE;
@@ -7352,6 +7653,7 @@
       stream_.doByteSwap[mode] = true;
     }
   }
+#endif
 
   if ( deviceFormat == -1 ) {
     // The user requested format is not natively supported by the device.
@@ -7359,29 +7661,39 @@
       deviceFormat = AFMT_S16_NE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT16;
     }
+#if defined(AFMT_S32_NE)
     else if ( mask & AFMT_S32_NE ) {
       deviceFormat = AFMT_S32_NE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT32;
     }
+#endif
+#if defined(AFMT_S24_NE)
     else if ( mask & AFMT_S24_NE ) {
       deviceFormat = AFMT_S24_NE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT24;
     }
+#endif
+#if defined(AFMT_S16_OE)
     else if ( mask & AFMT_S16_OE ) {
       deviceFormat = AFMT_S16_OE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT16;
       stream_.doByteSwap[mode] = true;
     }
+#endif
+#if defined(AFMT_S32_OE)
     else if ( mask & AFMT_S32_OE ) {
       deviceFormat = AFMT_S32_OE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT32;
       stream_.doByteSwap[mode] = true;
     }
+#endif
+#if defined(AFMT_S24_OE)
     else if ( mask & AFMT_S24_OE ) {
       deviceFormat = AFMT_S24_OE;
       stream_.deviceFormat[mode] = RTAUDIO_SINT24;
       stream_.doByteSwap[mode] = true;
     }
+#endif
     else if ( mask & AFMT_S8) {
       deviceFormat = AFMT_S8;
       stream_.deviceFormat[mode] = RTAUDIO_SINT8;
@@ -7391,17 +7703,17 @@
   if ( stream_.deviceFormat[mode] == 0 ) {
     // This really shouldn't happen ...
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") data format not supported by RtAudio.";
+    errorStream_ << "RtApiOss::probeDeviceOpen: device (" << device_name << ") data format not supported by RtAudio.";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
 
   // Set the data format.
   int temp = deviceFormat;
-  result = ioctl( fd, SNDCTL_DSP_SETFMT, &deviceFormat );
+  result = _oss_ioctl( fd, SNDCTL_DSP_SETFMT, &deviceFormat );
   if ( result == -1 || deviceFormat != temp ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: error setting data format on device (" << ainfo.name << ").";
+    errorStream_ << "RtApiOss::probeDeviceOpen: error setting data format on device (" << device_name << ").";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7420,10 +7732,10 @@
   if ( options && options->flags & RTAUDIO_MINIMIZE_LATENCY ) buffers = 2;
   if ( buffers < 2 ) buffers = 3;
   temp = ((int) buffers << 16) + (int)( log10( (double)ossBufferBytes ) / log10( 2.0 ) );
-  result = ioctl( fd, SNDCTL_DSP_SETFRAGMENT, &temp );
+  result = _oss_ioctl( fd, SNDCTL_DSP_SETFRAGMENT, &temp );
   if ( result == -1 ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: error setting buffer size on device (" << ainfo.name << ").";
+    errorStream_ << "RtApiOss::probeDeviceOpen: error setting buffer size on device (" << device_name << ").";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7435,10 +7747,10 @@
 
   // Set the sample rate.
   int srate = sampleRate;
-  result = ioctl( fd, SNDCTL_DSP_SPEED, &srate );
+  result = _oss_ioctl( fd, SNDCTL_DSP_SPEED, &srate );
   if ( result == -1 ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: error setting sample rate (" << sampleRate << ") on device (" << ainfo.name << ").";
+    errorStream_ << "RtApiOss::probeDeviceOpen: error setting sample rate (" << sampleRate << ") on device (" << device_name << ").";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7446,7 +7758,7 @@
   // Verify the sample rate setup worked.
   if ( abs( srate - sampleRate ) > 100 ) {
     close( fd );
-    errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support sample rate (" << sampleRate << ").";
+    errorStream_ << "RtApiOss::probeDeviceOpen: device (" << device_name << ") does not support sample rate (" << sampleRate << ").";
     errorText_ = errorStream_.str();
     return FAILURE;
   }
@@ -7623,9 +7935,9 @@
 
   if ( stream_.state == STREAM_RUNNING ) {
     if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX )
-      ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 );
+      _oss_ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 );
     else
-      ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 );
+      _oss_ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 );
     stream_.state = STREAM_STOPPED;
   }
 
@@ -7721,7 +8033,7 @@
       }
     }
 
-    result = ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 );
+    result = _oss_ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 );
     if ( result == -1 ) {
       errorStream_ << "RtApiOss::stopStream: system error stopping callback procedure on device (" << stream_.device[0] << ").";
       errorText_ = errorStream_.str();
@@ -7731,7 +8043,7 @@
   }
 
   if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && handle->id[0] != handle->id[1] ) ) {
-    result = ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 );
+    result = _oss_ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 );
     if ( result == -1 ) {
       errorStream_ << "RtApiOss::stopStream: system error stopping input callback procedure on device (" << stream_.device[0] << ").";
       errorText_ = errorStream_.str();
@@ -7767,7 +8079,7 @@
   int result = 0;
   OssHandle *handle = (OssHandle *) stream_.apiHandle;
   if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) {
-    result = ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 );
+    result = _oss_ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 );
     if ( result == -1 ) {
       errorStream_ << "RtApiOss::abortStream: system error stopping callback procedure on device (" << stream_.device[0] << ").";
       errorText_ = errorStream_.str();
@@ -7777,7 +8089,7 @@
   }
 
   if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && handle->id[0] != handle->id[1] ) ) {
-    result = ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 );
+    result = _oss_ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 );
     if ( result == -1 ) {
       errorStream_ << "RtApiOss::abortStream: system error stopping input callback procedure on device (" << stream_.device[0] << ").";
       errorText_ = errorStream_.str();
@@ -7863,10 +8175,10 @@
 
     if ( stream_.mode == DUPLEX && handle->triggered == false ) {
       int trig = 0;
-      ioctl( handle->id[0], SNDCTL_DSP_SETTRIGGER, &trig );
+      _oss_ioctl( handle->id[0], SNDCTL_DSP_SETTRIGGER, &trig );
       result = write( handle->id[0], buffer, samples * formatBytes(format) );
       trig = PCM_ENABLE_INPUT|PCM_ENABLE_OUTPUT;
-      ioctl( handle->id[0], SNDCTL_DSP_SETTRIGGER, &trig );
+      _oss_ioctl( handle->id[0], SNDCTL_DSP_SETTRIGGER, &trig );
       handle->triggered = true;
     }
     else
Only in chuck-1.3.5.1/src/RtAudio: RtAudio.d
diff -ru chuck-1.3.5.1.orig/src/RtAudio/RtAudio.h chuck-1.3.5.1/src/RtAudio/RtAudio.h
--- chuck-1.3.5.1.orig/src/RtAudio/RtAudio.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/RtAudio/RtAudio.h	Sat Jun 20 01:41:20 2015
@@ -228,6 +228,7 @@
     MACOSX_CORE,    /*!< Macintosh OS-X Core Audio API. */
     WINDOWS_ASIO,   /*!< The Steinberg Audio Stream I/O API. */
     WINDOWS_DS,     /*!< The Microsoft Direct Sound API. */
+    OPENBSD_OSS,    /*!< The OpenBSD Open Sound System API. */
     RTAUDIO_DUMMY   /*!< A compilable but non-functional API. */
   };
 
@@ -532,7 +533,7 @@
   typedef unsigned long ThreadHandle;
   typedef CRITICAL_SECTION StreamMutex;
 
-#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
+#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) || defined(__OPENBSD_OSS__)
   // Using pthread library for various flavors of unix.
   #include <pthread.h>
 
@@ -1001,7 +1002,7 @@
 
 #endif
 
-#if defined(__LINUX_OSS__)
+#if defined(__LINUX_OSS__) || defined(__OPENBSD_OSS__)
 
 class RtApiOss: public RtApi
 {
@@ -1009,7 +1010,11 @@
 
   RtApiOss();
   ~RtApiOss();
+#if defined(__LINUX_OSS__)
   RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; }
+#else
+  RtAudio::Api getCurrentApi() { return RtAudio::OPENBSD_OSS; }
+#endif
   unsigned int getDeviceCount( void );
   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
   void closeStream( void );
Only in chuck-1.3.5.1/src/RtAudio: RtAudio.o
Only in chuck-1.3.5.1/src: chuck
Only in chuck-1.3.5.1/src: chuck.output
Only in chuck-1.3.5.1/src: chuck.tab.c
Only in chuck-1.3.5.1/src: chuck.tab.d
Only in chuck-1.3.5.1/src: chuck.tab.h
Only in chuck-1.3.5.1/src: chuck.tab.o
Only in chuck-1.3.5.1/src: chuck.yy.c
Only in chuck-1.3.5.1/src: chuck.yy.d
Only in chuck-1.3.5.1/src: chuck.yy.o
Only in chuck-1.3.5.1/src: chuck_absyn.d
Only in chuck-1.3.5.1/src: chuck_absyn.o
Only in chuck-1.3.5.1/src: chuck_bbq.d
diff -ru chuck-1.3.5.1.orig/src/chuck_bbq.h chuck-1.3.5.1/src/chuck_bbq.h
--- chuck-1.3.5.1.orig/src/chuck_bbq.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/chuck_bbq.h	Sat Jun 20 01:41:45 2015
@@ -44,6 +44,7 @@
 #elif defined(__MACOSX_CORE__)
 #elif defined(__WINDOWS_DS__)
 #elif defined(__WINDOWS_ASIO__)
+#elif defined(__OPENBSD_OSS__)
 #else
 #error "must define one:\
 __LINUX_ALSA__ __UNIX_JACK__ __LINUX_JACK__ __LINUX_PULSE__ __MACOSX_CORE__ __WINDOWS_DS__"
Only in chuck-1.3.5.1/src: chuck_bbq.o
Only in chuck-1.3.5.1/src: chuck_compile.d
Only in chuck-1.3.5.1/src: chuck_compile.o
Only in chuck-1.3.5.1/src: chuck_console.d
Only in chuck-1.3.5.1/src: chuck_console.o
diff -ru chuck-1.3.5.1.orig/src/chuck_def.h chuck-1.3.5.1/src/chuck_def.h
--- chuck-1.3.5.1.orig/src/chuck_def.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/chuck_def.h	Sat Jun 20 01:42:23 2015
@@ -164,6 +164,10 @@
 #pragma warning (disable : 4018)  // signed/unsigned mismatch
 #endif
 
+#ifdef __OPENBSD_OSS__
+#define __PLATFORM_BSD__
+#endif
+
 #ifdef __CHIP_MODE__
 #define __DISABLE_MIDI__
 //#define __DISABLE_SNDBUF__
Only in chuck-1.3.5.1/src: chuck_dl.d
Only in chuck-1.3.5.1/src: chuck_dl.o
Only in chuck-1.3.5.1/src: chuck_emit.d
Only in chuck-1.3.5.1/src: chuck_emit.o
Only in chuck-1.3.5.1/src: chuck_errmsg.d
Only in chuck-1.3.5.1/src: chuck_errmsg.o
Only in chuck-1.3.5.1/src: chuck_frame.d
Only in chuck-1.3.5.1/src: chuck_frame.o
Only in chuck-1.3.5.1/src: chuck_globals.d
Only in chuck-1.3.5.1/src: chuck_globals.o
Only in chuck-1.3.5.1/src: chuck_instr.d
Only in chuck-1.3.5.1/src: chuck_instr.o
Only in chuck-1.3.5.1/src: chuck_io.d
Only in chuck-1.3.5.1/src: chuck_io.o
Only in chuck-1.3.5.1/src: chuck_lang.d
Only in chuck-1.3.5.1/src: chuck_lang.o
diff -ru chuck-1.3.5.1.orig/src/chuck_main.cpp chuck-1.3.5.1/src/chuck_main.cpp
--- chuck-1.3.5.1.orig/src/chuck_main.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/chuck_main.cpp	Sat Jun 20 01:42:58 2015
@@ -241,6 +241,8 @@
     platform = "mac os x : intel";
 #elif defined(__MACOSX_CORE__)
     platform = "mac os x : powerpc";
+#elif defined(__OPENBSD_OSS__)
+    platform = "openbsd (oss)";
 #else
     platform = "uh... unknown";
 #endif
Only in chuck-1.3.5.1/src: chuck_main.d
Only in chuck-1.3.5.1/src: chuck_main.o
Only in chuck-1.3.5.1/src: chuck_oo.d
Only in chuck-1.3.5.1/src: chuck_oo.o
Only in chuck-1.3.5.1/src: chuck_otf.d
Only in chuck-1.3.5.1/src: chuck_otf.o
Only in chuck-1.3.5.1/src: chuck_parse.d
Only in chuck-1.3.5.1/src: chuck_parse.o
Only in chuck-1.3.5.1/src: chuck_scan.d
Only in chuck-1.3.5.1/src: chuck_scan.o
diff -ru chuck-1.3.5.1.orig/src/chuck_shell.cpp chuck-1.3.5.1/src/chuck_shell.cpp
--- chuck-1.3.5.1.orig/src/chuck_shell.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/chuck_shell.cpp	Sat Jun 20 09:20:31 2015
@@ -608,7 +608,7 @@
 void Chuck_Shell::do_code( string & code, string & out, string command )
 {
     // open a temporary file
-#if defined(__PLATFORM_LINUX__) || defined(__MACOSX_CORE__)
+#if defined(__PLATFORM_LINUX__) || defined(__MACOSX_CORE__) || defined(__PLATFORM_BSD__)
     char tmp_dir[] = "/tmp";
     char * tmp_filepath = new char [32];
     strncpy( tmp_filepath, "/tmp/chuck_file.XXXXXX", 32 );
Only in chuck-1.3.5.1/src: chuck_shell.d
Only in chuck-1.3.5.1/src: chuck_shell.o
Only in chuck-1.3.5.1/src: chuck_stats.d
Only in chuck-1.3.5.1/src: chuck_stats.o
Only in chuck-1.3.5.1/src: chuck_symbol.d
Only in chuck-1.3.5.1/src: chuck_symbol.o
Only in chuck-1.3.5.1/src: chuck_table.d
Only in chuck-1.3.5.1/src: chuck_table.o
Only in chuck-1.3.5.1/src: chuck_type.d
Only in chuck-1.3.5.1/src: chuck_type.o
Only in chuck-1.3.5.1/src: chuck_ugen.d
Only in chuck-1.3.5.1/src: chuck_ugen.o
Only in chuck-1.3.5.1/src: chuck_utils.d
Only in chuck-1.3.5.1/src: chuck_utils.o
Only in chuck-1.3.5.1/src: chuck_vm.d
Only in chuck-1.3.5.1/src: chuck_vm.o
Only in chuck-1.3.5.1/src: digiio_rtaudio.d
diff -ru chuck-1.3.5.1.orig/src/digiio_rtaudio.h chuck-1.3.5.1/src/digiio_rtaudio.h
--- chuck-1.3.5.1.orig/src/digiio_rtaudio.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/digiio_rtaudio.h	Sat Jun 20 01:43:49 2015
@@ -62,7 +62,7 @@
   #endif
 #define NUM_BUFFERS_DEFAULT          8
 #define NUM_CHANNELS_DEFAULT         2       // number of channels
-  #if defined(__PLATFORM__LINUX__)
+  #if defined(__PLATFORM__LINUX__) || defined(__PLATFORM_BSD__)
 #define SAMPLING_RATE_DEFAULT        48000   // sampling rate
 #define USE_CB_DEFAULT               TRUE    // callback
   #else
Only in chuck-1.3.5.1/src: digiio_rtaudio.o
Only in chuck-1.3.5.1/src: hidio_sdl.d
Only in chuck-1.3.5.1/src: hidio_sdl.o
Only in chuck-1.3.5.1/src/lo: address.d
Only in chuck-1.3.5.1/src/lo: address.o
Only in chuck-1.3.5.1/src/lo: blob.d
Only in chuck-1.3.5.1/src/lo: blob.o
Only in chuck-1.3.5.1/src/lo: bundle.d
Only in chuck-1.3.5.1/src/lo: bundle.o
diff -ru chuck-1.3.5.1.orig/src/lo/config.h chuck-1.3.5.1/src/lo/config.h
--- chuck-1.3.5.1.orig/src/lo/config.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/lo/config.h	Sat Jun 20 09:30:50 2015
@@ -1,6 +1,6 @@
 
 
-#if defined(__MACOSX_CORE__) || defined(__PLATFORM_LINUX__)
+#if defined(__MACOSX_CORE__) || defined(__PLATFORM_LINUX__) || defined(__PLATFORM_BSD__)
 
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
Only in chuck-1.3.5.1/src/lo: message.d
Only in chuck-1.3.5.1/src/lo: message.o
Only in chuck-1.3.5.1/src/lo: method.d
Only in chuck-1.3.5.1/src/lo: method.o
Only in chuck-1.3.5.1/src/lo: pattern_match.d
Only in chuck-1.3.5.1/src/lo: pattern_match.o
Only in chuck-1.3.5.1/src/lo: send.d
Only in chuck-1.3.5.1/src/lo: send.o
Only in chuck-1.3.5.1/src/lo: server.d
Only in chuck-1.3.5.1/src/lo: server.o
Only in chuck-1.3.5.1/src/lo: server_thread.d
Only in chuck-1.3.5.1/src/lo: server_thread.o
Only in chuck-1.3.5.1/src/lo: timetag.d
Only in chuck-1.3.5.1/src/lo: timetag.o
diff -ru chuck-1.3.5.1.orig/src/makefile chuck-1.3.5.1/src/makefile
--- chuck-1.3.5.1.orig/src/makefile	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/makefile	Sat Jun 20 01:45:07 2015
@@ -4,7 +4,7 @@
 current: 
 	@echo "[chuck build]: please use one of the following configurations:"
 	@echo "   make linux-alsa, make linux-jack, make linux-pulse,"
-	@echo "   make osx, make osx-ub, make cygwin, or make win32"
+	@echo "   make osx, make osx-ub, make cygwin, make win32 or make obsd"
 
 install:
 	mkdir -p $(DESTDIR)
@@ -18,8 +18,8 @@
 endif
 endif
 
-.PHONY: osx linux-pulse linux-jack linux-alsa cygwin osx-rl
-osx linux-pulse linux-jack linux-alsa cygwin osx-rl: chuck
+.PHONY: osx linux-pulse linux-jack linux-alsa cygwin osx-rl obsd
+osx linux-pulse linux-jack linux-alsa cygwin osx-rl obsd: chuck
 
 win32:
 	make -f makefile.win32
@@ -79,6 +79,10 @@
 
 ifneq (,$(strip $(filter osx-rl,$(MAKECMDGOALS))))
 include makefile.rl
+endif
+
+ifneq (,$(strip $(filter obsd,$(MAKECMDGOALS))))
+include makefile.obsd
 endif
 
 CSRCS+= chuck.tab.c chuck.yy.c util_math.c util_network.c util_raw.c \
Only in chuck-1.3.5.1/src: makefile.obsd
Only in chuck-1.3.5.1/src: midiio_rtmidi.d
Only in chuck-1.3.5.1/src: midiio_rtmidi.o
diff -ru chuck-1.3.5.1.orig/src/rtmidi.cpp chuck-1.3.5.1/src/rtmidi.cpp
--- chuck-1.3.5.1.orig/src/rtmidi.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/rtmidi.cpp	Sat Jun 20 01:45:27 2015
@@ -2232,7 +2232,7 @@
 #endif  // __WINDOWS_MM__
 
 
-#if defined(__LINUX_OSS__)  // dummy
+#if defined(__LINUX_OSS__) || defined(__OPENBSD_OSS__)  // dummy
 
 /*void midiInputCallback( const MIDIPacketList *list, void *procRef, void *srcRef )
 {
Only in chuck-1.3.5.1/src: rtmidi.d
Only in chuck-1.3.5.1/src: rtmidi.o
Only in chuck-1.3.5.1/src: uana_extract.d
Only in chuck-1.3.5.1/src: uana_extract.o
Only in chuck-1.3.5.1/src: uana_xform.d
Only in chuck-1.3.5.1/src: uana_xform.o
Only in chuck-1.3.5.1/src: ugen_filter.d
Only in chuck-1.3.5.1/src: ugen_filter.o
Only in chuck-1.3.5.1/src: ugen_osc.d
Only in chuck-1.3.5.1/src: ugen_osc.o
Only in chuck-1.3.5.1/src: ugen_stk.d
diff -ru chuck-1.3.5.1.orig/src/ugen_stk.h chuck-1.3.5.1/src/ugen_stk.h
--- chuck-1.3.5.1.orig/src/ugen_stk.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/ugen_stk.h	Sat Jun 20 01:45:56 2015
@@ -40,6 +40,11 @@
 
 #include "chuck_dl.h"
 
+#ifdef __PLATFORM_BSD__
+#undef swap16
+#undef swap32
+#undef swap64
+#endif
 
 // query
 DLL_QUERY stk_query( Chuck_DL_Query * QUERY );
Only in chuck-1.3.5.1/src: ugen_stk.o
Only in chuck-1.3.5.1/src: ugen_xxx.d
Only in chuck-1.3.5.1/src: ugen_xxx.o
Only in chuck-1.3.5.1/src: ulib_machine.d
Only in chuck-1.3.5.1/src: ulib_machine.o
Only in chuck-1.3.5.1/src: ulib_math.d
Only in chuck-1.3.5.1/src: ulib_math.o
Only in chuck-1.3.5.1/src: ulib_opsc.d
Only in chuck-1.3.5.1/src: ulib_opsc.o
Only in chuck-1.3.5.1/src: ulib_regex.d
Only in chuck-1.3.5.1/src: ulib_regex.o
Only in chuck-1.3.5.1/src: ulib_std.d
Only in chuck-1.3.5.1/src: ulib_std.o
Only in chuck-1.3.5.1/src: util_buffers.d
Only in chuck-1.3.5.1/src: util_buffers.o
diff -ru chuck-1.3.5.1.orig/src/util_console.cpp chuck-1.3.5.1/src/util_console.cpp
--- chuck-1.3.5.1.orig/src/util_console.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/util_console.cpp	Sat Jun 20 01:47:04 2015
@@ -92,7 +92,7 @@
 // kb hit
 #ifndef __PLATFORM_WIN32__
   #include <string.h>
-#ifdef __PLATFORM_MACOSX__
+#if (defined __PLATFORM_MACOSX__ || defined __PLATFORM_BSD__)
   #include <termios.h>
   static struct termios g_save;
 #else
@@ -119,7 +119,7 @@
 
 #ifndef __PLATFORM_WIN32__
 
-#ifdef __PLATFORM_MACOSX__
+#if (defined __PLATFORM_MACOSX__ || defined __PLATFORM_BSD__)
     struct termios term;
     if( ioctl( 0, TIOCGETA, &term ) == -1 )
 #else
@@ -142,7 +142,7 @@
     term.c_cc[VMIN] = 0;
     term.c_cc[VTIME]=0;  
 
-#ifdef __PLATFORM_MACOSX__
+#if (defined __PLATFORM_MACOSX__ || defined __PLATFORM_BSD__)
     ioctl( 0, TIOCSETA, &term );
 #else
     ioctl( 0, TCSETA, &term );
@@ -161,7 +161,7 @@
     if( !g_init ) return;
 
 #ifndef __PLATFORM_WIN32__
-#ifdef __PLATFORM_MACOSX__
+#if (defined __PLATFORM_MACOSX__ || defined __PLATFORM_BSD__)
     ioctl( 0, TIOCSETA, &g_save );
 #else
     ioctl( 0, TCSETA, &g_save );
Only in chuck-1.3.5.1/src: util_console.d
Only in chuck-1.3.5.1/src: util_console.o
diff -ru chuck-1.3.5.1.orig/src/util_hid.cpp chuck-1.3.5.1/src/util_hid.cpp
--- chuck-1.3.5.1.orig/src/util_hid.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/util_hid.cpp	Sat Jun 20 01:47:53 2015
@@ -8030,3 +8030,159 @@
 
 #endif // __CHIP_MODE__
 
+#ifdef __OPENBSD_OSS__
+
+extern int get_tilt_sensor_x();
+extern int get_tilt_sensor_y();
+extern int get_tilt_sensor_z();
+
+void Hid_init(){}
+void Hid_poll(){}
+void Hid_quit(){}
+
+void Mouse_init(){}
+void Mouse_poll(){}
+void Mouse_quit(){}
+void Mouse_probe(){}
+
+int Mouse_count()
+{
+    return 1;
+}
+
+int Mouse_open( int m )
+{
+    return -1;
+}
+
+int Mouse_open( const char * name )
+{
+    return -1;
+}
+
+int Mouse_close( int m )
+{
+    return -1;
+}
+
+int Mouse_send( int m, const HidMsg * msg )
+{
+    return -1;
+}
+
+const char * Mouse_name( int m )
+{
+    if(m == 0)
+        return "iPhone Multitouch";
+    else
+        return NULL;
+}
+
+int Mouse_buttons( int m )
+{
+    if(m == 0)
+        return 2;
+    else
+        return -1;
+}
+
+t_CKINT TiltSensor_setPollRate( t_CKINT usec )
+{
+    return -1;
+}
+
+t_CKINT TiltSensor_getPollRate( )
+{
+    return -1;
+}
+
+void Joystick_init(){}
+
+void Joystick_poll(){}
+
+void Joystick_quit(){}
+
+void Joystick_probe(){}
+
+int Joystick_count()
+{
+    return 0;
+}
+
+int Joystick_open( int js )
+{
+    return -1;
+}
+
+int Joystick_open_async( int js )
+{
+    return -1;
+}
+
+int Joystick_open( const char * name )
+{
+    return -1;
+}
+
+int Joystick_close( int js )
+{
+    return -1;
+}
+
+int Joystick_send( int js, const HidMsg * msg )
+{
+    return -1;
+}
+
+
+const char * Joystick_name( int js )
+{
+    return NULL;
+}
+
+int Joystick_axes( int js )
+{
+    return -1;
+}
+
+int Joystick_buttons( int js )
+{
+    return -1;
+}
+
+int Joystick_hats( int js )
+{
+    return -1;
+}
+
+void Keyboard_init(){}
+void Keyboard_poll(){}
+void Keyboard_quit(){}
+void Keyboard_probe(){}
+
+int Keyboard_count()
+{
+    return 0;
+}
+
+int Keyboard_open( int kb )
+{
+    return -1;
+}
+
+int Keyboard_open( const char * name )
+{
+    return -1;
+}
+
+int Keyboard_close( int kb )
+{
+    return -1;
+}
+
+const char * Keyboard_name( int kb )
+{
+    return NULL;
+}
+
+#endif // __OPENBSD_OSS__
Only in chuck-1.3.5.1/src: util_hid.d
Only in chuck-1.3.5.1/src: util_hid.o
Only in chuck-1.3.5.1/src: util_math.d
Only in chuck-1.3.5.1/src: util_math.o
Only in chuck-1.3.5.1/src: util_network.d
Only in chuck-1.3.5.1/src: util_network.o
Only in chuck-1.3.5.1/src: util_opsc.d
Only in chuck-1.3.5.1/src: util_opsc.o
Only in chuck-1.3.5.1/src: util_raw.d
Only in chuck-1.3.5.1/src: util_raw.o
Only in chuck-1.3.5.1/src: util_serial.d
Only in chuck-1.3.5.1/src: util_serial.o
Only in chuck-1.3.5.1/src: util_sndfile.d
diff -ru chuck-1.3.5.1.orig/src/util_sndfile.h chuck-1.3.5.1/src/util_sndfile.h
--- chuck-1.3.5.1.orig/src/util_sndfile.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/util_sndfile.h	Sat Jun 20 01:48:48 2015
@@ -184,6 +184,23 @@
 #define HAVE_LRINT 1
 #endif
 
+#if defined(__OPENBSD_OSS__)
+#define CPU_CLIPS_POSITIVE 0
+#define CPU_IS_BIG_ENDIAN 0
+#define CPU_IS_LITTLE_ENDIAN 1
+#define HAVE_PREAD 1
+#define HAVE_PWRITE 1
+#define OS_IS_MACOSX 0
+#define OS_IS_WIN32 0
+#define SIZEOF_OFF64_T 0
+#define SIZEOF_LOFF_T 8
+#define TYPEOF_SF_COUNT_T off_t
+#define _FILE_OFFSET_BITS 64
+#define HAVE_FDATASYNC 1
+#define HAVE_ENDIAN_H 1
+#define HAVE_LRINTF 1
+#define HAVE_LRINT 1
+#endif
 
 
 // XXX 'inline' is necessary for C compilation
Only in chuck-1.3.5.1/src: util_sndfile.o
Only in chuck-1.3.5.1/src: util_string.d
Only in chuck-1.3.5.1/src: util_string.o
diff -ru chuck-1.3.5.1.orig/src/util_thread.cpp chuck-1.3.5.1/src/util_thread.cpp
--- chuck-1.3.5.1.orig/src/util_thread.cpp	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/util_thread.cpp	Sat Jun 20 01:51:22 2015
@@ -69,7 +69,7 @@
 {
     if( thread != 0 )
     {
-#if defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__)
+#if defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__)
         pthread_cancel(thread);
         pthread_join(thread, NULL);
 #elif defined(__PLATFORM_WIN32__)
@@ -89,7 +89,7 @@
 {
     bool result = false;
     
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     if( pthread_create( &thread, NULL, *routine, ptr ) == 0 )
         result = true;
 #elif defined(__PLATFORM_WIN32__)
@@ -111,7 +111,7 @@
 {
     bool result = false;
     
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     if(cancel) pthread_cancel(thread);
     pthread_join(thread, NULL);
 #elif defined(__PLATFORM_WIN32__)
@@ -138,7 +138,7 @@
 //-----------------------------------------------------------------------------
 void XThread :: test( )
 {
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     pthread_testcancel();
 #endif
 }
@@ -152,7 +152,7 @@
 //-----------------------------------------------------------------------------
 XMutex::XMutex( )
 {
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     pthread_mutex_init(&mutex, NULL);
 #elif defined(__PLATFORM_WIN32__)
     InitializeCriticalSection(&mutex);
@@ -168,7 +168,7 @@
 //-----------------------------------------------------------------------------
 XMutex::~XMutex( )
 {
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     pthread_mutex_destroy( &mutex );
 #elif defined(__PLATFORM_WIN32__)
     DeleteCriticalSection(&mutex);
@@ -184,7 +184,7 @@
 //-----------------------------------------------------------------------------
 void XMutex::acquire( )
 {
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     pthread_mutex_lock(&mutex);
 #elif defined(__PLATFORM_WIN32__)
     EnterCriticalSection(&mutex);
@@ -200,7 +200,7 @@
 //-----------------------------------------------------------------------------
 void XMutex::release( )
 {
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     pthread_mutex_unlock(&mutex);
 #elif defined(__PLATFORM_WIN32__)
     LeaveCriticalSection(&mutex);
@@ -389,7 +389,7 @@
 // name: write_cb()
 // desc: thread function
 //-----------------------------------------------------------------------------
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
 void * XWriteThread::write_cb(void * _thiss)
 #elif defined(__PLATFORM_WIN32__)
 unsigned XWriteThread::write_cb(void * _thiss)
Only in chuck-1.3.5.1/src: util_thread.d
diff -ru chuck-1.3.5.1.orig/src/util_thread.h chuck-1.3.5.1/src/util_thread.h
--- chuck-1.3.5.1.orig/src/util_thread.h	Sat Jun 20 00:11:31 2015
+++ chuck-1.3.5.1/src/util_thread.h	Sat Jun 20 01:51:59 2015
@@ -43,7 +43,7 @@
 template<typename T> class CircularBuffer;
 
 
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
   #include <pthread.h>
   #define THREAD_TYPE
   typedef pthread_t THREAD_HANDLE;
@@ -154,7 +154,7 @@
     void flush_data_buffer();
 
 	// callback
-#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) )
+#if ( defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__) || defined(__PLATFORM_BSD__) )
     static void * write_cb( void * _thiss );
 #elif defined(__PLATFORM_WIN32__)
     static unsigned THREAD_TYPE write_cb( void * _thiss );
Only in chuck-1.3.5.1/src: util_thread.o
Only in chuck-1.3.5.1/src: util_xforms.d
Only in chuck-1.3.5.1/src: util_xforms.o
