[Pkg-alsa-devel] Bug#100041: marked as done (/dev/music MIDI adds unwanted staccatos on first "long" note after seq_reset())

Debian Bug Tracking System owner@bugs.debian.org
Sat, 04 Sep 2004 04:33:08 -0700


Your message dated Sat, 04 Sep 2004 13:26:02 +0200
with message-id <1094297161.11462.490.camel@thanatos>
and subject line Closing driver bug reports more than 2 years old
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 8 Jun 2001 03:46:49 +0000
>From toe@soon.com Thu Jun 07 22:46:49 2001
Return-path: <toe@soon.com>
Received: from ts1-412.f2082.quebectel.com (compusaurus) [::ffff:142.169.106.181] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 158DEW-0004wo-00; Thu, 07 Jun 2001 22:46:48 -0500
Received: from toe by compusaurus with local (Exim 3.22 #1 (Debian))
	id 158DIq-0000E0-00; Thu, 07 Jun 2001 23:51:16 -0400
From: Sylvain Bernier <toe@soon.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: /dev/music MIDI adds unwanted staccatos on first "long" note after seq_reset()
X-Reportbug-Version: 1.17
X-Mailer: reportbug 1.17
Date: Thu, 07 Jun 2001 23:51:10 -0400
Message-Id: <E158DIq-0000E0-00@compusaurus>
Delivered-To: submit@bugs.debian.org

Package: alsa-source
Version: 0.9+0beta4-4
Severity: normal

Here is a little program that shows the problem. It tries to play 1/8 notes and then 1/2 notes. The first 1/2 note played is shortened. A ~400-500 ms sleep right after seq_reset corrects the problem. But it seems to be quite a long delay needed for such a task.

reset.cpp
------------------------------------------------------------------------------
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/soundcard.h>
#include <sys/ioctl.h>

#define DEVICE "/dev/music"
#define CHANNEL 1
#define PORT 1
#define TEMPO 80

int seqfd = -1;
SEQ_DEFINEBUF(2048);

void seqbuf_dump()
{
  if (seqfd != -1 && _seqbufptr) {
    if (write (seqfd, _seqbuf, _seqbufptr) == -1) perror("seqbuf_dump: error");
    _seqbufptr = 0;
  }
}

void init_tempo()
{
  // ::: initializing timer :::
  {
    int i = 96;
    if (ioctl(seqfd, SNDCTL_TMR_TIMEBASE, &i) == -1) perror("SNDCTL_TMR_TIMEBASE: error");

    i = TEMPO;
    if (ioctl(seqfd, SNDCTL_TMR_TEMPO, &i) == -1) perror("SNDCTL_TMR_TEMPO: error");

    SEQ_START_TIMER();
  }
}

int main()
{
  printf ("\nreset.cpp : unwanted staccato MIDI test\n");
  printf ("contact : Sylvain Bernier (toe@soon.com)\n");
  printf ("\n");

  printf ("device : %s\ndevice num : %d\nmidi channel : %d\ntempo : %d\n\n", DEVICE, PORT, CHANNEL, TEMPO);

  printf ("my computer : PENTIUM 166, linux 2.4.2, ALSA emu10k1, Roland Sound Canvas\n\n");

  printf ("each test is supposed to play : | c8 d e f g a b c | c,2 d e f g a b
c |\n");
  printf ("notice how some notes are played 'staccato' without our permission.\n\n");
  printf ("on my computer, 1/8 notes are OK, but the first c2 is shortened.\n");  printf ("as the sleep delay increases after each SNDCLT_SEQ_RESET, we notice that the problem disapears around 400 ms (my computer)\n");
  printf ("\n");

  for (int h = 0; h <= 10; h++) {

    // :::: /dev/music device open ::::
    seqfd = open(DEVICE, O_RDWR);
    if (seqfd == -1) {
      perror("/dev/music: error");
      return -1;
    }

    // ::: SNDCLT_SEQ_RESET :::
    if (ioctl(seqfd, SNDCTL_SEQ_RESET) != 0) perror("SNDCLT_SEQ_RESET: error");

    // ------------------------------------------------
    printf("test %d/11 : usleep(%d)\n", h + 1, (h * 50000));
    usleep(h * 50000);
    // ------------------------------------------------

    init_tempo();

    // ::: sending in the clowns :::
    for (int k = 1; k <= 4; k = k * 4) {
      for (int x = 0; x <= 12; x += 2) {
        SEQ_START_NOTE(PORT, CHANNEL, 60 + x, 0x60);
        SEQ_DELTA_TIME((96 / 2) * k); // each note lasts k 1/8 notes
        SEQ_STOP_NOTE(PORT, CHANNEL, 60 + x, 0);

        if (x == 4 || x == 11) x--;
      }
    }

    seqbuf_dump();
    close(seqfd);
  }

  printf("\n");
  return 0;
}
------------------------------------------------------------------------------

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux compusaurus 2.4.2 #5 Sat Apr 28 02:40:26 EDT 2001 i586
Locale: LANG=C, LC_CTYPE=C

Versions of packages alsa-source depends on:
ii  debconf                0.9.62            Debian configuration management sy
hi  gcc                    1:2.95.3-7        The GNU C compiler.               
hi  gcc [c-compiler]       1:2.95.3-7        The GNU C compiler.               
hi  gcc-2.95 [c-compiler]  1:2.95.4-0.010506 The GNU C compiler.               
ii  make                   3.79.1-6          The GNU version of the "make" util


---------------------------------------
Received: (at 100041-done) by bugs.debian.org; 4 Sep 2004 11:25:13 +0000
>From jdthood@aglu.demon.nl Sat Sep 04 04:25:13 2004
Return-path: <jdthood@aglu.demon.nl>
Received: from post-23.mail.nl.demon.net [194.159.73.193] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1C3YfR-0002dk-00; Sat, 04 Sep 2004 04:25:13 -0700
Received: from aglu.demon.nl ([82.161.38.140]:64973 helo=localhost)
	by post-23.mail.nl.demon.net with esmtp (Exim 4.34)
	id 1C3YfQ-0008Ct-3M; Sat, 04 Sep 2004 11:25:12 +0000
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by localhost (Postfix) with ESMTP id 2C7D810D5F3;
	Sat,  4 Sep 2004 13:26:02 +0200 (CEST)
Subject: Closing driver bug reports more than 2 years old
From: Thomas Hood <jdthood@aglu.demon.nl>
To: 100041-done@bugs.debian.org, 108572-done@bugs.debian.org,
	126797-done@bugs.debian.org
Content-Type: text/plain
Message-Id: <1094297161.11462.490.camel@thanatos>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.6 
Date: Sat, 04 Sep 2004 13:26:02 +0200
Content-Transfer-Encoding: 7bit
Delivered-To: 100041-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Closing driver bug reports more than 2 years old since they
aren't likely to be relevant any more.
--
Thomas