pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/54769: pkgsrc/audio/timidity does not work on netbsd-9



>Number:         54769
>Category:       pkg
>Synopsis:       pkgsrc/audio/timidity does not work on netbsd-9
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 15 06:45:00 +0000 2019
>Originator:     Tetsuya Isaki
>Release:        NetBSD-9 + pkgsrc-2019Q2
>Organization:
>Environment:
NetBSD 9.0_BETA amd64
>Description:
Original timidity's sun driver (used on netbsd) looks incorrect.
timidity opens two descriptors, despite a single audio track, one
is /dev/audio to write sampling data and another is /dev/audioctl
to issue ioctls.

This method has worked until netbsd-7 (though it's not correct)
and cannot be used since netbsd-8.  Because our audio(4) supports
synthesizing multiple audio tracks on netbsd-8.  Opening new
/dev/audioctl does not refer any existing /dev/audio descriptors.
patches/patch-timidity_sun__a.c pacthes this issue using
AUDIO_SETCHAN/GETCHAN ioctls which is introduced on netbsd-8.  It
combines particular audio descriptor and another one in the kenerl.

netbsd-9 obsoletes this unsecure AUDIO_SETCHAN/GETCHAN ioctls.  So
timidity stopped working again.
>How-To-Repeat:
% timidity some.mid
>Fix:
Please replace patches/patch-timidity_sun__a.c with attched one.

--- timidity/sun_a.c.orig	2009-12-23 20:57:03.000000000 +0900
+++ timidity/sun_a.c	2019-12-08 14:56:01.549983468 +0900
@@ -170,12 +170,14 @@
     output_counter = play_samples_offset = 0;
 
     /* Open the audio device */
+#if !defined(__NetBSD__)
     if((audioctl_fd = open(audio_ctl_dev, O_RDWR)) < 0)
     {
 	ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
 		  "%s: %s", audio_ctl_dev, strerror(errno));
 	return -1;
     }
+#endif
 
 /* ############## */
 #if 0
@@ -204,6 +206,10 @@
 	return -1;
     }
 
+#if defined(__NetBSD__)
+    audioctl_fd = dpm.fd;
+#endif
+
     if(stat(dpm.name, &sb) < 0)
     {
 	ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
@@ -272,11 +278,13 @@
 	close(dpm.fd);
 	dpm.fd = -1;
     }
+#if !defined(__NetBSD__)
     if(audioctl_fd != -1)
     {
 	close(audioctl_fd);
 	audioctl_fd = -1;
     }
+#endif
 }
 
 int output_data(char *buff, int32 nbytes)



Home | Main Index | Thread Index | Old Index