NetBSD Problem Report #33614

From www@NetBSD.org  Wed May 31 22:09:45 2006
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
	id B5FA763BAAE; Wed, 31 May 2006 22:09:45 +0000 (UTC)
Message-Id: <20060531220945.B5FA763BAAE@narn.NetBSD.org>
Date: Wed, 31 May 2006 22:09:45 +0000 (UTC)
From: nblists@anastigmatix.net
Reply-To: nblists@anastigmatix.net
To: gnats-bugs@NetBSD.org
Subject: sequencer (/dev/music) mishandles tempo/timebase changes
X-Send-Pr-Version: www-1.0

>Number:         33614
>Category:       kern
>Synopsis:       sequencer (/dev/music) mishandles tempo/timebase changes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 31 22:10:00 +0000 2006
>Closed-Date:    Sun Sep 24 15:04:33 +0000 2006
>Last-Modified:  Sun Sep 24 15:04:33 +0000 2006
>Originator:     Chapman Flack
>Release:        any to date since sequencer added
>Organization:
>Environment:
any
>Description:
Using the sequencer's SEQ_TMR_TEMPO event during sequencing, or the
SEQUENCER_TMR_{TEMPO,TIMEBASE} ioctls, will throw off the timing; a
tempo reduction results in a longish delay before sequencing resumes,
while a tempo increase results in a number of subsequent events being
played simultaneously.

The trouble is in the sequencer's internal use of absolute times,
without accounting for the effect of tempo change on the correspondence
of its beat units to wall time already past.
>How-To-Repeat:
Play a MIDI file containing tempo changes, using a player program that
actually changes the sequencer's tempo in response. (The problem was
cloaked by midiplay(1) setting the sequencer to a fixed tempo and doing
all adjustments in userland, and was exposed in the process of changing
midiplay(1) to use the sequencer tempo.)
>Fix:
Requires the sequencer to track the absolute time of the last tempo
change. In the chap-midi branch.

>Release-Note:

>Audit-Trail:
From: Chapman Flack <chap@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/33614 CVS commit: [chap-midi] src/sys/dev
Date: Wed, 31 May 2006 22:19:19 +0000 (UTC)

 Module Name:	src
 Committed By:	chap
 Date:		Wed May 31 22:19:19 UTC 2006

 Modified Files:
 	src/sys/dev [chap-midi]: sequencer.c sequencervar.h

 Log Message:
 PR kern/33614.

 Rework of midiplay(1) to use sequencer facilities for tempo change (rather
 than setting the sequencer for one tempo and doing all its own scaling)
 exposed a hitherto concealed bug in sequencer tempo change handling.

 Also took the opportunity to clarify some field names and add spl calls
 in the top half to avoid concurrent access with the bottom to the timer.


 To generate a diff of this commit:
 cvs rdiff -r1.30.14.19 -r1.30.14.20 src/sys/dev/sequencer.c
 cvs rdiff -r1.10.14.9 -r1.10.14.10 src/sys/dev/sequencervar.h

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

State-Changed-From-To: open->closed
State-Changed-By: xtraeme@netbsd.org
State-Changed-When: Sun, 24 Sep 2006 15:04:33 +0000
State-Changed-Why:
Repeat after me: "if the problem is fixed, I'll close the PR".


>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.