On 2022/03/08 16:48, Alexandre Ratchov wrote:
> On Mon, Mar 07, 2022 at 07:00:56AM +0000, Dimitri Karamazov wrote:
> > Ping
> > 
> 
> It works for me except that it doesn't seem compatible with my window
> manager (x11/i3 port). This is unrelated to your port and easy to
> workaround and/or fix later.
> 
> Latency setting was ignored and the default hardcoded one was huge and
> unpleasant to play with. Added the necessary tweak to your diff, see
> below.
> 
> There are also two more changes:
> 
>  - non-blocking MIDI input was used with poll(2), but according to the
>    comments, the author intent seems to be to use blocking input.
> 
>  - audio was using XRUN_SYNC, there's no other audio stream to
>    synchronize to, so this is not necessary (but breaks ^Z).
> 
> The remaining problem is that zynaddsubfx is addictive, but I see no
> fix for it. Thanks for the update.
> 
> Does this diff look correct port-wise? OK?

I already committed the update; to save you some cvs-wrangling
here's a diff against -current cvs tree:

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/zynaddsubfx/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile    8 Mar 2022 17:01:53 -0000       1.4
+++ Makefile    8 Mar 2022 17:02:06 -0000
@@ -4,7 +4,7 @@ ONLY_FOR_ARCHS= i386 amd64
 COMMENT=       synth capable of making a countless number of instruments
 
 DISTNAME=      zynaddsubfx-3.0.6
-REVISION=      0
+REVISION=      1
 
 CATEGORIES=    audio
 
Index: patches/patch-src_Nio_SndioEngine_cpp
===================================================================
RCS file: patches/patch-src_Nio_SndioEngine_cpp
diff -N patches/patch-src_Nio_SndioEngine_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_Nio_SndioEngine_cpp       8 Mar 2022 17:02:06 -0000
@@ -0,0 +1,31 @@
+Index: src/Nio/SndioEngine.cpp
+--- src/Nio/SndioEngine.cpp.orig
++++ src/Nio/SndioEngine.cpp
+@@ -123,8 +123,7 @@ bool SndioEngine::openAudio()
+ 
+     sio_initpar(&audio.params);
+     audio.params.rate = synth.samplerate;
+-    audio.params.appbufsz = audio.params.rate * 0.05;
+-    audio.params.xrun = SIO_SYNC;
++    audio.params.appbufsz = synth.buffersize;
+ 
+     rc = sio_setpar(audio.handle, &audio.params);
+     if(rc != 1) {
+@@ -173,7 +172,7 @@ bool SndioEngine::openMidi()
+ 
+     midi.handle = NULL;
+ 
+-    if((midi.handle = mio_open(MIO_PORTANY, MIO_IN, 1)) == NULL) {
++    if((midi.handle = mio_open(MIO_PORTANY, MIO_IN, 0)) == NULL) {
+         fprintf(stderr, "unable to open sndio midi device\n");
+         return false;
+     }
+@@ -265,7 +264,7 @@ void *SndioEngine::processMidi()
+         memset(buf, 0, sizeof(buf));
+         len = mio_read(midi.handle, buf, sizeof(buf));
+         if(len == 0) {
+-            // since mio_read is non-blocking, this must indicate an error
++            // since mio_read is blocking, this must indicate an error
+             // so stop processing all MIDI
+             break;
+         } else if(len > sizeof(buf)) {

Reply via email to