NetBSD Problem Report #52075

From www@NetBSD.org  Wed Mar 15 01:11:24 2017
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1DF847A1FB
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Mar 2017 01:11:24 +0000 (UTC)
Message-Id: <20170315011123.148977A2B4@mollari.NetBSD.org>
Date: Wed, 15 Mar 2017 01:11:23 +0000 (UTC)
From: idleroux@fastmail.fm
Reply-To: idleroux@fastmail.fm
To: gnats-bugs@NetBSD.org
Subject: /dev/audio mangles multi-track MIDI output
X-Send-Pr-Version: www-1.0

>Number:         52075
>Category:       kern
>Synopsis:       /dev/audio mangles multi-track MIDI output
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    nat
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 15 01:15:00 +0000 2017
>Closed-Date:    Wed Apr 12 02:28:54 +0000 2017
>Last-Modified:  Wed Apr 12 02:28:54 +0000 2017
>Originator:     Ian D. Leroux
>Release:        NetBSD 7.99.60
>Organization:
>Environment:
NetBSD scrameustache.unrouted.net 7.99.60 NetBSD 7.99.60 (GENERIC) #0: Tue Feb 21 18:09:13 EST 2017  idleroux@scrameustache.unrouted.net:/build/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
On recent -CURRENT, when playing a multi-track MIDI file with audio/timidity, every note played is abruptly cut off as soon as another note (possibly on another track) is played.  Chords, in particular, get reduced to the bottom-most note (since the lowest part is typically the last one in the file), with a glitch at the start as the other notes are interrupted immediately after being played. This behaviour is not observed with 7.99.29, so it was introduced sometime in the last year.  It sounds as though something has changed in the handling of multiple samples sent to a single OSS output channel.

Note that no sound daemon is running, timidity is playing directly to /dev/audio.


>How-To-Repeat:
Install audio/timidity and audio/eawpatches from pkgsrc.
Download a MIDI file with more than one track
(e.g. https://upload.wikimedia.org/wikipedia/en/5/5f/Linear_counterpoint_from_Stravinsky%27s_Octet.mid ),
renaming it to test.mid

# First, demonstrate correct output
# by converting in software.
$ timidity -Ow test.mid
$ audioplay test.wav

# Then demonstrate the problem
$ timidity test.mid
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->nat
Responsible-Changed-By: nat@NetBSD.org
Responsible-Changed-When: Mon, 27 Mar 2017 23:42:47 +0000
Responsible-Changed-Why:
I'll handle this.


From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52075 CVS commit: pkgsrc/audio/timidity
Date: Thu, 30 Mar 2017 18:44:13 +0000

 Module Name:	pkgsrc
 Committed By:	nat
 Date:		Thu Mar 30 18:44:13 UTC 2017

 Modified Files:
 	pkgsrc/audio/timidity: Makefile distinfo
 	pkgsrc/audio/timidity/patches: patch-ac patch-timidity_midi_a__c.c
 Added Files:
 	pkgsrc/audio/timidity/patches: patch-timidity_sun__a.c

 Log Message:
 Fix playback on NetBSD-current as of 20170322.  Ensure that the audioctl
 device operates on the correct channel.

 Addresses PR kern/52075.

 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -u -r1.104 -r1.105 pkgsrc/audio/timidity/Makefile
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/audio/timidity/distinfo
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/audio/timidity/patches/patch-ac
 cvs rdiff -u -r1.1 -r1.2 \
     pkgsrc/audio/timidity/patches/patch-timidity_midi_a__c.c
 cvs rdiff -u -r0 -r1.1 pkgsrc/audio/timidity/patches/patch-timidity_sun__a.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: nat@NetBSD.org
State-Changed-When: Thu, 30 Mar 2017 18:57:37 +0000
State-Changed-Why:
Changes to kernel and package have been committed.


From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52075 CVS commit: [pkgsrc-2017Q1] pkgsrc/audio/timidity
Date: Sat, 1 Apr 2017 18:45:29 +0000

 Module Name:	pkgsrc
 Committed By:	bsiegert
 Date:		Sat Apr  1 18:45:28 UTC 2017

 Modified Files:
 	pkgsrc/audio/timidity [pkgsrc-2017Q1]: Makefile distinfo
 	pkgsrc/audio/timidity/patches [pkgsrc-2017Q1]: patch-ac
 	    patch-timidity_midi_a__c.c
 Added Files:
 	pkgsrc/audio/timidity/patches [pkgsrc-2017Q1]: patch-timidity_sun__a.c

 Log Message:
 Pullup ticket #5229 - requested by sevan
 audio/timidity: bugfix

 Revisions pulled up:
 - audio/timidity/Makefile                                       1.105
 - audio/timidity/distinfo                                       1.19
 - audio/timidity/patches/patch-ac                               1.6
 - audio/timidity/patches/patch-timidity_midi_a__c.c             1.2
 - audio/timidity/patches/patch-timidity_sun__a.c                1.1

 ---
    Module Name:    pkgsrc
    Committed By:   nat
    Date:           Thu Mar 30 18:44:13 UTC 2017

    Modified Files:
            pkgsrc/audio/timidity: Makefile distinfo
            pkgsrc/audio/timidity/patches: patch-ac patch-timidity_midi_a__c.c
    Added Files:
            pkgsrc/audio/timidity/patches: patch-timidity_sun__a.c

    Log Message:
    Fix playback on NetBSD-current as of 20170322.  Ensure that the audioctl
    device operates on the correct channel.

    Addresses PR kern/52075.

    Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -u -r1.104 -r1.104.2.1 pkgsrc/audio/timidity/Makefile
 cvs rdiff -u -r1.18 -r1.18.12.1 pkgsrc/audio/timidity/distinfo
 cvs rdiff -u -r1.5 -r1.5.38.1 pkgsrc/audio/timidity/patches/patch-ac
 cvs rdiff -u -r1.1 -r1.1.38.1 \
     pkgsrc/audio/timidity/patches/patch-timidity_midi_a__c.c
 cvs rdiff -u -r0 -r1.1.2.2 \
     pkgsrc/audio/timidity/patches/patch-timidity_sun__a.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Nathanial Sloss <nat@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/52075
Date: Sun, 2 Apr 2017 20:39:20 +1000

 Hi,

 The issue with timidity on NetBSD-Current is that timidity opens and audio 
 device and an audioctl device to check on play back progress.

 On NetBSD-Current the open of the audioctl device would be a new channel so 
 the progess of the audio device cannot be monitored.

 It would require using ioctls present in audioio.h/audio.c after March 21 to 
 set the channel on the audioctl device.

 Best regards,

 Nat

From: "Ian D. Leroux" <idleroux@fastmail.fm>
To: gnats-bugs@NetBSD.org
Cc: Nathanial Sloss <nat@netbsd.org>, nat@NetBSD.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/52075
Date: Sun, 2 Apr 2017 07:08:32 -0400

 On Sun,  2 Apr 2017 10:45:01 +0000 (UTC) Nathanial Sloss
 <nat@netbsd.org> wrote:
 >  The issue with timidity on NetBSD-Current is that timidity opens and
 > audio device and an audioctl device to check on play back progress.
 >  
 >  On NetBSD-Current the open of the audioctl device would be a new
 > channel so the progess of the audio device cannot be monitored.
 >  
 >  It would require using ioctls present in audioio.h/audio.c after
 > March 21 to set the channel on the audioctl device.

 Thanks for the explanation.  I've rebuilt timidity with the new patches,
 but my base system is older than March 21 so I'll need to update it
 before I can confirm the fix. I'll try to do that as soon as the
 current breakage is resolved.

 --
 IDL

From: "Ian D. Leroux" <idleroux@fastmail.fm>
To: gnats-bugs@NetBSD.org
Cc: Nathanial Sloss <nat@netbsd.org>, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: kern/52075
Date: Mon, 10 Apr 2017 22:15:44 -0400

 On Sun, Apr 2, 2017, at 07:08, Ian D. Leroux wrote:
 > On Sun,  2 Apr 2017 10:45:01 +0000 (UTC) Nathanial Sloss
 > <nat@netbsd.org> wrote:
 > >  The issue with timidity on NetBSD-Current is that timidity opens and
 > > audio device and an audioctl device to check on play back progress.
 > >  
 > >  On NetBSD-Current the open of the audioctl device would be a new
 > > channel so the progess of the audio device cannot be monitored.
 > >  
 > >  It would require using ioctls present in audioio.h/audio.c after
 > > March 21 to set the channel on the audioctl device.
 > 
 > Thanks for the explanation.  I've rebuilt timidity with the new patches,
 > but my base system is older than March 21 so I'll need to update it
 > before I can confirm the fix. I'll try to do that as soon as the
 > current breakage is resolved.

 I've now rebuilt base system from sources of April 7th, and rebuilt
 timidity thereafter, but the bug persists.  Is there any easy way of
 checking which audio channels are getting (re)opened to see if I'm
 hearing the problem you described or something different?

 -- IDL

From: Nathanial Sloss <nat@netbsd.org>
To: "Ian D. Leroux" <idleroux@fastmail.fm>
Cc: gnats-bugs@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: kern/52075
Date: Tue, 11 Apr 2017 15:11:20 +1000

 On Tue, 11 Apr 2017 12:15:44 Ian D. Leroux wrote:
 Hi Ian,

 > I've now rebuilt base system from sources of April 7th, and rebuilt
 > timidity thereafter, but the bug persists.  Is there any easy way of
 > checking which audio channels are getting (re)opened to see if I'm
 > hearing the problem you described or something different?

 I just want to make sure things have been done in the right order as the use 
 of the ioctls AUDIO_GET/SETCHAN will only be in effect if timidity is built on 
 current with the appropriate audioio.h.

 Ensure that /usr/incude/sys/audioio.h is from the rebuilt base system.
 Rebuild timidity-2.14.0nb21 from NetBSD-current.

 To confirm this will address the problem you can run your current version of 
 timidity with the -k 0(zero) switch ie. timidity -k 0 my.mid.

 This means that timidity will write audio ignoring the posisition from the 
 auidoctl device.

 If the bug still persists then it is definately a differnet problem and I will 
 address it.


 > 
 > -- IDL


 Best regards,

 Nat.

From: "Ian D. Leroux" <idleroux@fastmail.fm>
To: Nathanial Sloss <nat@netbsd.org>
Cc: gnats-bugs@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/52075
Date: Tue, 11 Apr 2017 19:56:48 -0400

 On Tue, 11 Apr 2017 15:11:20 +1000 Nathanial Sloss <nat@netbsd.org>
 wrote:
 > I just want to make sure things have been done in the right order as
 > the use of the ioctls AUDIO_GET/SETCHAN will only be in effect if
 > timidity is built on current with the appropriate audioio.h.
 > 
 > Ensure that /usr/incude/sys/audioio.h is from the rebuilt base system.
 > Rebuild timidity-2.14.0nb21 from NetBSD-current.

 You were right to be suspicious.  For some reason hardly any of the
 headers under /usr/include were updated when I ran

 build.sh install=/

 I've installed the new audioio.h by hand, rebuilt timidity, and can
 now hear glorious polyphony :-).  Thank you for the fix, and sorry for
 the false alarm.

 This bug can now, as far as I am concerned, be closed.

 --
 IDL

State-Changed-From-To: feedback->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Wed, 12 Apr 2017 02:28:54 +0000
State-Changed-Why:
Confirmed fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.