Re: audio/xmms: sndio plugin update to test

2012-09-06 Thread Alexandre Ratchov
Here's the final xmms diff; I got two test reports only, but I
believe this is correct.

ok?

-- Alexandre

Index: Makefile
===
RCS file: /cvs/ports/audio/xmms/Makefile,v
retrieving revision 1.79
diff -u -p -r1.79 Makefile
--- Makefile9 Aug 2012 17:54:47 -   1.79
+++ Makefile6 Sep 2012 06:49:30 -
@@ -10,7 +10,7 @@ SHARED_ONLY=  Yes
 VERSION=   1.2.11
 DISTNAME=  xmms-${VERSION}
 PKGNAME-main=  xmms-${VERSION}
-REVISION-main= 10
+REVISION-main= 11
 PKGNAME-vorbis=xmms-vorbis-${VERSION}
 REVISION-vorbis=   4
 PKGNAME-mikmod=xmms-mikmod-${VERSION}
Index: files/audio_sndio.c
===
RCS file: /cvs/ports/audio/xmms/files/audio_sndio.c,v
retrieving revision 1.3
diff -u -p -r1.3 audio_sndio.c
--- files/audio_sndio.c 5 Dec 2010 15:52:19 -   1.3
+++ files/audio_sndio.c 6 Sep 2012 06:49:30 -
@@ -14,9 +14,12 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include errno.h
+#include poll.h
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include unistd.h
 
 #include gtk/gtk.h
 #include libxmms/util.h
@@ -44,8 +47,6 @@ static int op_playing (void);
 static int op_get_output_time (void);
 static int op_get_written_time (void);
 
-static void onmove_cb (void *, int);
-
 static void configure_win_ok_cb(GtkWidget *, gpointer);
 static void configure_win_cancel_cb(GtkWidget *, gpointer);
 static void configure_win_destroy(void);
@@ -54,8 +55,8 @@ static struct sio_par par;
 static struct sio_hdl *hdl;
 static long long rdpos;
 static long long wrpos;
-static int paused;
-static int volume = XMMS_MAXVOL;
+static int paused, restarted, volume;
+static int pause_pending, flush_pending, volume_pending;
 static long bytes_per_sec;
 static AFormat afmt;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -91,6 +92,74 @@ get_oplugin_info (void)
 }
 
 static void
+reset(void)
+{
+   if (!restarted) {
+   restarted = 1;
+   sio_stop(hdl);
+   sio_start(hdl);
+   rdpos = wrpos;
+   }
+}
+static void
+onmove_cb (void *addr, int delta)
+{
+   rdpos += delta * (int)(par.bps * par.pchan);
+}
+
+static void
+onvol_cb(void *addr, unsigned ctl)
+{
+   /* Update volume only if it actually changed */
+   if (ctl != volume * SIO_MAXVOL / 100)
+   volume = ctl * 100 / SIO_MAXVOL;
+}
+
+static void
+pending_events(void)
+{
+   if (volume_pending) {
+   sio_setvol(hdl, volume * SIO_MAXVOL / 100);
+   volume_pending = 0;
+   }
+   if (flush_pending) {
+   reset();
+   flush_pending = 0;
+   }
+   if (pause_pending) {
+   if (paused)
+   reset();
+   pause_pending = 0;
+   }
+}
+
+static void
+wait_ready(void)
+{
+   int n;
+   struct pollfd pfds[16];
+
+   if (paused) {
+   pthread_mutex_unlock(mutex);
+   usleep(2);
+   pthread_mutex_lock(mutex);
+   return;
+   }
+   n = sio_pollfd(hdl, pfds, POLLOUT);
+   if (n != 0) {
+   pthread_mutex_unlock(mutex);
+   while (poll(pfds, n, -1)  0) {
+   if (errno != EINTR) {
+   perror(poll);
+   exit(1);
+   }
+   }
+   pthread_mutex_lock(mutex);
+   }
+   (void)sio_revents(hdl, pfds);
+}
+
+static void
 op_about (void)
 {
static GtkWidget *about;
@@ -118,7 +187,7 @@ op_init (void)
xmms_cfg_free(cfgfile);
 
if (!audiodev)
-   audiodev = g_strdup();
+   audiodev = g_strdup(SIO_DEVANY);
 }
 
 static void
@@ -135,8 +204,7 @@ op_set_volume (int left, int right)
/* Ignore balance control, so use unattenuated channel. */
pthread_mutex_lock (mutex);
volume = left  right ? left : right;
-   if (hdl != NULL)
-   sio_setvol (hdl, volume * SIO_MAXVOL / XMMS_MAXVOL);
+   volume_pending = 1;
pthread_mutex_unlock (mutex);
 }
 
@@ -146,8 +214,7 @@ op_open (AFormat fmt, int rate, int nch)
struct sio_par askpar;
 
pthread_mutex_lock (mutex);
-
-   hdl = sio_open (strlen (audiodev)  0 ? audiodev : NULL, SIO_PLAY, 0);
+   hdl = sio_open (audiodev, SIO_PLAY, 1);
if (hdl == NULL) {
fprintf (stderr, %s: failed to open audio device\n, __func__);
goto error;
@@ -217,7 +284,7 @@ op_open (AFormat fmt, int rate, int nch)
fprintf (stderr, %s: parameters not supported\n, __func__);
xmms_show_message (Unsupported format, XMMS requested a 
format that is not supported by the audio device.\n\n
- 

Re: audio/xmms: sndio plugin update to test

2012-09-06 Thread Stuart Henderson
On 2012/09/06 09:02, Alexandre Ratchov wrote:
 Here's the final xmms diff; I got two test reports only, but I
 believe this is correct.

 ok?

I don't normally use xmms (prefer aqualung) but thought I'd have a look,
I tried quite hard to get the unpatched one to crash but only managed
to get one crash at exit and eventually one during playing a couple of
files from the command line (not repeatable though), so it would be
hard to say for sure if this made things better, anyway if people
seeing the problem think this helps then it's OK with me.

 
 -- Alexandre
 
 Index: Makefile
 ===
 RCS file: /cvs/ports/audio/xmms/Makefile,v
 retrieving revision 1.79
 diff -u -p -r1.79 Makefile
 --- Makefile  9 Aug 2012 17:54:47 -   1.79
 +++ Makefile  6 Sep 2012 06:49:30 -
 @@ -10,7 +10,7 @@ SHARED_ONLY=Yes
  VERSION= 1.2.11
  DISTNAME=xmms-${VERSION}
  PKGNAME-main=xmms-${VERSION}
 -REVISION-main=   10
 +REVISION-main=   11
  PKGNAME-vorbis=  xmms-vorbis-${VERSION}
  REVISION-vorbis= 4
  PKGNAME-mikmod=  xmms-mikmod-${VERSION}
 Index: files/audio_sndio.c
 ===
 RCS file: /cvs/ports/audio/xmms/files/audio_sndio.c,v
 retrieving revision 1.3
 diff -u -p -r1.3 audio_sndio.c
 --- files/audio_sndio.c   5 Dec 2010 15:52:19 -   1.3
 +++ files/audio_sndio.c   6 Sep 2012 06:49:30 -
 @@ -14,9 +14,12 @@
   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  
 +#include errno.h
 +#include poll.h
  #include stdio.h
  #include stdlib.h
  #include string.h
 +#include unistd.h
  
  #include gtk/gtk.h
  #include libxmms/util.h
 @@ -44,8 +47,6 @@ static int op_playing (void);
  static int op_get_output_time (void);
  static int op_get_written_time (void);
  
 -static void onmove_cb (void *, int);
 -
  static void configure_win_ok_cb(GtkWidget *, gpointer);
  static void configure_win_cancel_cb(GtkWidget *, gpointer);
  static void configure_win_destroy(void);
 @@ -54,8 +55,8 @@ static struct sio_par par;
  static struct sio_hdl *hdl;
  static long long rdpos;
  static long long wrpos;
 -static int paused;
 -static int volume = XMMS_MAXVOL;
 +static int paused, restarted, volume;
 +static int pause_pending, flush_pending, volume_pending;
  static long bytes_per_sec;
  static AFormat afmt;
  static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 @@ -91,6 +92,74 @@ get_oplugin_info (void)
  }
  
  static void
 +reset(void)
 +{
 + if (!restarted) {
 + restarted = 1;
 + sio_stop(hdl);
 + sio_start(hdl);
 + rdpos = wrpos;
 + }
 +}
 +static void
 +onmove_cb (void *addr, int delta)
 +{
 + rdpos += delta * (int)(par.bps * par.pchan);
 +}
 +
 +static void
 +onvol_cb(void *addr, unsigned ctl)
 +{
 + /* Update volume only if it actually changed */
 + if (ctl != volume * SIO_MAXVOL / 100)
 + volume = ctl * 100 / SIO_MAXVOL;
 +}
 +
 +static void
 +pending_events(void)
 +{
 + if (volume_pending) {
 + sio_setvol(hdl, volume * SIO_MAXVOL / 100);
 + volume_pending = 0;
 + }
 + if (flush_pending) {
 + reset();
 + flush_pending = 0;
 + }
 + if (pause_pending) {
 + if (paused)
 + reset();
 + pause_pending = 0;
 + }
 +}
 +
 +static void
 +wait_ready(void)
 +{
 + int n;
 + struct pollfd pfds[16];
 +
 + if (paused) {
 + pthread_mutex_unlock(mutex);
 + usleep(2);
 + pthread_mutex_lock(mutex);
 + return;
 + }
 + n = sio_pollfd(hdl, pfds, POLLOUT);
 + if (n != 0) {
 + pthread_mutex_unlock(mutex);
 + while (poll(pfds, n, -1)  0) {
 + if (errno != EINTR) {
 + perror(poll);
 + exit(1);
 + }
 + }
 + pthread_mutex_lock(mutex);
 + }
 + (void)sio_revents(hdl, pfds);
 +}
 +
 +static void
  op_about (void)
  {
   static GtkWidget *about;
 @@ -118,7 +187,7 @@ op_init (void)
   xmms_cfg_free(cfgfile);
  
   if (!audiodev)
 - audiodev = g_strdup();
 + audiodev = g_strdup(SIO_DEVANY);
  }
  
  static void
 @@ -135,8 +204,7 @@ op_set_volume (int left, int right)
   /* Ignore balance control, so use unattenuated channel. */
   pthread_mutex_lock (mutex);
   volume = left  right ? left : right;
 - if (hdl != NULL)
 - sio_setvol (hdl, volume * SIO_MAXVOL / XMMS_MAXVOL);
 + volume_pending = 1;
   pthread_mutex_unlock (mutex);
  }
  
 @@ -146,8 +214,7 @@ op_open (AFormat fmt, int rate, int nch)
   struct sio_par askpar;
  
   pthread_mutex_lock (mutex);
 -
 - hdl = sio_open (strlen (audiodev)  0 ? 

Re: audio/xmms: sndio plugin update to test

2012-09-05 Thread Brett
On Tue, 4 Sep 2012 20:08:52 -0400
Brad Smith b...@comstyle.com wrote:

 On Tue, Aug 28, 2012 at 01:34:40AM +0200, Alexandre Ratchov wrote:
  Thanks to all for the quick feedback. Below is a new diff; fixes
  hangs with certain buffer size and updates the unsupported format
  text.
 
 Brett, naddy or any other xmms users? Still looking for some
 testing with the newer diff revision.
 

Yes, the newest diff version that Alexandre sent to me (I don't think it went 
to the list) works fine for oggs, mp3s, and flacs (when the flac subpackage is 
installed). That is on amd64. 

I guess when I reported that it works to Alexandre, I didn't notice ports was 
not cc'd, sorry.

Brett.



Re: audio/xmms: sndio plugin update to test

2012-09-05 Thread Christian Weisgerber
Brad Smith b...@comstyle.com wrote:

 Brett, naddy or any other xmms users? Still looking for some
 testing with the newer diff revision.

The second diff works fine for me and I told ratchov@ so.  I haven't
seen the third version Brett mentions.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: audio/xmms: sndio plugin update to test

2012-09-04 Thread Brad Smith
On Tue, Aug 28, 2012 at 01:34:40AM +0200, Alexandre Ratchov wrote:
 Thanks to all for the quick feedback. Below is a new diff; fixes
 hangs with certain buffer size and updates the unsupported format
 text.

Brett, naddy or any other xmms users? Still looking for some
testing with the newer diff revision.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: audio/xmms: sndio plugin update to test

2012-08-28 Thread Christian Weisgerber
Brett:

 Also on amd64-current, I've got xmms (with the second diff that Alexandre 
 sent out), xmms-flac, xmms-mikmod, xmms-mp3, xmms-vorbis installed, but I got 
 no playback with mp3s, oggs, or flacs.
 
 Is there some settings/configs you have changed from the default?

No.
I moved away my existing ~/.xmms and tried again--works just fine.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: audio/xmms: sndio plugin update to test

2012-08-27 Thread Christian Weisgerber
Alexandre Ratchov a...@caoua.org wrote:

 This fixes threading bugs guenther found when we switched to
 rthreads. Most changes are copy  paste from audacious.
 
 Basically, call any sio_* function with the mutex locked. But since
 we can't hold the mutex locked during blocking operations (the GUI
 would block) use a simple event loop with non-blocking i/o.
 
 Regressions? Comments? OKs?

The good news is that this fixes the problem guenther@ found.
I can now play a directory full of MP3s just fine.  Streaming works,
too.  As do FLAC files, after installing xmms-flac.

The bad news is that this kills the Ogg Vorbis plugin.  I can't
play any Vorbis audio, neither local files nor streamed.  XMMS
doesn't crash, it just seems to stop playing immediately after
starting.  (Yes, I really have the Vorbis plugin installed.)

-current/amd64
-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: audio/xmms: sndio plugin update to test

2012-08-27 Thread Alexandre Ratchov
Thanks to all for the quick feedback. Below is a new diff; fixes
hangs with certain buffer size and updates the unsupported format
text.

-- Alexandre

Index: Makefile
===
RCS file: /cvs/ports/audio/xmms/Makefile,v
retrieving revision 1.79
diff -u -p -r1.79 Makefile
--- Makefile9 Aug 2012 17:54:47 -   1.79
+++ Makefile27 Aug 2012 23:23:15 -
@@ -10,7 +10,7 @@ SHARED_ONLY=  Yes
 VERSION=   1.2.11
 DISTNAME=  xmms-${VERSION}
 PKGNAME-main=  xmms-${VERSION}
-REVISION-main= 10
+REVISION-main= 11
 PKGNAME-vorbis=xmms-vorbis-${VERSION}
 REVISION-vorbis=   4
 PKGNAME-mikmod=xmms-mikmod-${VERSION}
Index: files/audio_sndio.c
===
RCS file: /cvs/ports/audio/xmms/files/audio_sndio.c,v
retrieving revision 1.3
diff -u -p -r1.3 audio_sndio.c
--- files/audio_sndio.c 5 Dec 2010 15:52:19 -   1.3
+++ files/audio_sndio.c 27 Aug 2012 23:23:15 -
@@ -14,9 +14,12 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include errno.h
+#include poll.h
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include unistd.h
 
 #include gtk/gtk.h
 #include libxmms/util.h
@@ -54,8 +57,8 @@ static struct sio_par par;
 static struct sio_hdl *hdl;
 static long long rdpos;
 static long long wrpos;
-static int paused;
-static int volume = XMMS_MAXVOL;
+static int paused, restarted, volume;
+static int pause_pending, flush_pending, volume_pending;
 static long bytes_per_sec;
 static AFormat afmt;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -91,6 +94,69 @@ get_oplugin_info (void)
 }
 
 static void
+reset(void)
+{
+   if (!restarted) {
+   restarted = 1;
+   sio_stop(hdl);
+   sio_start(hdl);
+   rdpos = wrpos;
+   }
+}
+static void
+onmove_cb (void *addr, int delta)
+{
+   rdpos += delta * (int)(par.bps * par.pchan);
+}
+
+static void
+onvol_cb(void *addr, unsigned ctl)
+{
+   /* Update volume only if it actually changed */
+   if (ctl != volume * SIO_MAXVOL / 100)
+   volume = ctl * 100 / SIO_MAXVOL;
+}
+
+static void
+wait_ready(void)
+{
+   int n;
+   struct pollfd pfds[16];
+
+   if (volume_pending) {
+   sio_setvol(hdl, volume * SIO_MAXVOL / 100);
+   volume_pending = 0;
+   }
+   if (flush_pending) {
+   reset();
+   flush_pending = 0;
+   }
+   if (pause_pending) {
+   if (paused)
+   reset();
+   pause_pending = 0;
+   }
+   if (paused) {
+   pthread_mutex_unlock(mutex);
+   usleep(2);
+   pthread_mutex_lock(mutex);
+   return;
+   }
+   n = sio_pollfd(hdl, pfds, POLLOUT);
+   if (n != 0) {
+   pthread_mutex_unlock(mutex);
+   while (poll(pfds, n, -1)  0) {
+   if (errno != EINTR) {
+   perror(poll);
+   exit(1);
+   }
+   }
+   pthread_mutex_lock(mutex);
+   }
+   (void)sio_revents(hdl, pfds);
+}
+
+static void
 op_about (void)
 {
static GtkWidget *about;
@@ -118,7 +184,7 @@ op_init (void)
xmms_cfg_free(cfgfile);
 
if (!audiodev)
-   audiodev = g_strdup();
+   audiodev = g_strdup(SIO_DEVANY);
 }
 
 static void
@@ -146,13 +212,11 @@ op_open (AFormat fmt, int rate, int nch)
struct sio_par askpar;
 
pthread_mutex_lock (mutex);
-
-   hdl = sio_open (strlen (audiodev)  0 ? audiodev : NULL, SIO_PLAY, 0);
+   hdl = sio_open (audiodev, SIO_PLAY, 1);
if (hdl == NULL) {
fprintf (stderr, %s: failed to open audio device\n, __func__);
goto error;
}
-
sio_initpar (par);
afmt = fmt;
switch (fmt) {
@@ -217,7 +281,7 @@ op_open (AFormat fmt, int rate, int nch)
fprintf (stderr, %s: parameters not supported\n, __func__);
xmms_show_message (Unsupported format, XMMS requested a 
format that is not supported by the audio device.\n\n
-   Please try again with the aucat(1) server running.,
+   Please try again with the sndiod(1) server running.,
OK, FALSE, NULL, NULL);
goto error;
}
@@ -225,17 +289,18 @@ op_open (AFormat fmt, int rate, int nch)
rdpos = 0;
wrpos = 0;
sio_onmove (hdl, onmove_cb, NULL);
-
-   paused = 0;
+   sio_onvol (hdl, onvol_cb, NULL);
+   sio_setvol(hdl, volume * SIO_MAXVOL / 100);
if (!sio_start (hdl)) {
fprintf (stderr, %s: failed to start audio device\n,

Re: audio/xmms: sndio plugin update to test

2012-08-27 Thread Brett

 
 The good news is that this fixes the problem guenther@ found.
 I can now play a directory full of MP3s just fine.  Streaming works,
 too.  As do FLAC files, after installing xmms-flac.
 
 -current/amd64

Also on amd64-current, I've got xmms (with the second diff that Alexandre sent 
out), xmms-flac, xmms-mikmod, xmms-mp3, xmms-vorbis installed, but I got no 
playback with mp3s, oggs, or flacs.

Is there some settings/configs you have changed from the default?

Brett.




audio/xmms: sndio plugin update to test

2012-08-26 Thread Alexandre Ratchov
This fixes threading bugs guenther found when we switched to
rthreads. Most changes are copy  paste from audacious.

Basically, call any sio_* function with the mutex locked. But since
we can't hold the mutex locked during blocking operations (the GUI
would block) use a simple event loop with non-blocking i/o.

Regressions? Comments? OKs?

-- Alexandre

Index: Makefile
===
RCS file: /cvs/ports/audio/xmms/Makefile,v
retrieving revision 1.79
diff -u -p -r1.79 Makefile
--- Makefile9 Aug 2012 17:54:47 -   1.79
+++ Makefile26 Aug 2012 19:21:35 -
@@ -10,7 +10,7 @@ SHARED_ONLY=  Yes
 VERSION=   1.2.11
 DISTNAME=  xmms-${VERSION}
 PKGNAME-main=  xmms-${VERSION}
-REVISION-main= 10
+REVISION-main= 11
 PKGNAME-vorbis=xmms-vorbis-${VERSION}
 REVISION-vorbis=   4
 PKGNAME-mikmod=xmms-mikmod-${VERSION}
Index: files/audio_sndio.c
===
RCS file: /cvs/ports/audio/xmms/files/audio_sndio.c,v
retrieving revision 1.3
diff -u -p -r1.3 audio_sndio.c
--- files/audio_sndio.c 5 Dec 2010 15:52:19 -   1.3
+++ files/audio_sndio.c 26 Aug 2012 19:21:35 -
@@ -14,9 +14,12 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include errno.h
+#include poll.h
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include unistd.h
 
 #include gtk/gtk.h
 #include libxmms/util.h
@@ -54,8 +57,8 @@ static struct sio_par par;
 static struct sio_hdl *hdl;
 static long long rdpos;
 static long long wrpos;
-static int paused;
-static int volume = XMMS_MAXVOL;
+static int paused, restarted, volume;
+static int pause_pending, flush_pending, volume_pending;
 static long bytes_per_sec;
 static AFormat afmt;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -91,6 +94,69 @@ get_oplugin_info (void)
 }
 
 static void
+reset(void)
+{
+   if (!restarted) {
+   restarted = 1;
+   sio_stop(hdl);
+   sio_start(hdl);
+   rdpos = wrpos;
+   }
+}
+static void
+onmove_cb (void *addr, int delta)
+{
+   rdpos += delta * (int)(par.bps * par.pchan);
+}
+
+static void
+onvol_cb(void *addr, unsigned ctl)
+{
+   /* Update volume only if it actually changed */
+   if (ctl != volume * SIO_MAXVOL / 100)
+   volume = ctl * 100 / SIO_MAXVOL;
+}
+
+static void
+wait_ready(void)
+{
+   int n;
+   struct pollfd pfds[16];
+
+   if (volume_pending) {
+   sio_setvol(hdl, volume * SIO_MAXVOL / 100);
+   volume_pending = 0;
+   }
+   if (flush_pending) {
+   reset();
+   flush_pending = 0;
+   }
+   if (pause_pending) {
+   if (paused)
+   reset();
+   pause_pending = 0;
+   }
+   if (paused) {
+   pthread_mutex_unlock(mutex);
+   usleep(2);
+   pthread_mutex_lock(mutex);
+   return;
+   }
+   n = sio_pollfd(hdl, pfds, POLLOUT);
+   if (n != 0) {
+   pthread_mutex_unlock(mutex);
+   while (poll(pfds, n, -1)  0) {
+   if (errno != EINTR) {
+   perror(poll);
+   exit(1);
+   }
+   }
+   pthread_mutex_lock(mutex);
+   }
+   (void)sio_revents(hdl, pfds);
+}
+
+static void
 op_about (void)
 {
static GtkWidget *about;
@@ -118,7 +184,7 @@ op_init (void)
xmms_cfg_free(cfgfile);
 
if (!audiodev)
-   audiodev = g_strdup();
+   audiodev = g_strdup(SIO_DEVANY);
 }
 
 static void
@@ -146,13 +212,11 @@ op_open (AFormat fmt, int rate, int nch)
struct sio_par askpar;
 
pthread_mutex_lock (mutex);
-
-   hdl = sio_open (strlen (audiodev)  0 ? audiodev : NULL, SIO_PLAY, 0);
+   hdl = sio_open (audiodev, SIO_PLAY, 1);
if (hdl == NULL) {
fprintf (stderr, %s: failed to open audio device\n, __func__);
goto error;
}
-
sio_initpar (par);
afmt = fmt;
switch (fmt) {
@@ -225,17 +289,18 @@ op_open (AFormat fmt, int rate, int nch)
rdpos = 0;
wrpos = 0;
sio_onmove (hdl, onmove_cb, NULL);
-
-   paused = 0;
+   sio_onvol (hdl, onvol_cb, NULL);
+   sio_setvol(hdl, volume * SIO_MAXVOL / 100);
if (!sio_start (hdl)) {
fprintf (stderr, %s: failed to start audio device\n,
__func__);
goto error;
}
-
bytes_per_sec = par.bps * par.pchan * par.rate;
+   pause_pending = flush_pending = volume_pending = 0;
+   restarted = 1;
+   paused = 0;
pthread_mutex_unlock (mutex);
-   op_set_volume (volume, volume);
return TRUE;
 
 error:
@@ -247,11 

Re: audio/xmms: sndio plugin update to test

2012-08-26 Thread Brett
On Sun, 26 Aug 2012 21:48:52 +0200
Alexandre Ratchov a...@caoua.org wrote:

 This fixes threading bugs guenther found when we switched to
 rthreads. Most changes are copy  paste from audacious.
 
 Basically, call any sio_* function with the mutex locked. But since
 we can't hold the mutex locked during blocking operations (the GUI
 would block) use a simple event loop with non-blocking i/o.
 
 Regressions? Comments? OKs?
 
 -- Alexandre

On amd64-current, (with -mp3 -vorbis and -mikmod subpackages installed as well) 
this does not output any sound for me using .mp3s or .oggs. The time display on 
xmms remains on 00:00.

I tried changing the output plugin audio device from default to snd/0 and 
rsnd/0, but still no playback.

I deleted pkg, plist, and rebuilt using the version without this new diff, and 
it plays mp3s and oggs no problem.

Normally I don't use xmms so please let me know if there are some other 
settings I should alter to test.

Brett.


===

OpenBSD 5.2-current (GENERIC.MP) #21: Sun Aug 26 18:41:18 EST 2012
r...@emachine.the.domm:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3218997248 (3069MB)
avail mem = 3110948864 (2966MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xf (45 entries)
bios0: vendor Phoenix version R01-A1 date 03/02/2009
bios0: eMachines ET1300
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT HPET SLIC MCFG APIC
acpi0: wakeup devices HUB0(S5) XVR0(S5) XVR1(S5) XVR2(S5) USB0(S3) USB2(S3) 
AZAD(S5) MMAC(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 2500 Hz
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Athlon(tm) Dual Core Processor 5050e , 2612.30 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,CX16,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,3DNOWP
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: apic clock running at 200MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD Athlon(tm) Dual Core Processor 5050e , 2611.88 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,CX16,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,3DNOWP
cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu1: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu1: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative
ioapic0 at mainbus0: apid 4 pa 0xfec0, version 11, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 4
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (HUB0)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
acpitz0 at acpi0: critical temperature is 75 degC
acpibtn0 at acpi0: PWRB
cpu0: PowerNow! K8 2612 MHz: speeds: 2600 2400 2200 2000 1800 1000 MHz
pci0 at mainbus0 bus 0
NVIDIA MCP61 Memory rev 0xa1 at pci0 dev 0 function 0 not configured
pcib0 at pci0 dev 1 function 0 NVIDIA MCP61 ISA rev 0xa2
nviic0 at pci0 dev 1 function 1 NVIDIA MCP61 SMBus rev 0xa2
iic0 at nviic0
spdmem0 at iic0 addr 0x51: 1GB DDR2 SDRAM non-parity PC2-6400CL5
spdmem1 at iic0 addr 0x52: 1GB DDR2 SDRAM non-parity PC2-6400CL5
spdmem2 at iic0 addr 0x53: 1GB DDR2 SDRAM non-parity PC2-6400CL5
iic1 at nviic0
NVIDIA MCP61 Memory rev 0xa2 at pci0 dev 1 function 2 not configured
ohci0 at pci0 dev 2 function 0 NVIDIA MCP61 USB rev 0xa3: apic 4 int 10, 
version 1.0, legacy support
ehci0 at pci0 dev 2 function 1 NVIDIA MCP61 USB rev 0xa3: apic 4 int 11
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 NVIDIA EHCI root hub rev 2.00/1.00 addr 1
ppb0 at pci0 dev 4 function 0 NVIDIA MCP61 rev 0xa1
pci1 at ppb0 bus 1
azalia0 at pci0 dev 5 function 0 NVIDIA MCP61 HD Audio rev 0xa2: apic 4 int 11
azalia0: codecs: Realtek ALC888
audio0 at azalia0
pciide0 at pci0 dev 6 function 0 NVIDIA MCP61 IDE rev 0xa2: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 ignored (disabled)
nfe0 at pci0 dev 7 function 0 NVIDIA MCP61 LAN rev 0xa2: apic 4 int 15, 
address 00:25:11:3e:44:93
rlphy0 at nfe0 phy 1: RTL8201L 10/100 PHY, rev. 1
pciide1 at pci0 dev 8 function 0 NVIDIA MCP61 SATA rev 0xa2: DMA
pciide1: using apic 4 int 11 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: ST3160318AS
wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 6
wd1 at pciide1 channel 1 drive 0: ST2000DM001-1CH164
wd1: 16-sector PIO, LBA48, 1907729MB, 3907029168 sectors
wd1(pciide1:1:0): using PIO mode 4, Ultra-DMA mode 6
pciide2 at pci0 dev 8