kfish / sweep

Sound wave editor
http://www.metadecks.org/software/sweep/
GNU General Public License v2.0
26 stars 6 forks source link

Alsa device, won't play #5

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, When alsa is set, I'm unable to play any samples (playhead refuses to move). I think there something with the device. I tried plughw:0,0, pcm names with no errors but playhead won't move. my config: ./configure --prefix=/usr --disable-oss --disable-pulseaudio --disable-speex

I tested with the original source and alsa works with default device. voidlinux x64 glib-2.56.0.

Edit: this commit to driver_alsa.c brakes something..

@@ -169,17 +169,12 @@
   int err;
   snd_pcm_t * pcm_handle = (snd_pcm_t *)handle->custom_data;
   snd_pcm_hw_params_t * hwparams;
-  int dir;
   unsigned int rate = format->rate;
   unsigned int channels = format->channels;
   unsigned int periods;
   snd_pcm_uframes_t period_size = PBUF_SIZE/format->channels;

-  if (handle->driver_flags == O_RDONLY) {
-    dir = (int)SND_PCM_STREAM_CAPTURE;
-  } else if (handle->driver_flags == O_WRONLY) {
-    dir = (int)SND_PCM_STREAM_PLAYBACK;
-  } else {
+  if (handle->driver_flags != O_RDONLY && handle->driver_flags == O_WRONLY) {
     return;
   }

reverting this fixes it for me