NetBSD Problem Report #54769
From www@netbsd.org Sun Dec 15 06:43:56 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 43C9E7A16D
for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 Dec 2019 06:43:56 +0000 (UTC)
Message-Id: <20191215064355.301397A1CC@mollari.NetBSD.org>
Date: Sun, 15 Dec 2019 06:43:55 +0000 (UTC)
From: isaki@pastel-flower.jp
Reply-To: isaki@pastel-flower.jp
To: gnats-bugs@NetBSD.org
Subject: pkgsrc/audio/timidity does not work on netbsd-9
X-Send-Pr-Version: www-1.0
>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)
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.