Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Billy Biggs <vektor@div8.net>
To: linux-sound@vger.kernel.org
Subject: Re: Sync Issues (was Re: External MIDI Sync using OSS/Free)
Date: Thu, 28 Oct 1999 13:47:52 +0000	[thread overview]
Message-ID: <marc-linux-sound-94111859014288@msgid-missing> (raw)
In-Reply-To: <marc-linux-sound-94097346918347@msgid-missing>

Benno, you kick ass,

> >   I was using O_RDWR | O_NONBLOCK, under a 2.2 kernel.  I was trying to do
> > drumrolls, 16th notes, at 140bpm or 150bpm.  It was no good.
> 
> hmmm, really strange:
> I wrote a little util called mididelay, which writes a note-on MIDI message on
> the midi-out port reads back the message and measures the delay.

  Can I get a copy of this program?  Are you just using gettimeofday()
before and after, or are you using ptrace or some other hackery?

> BTW: which card are you using ?

  For MIDI I'm using a Roland MPU-IPC-T card.  MPU-401.

> >   One requirement for ttrk was that it be able to trigger samples on beat,
> 
> I'd suggest to use the raw /dev/dsp and the raw /dev/midi interface:
> [...]

  Thanks for your suggestions.  I'm hacking at it now...

> Do not forget to apply the lowlatency patches, or your timing will
> simply suck ! even an untuned IDE disk, when it reads/writes a small
> amount of data from/to the disk, could cause 20-50ms delay in your app
> and this is very bad for MIDI. ( see my tests , especially the non DMA
> ones = horrible :-)  )

  What lowlatency patches??  kernel patches??  That's just ugly.  Where
can I get them?

> > > >  What about syncing multiple soundcards?
> 
> yes, this is far from trivial, but we will try to provide some usable
> solution: mainly activating the cards by using DSP_SET_TRIGGER (if
> supported, otherwise it's a real pain), to minimize starting delays,
> and then use one of the soundcards as source (or alternatively other
> timer sources), and put the remaining cards into a "slave" mode, where
> you measure the sample differences in audio buffers, and insert
> additional or drop samples to keep things in sync.

  How can you tell if you've underrun under OSS?  Using ALSA, I guess you
can use it's time stuff to calculate if you've missed a frame, but even
that seems hacky.

  Do you just always use gettimeofday() math to keep track of how much
stuff you've written, and when skips have occured?

  I don't like using one dsp as the sync master since I always want to be
able to sync to something external, like MIDI.

  So, the problem becomes, how do you sync many soundcards and have it all
synced off external MIDI. :)

--
Billy Biggs                         vektor@div8.net
http://www.div8.net/billy       wbiggs@uwaterloo.ca

  parent reply	other threads:[~1999-10-28 13:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-26 21:06 Sync Issues (was Re: External MIDI Sync using OSS/Free) Billy Biggs
1999-10-26 23:21 ` Billy Biggs
1999-10-27  2:16 ` Paul Barton-Davis
1999-10-28  9:22 ` Benno Senoner
1999-10-28 13:47 ` Billy Biggs [this message]
1999-10-28 14:45 ` Paul Barton-Davis
1999-10-28 14:59 ` Billy Biggs
1999-10-28 16:13 ` Paul Barton-Davis
1999-10-28 23:46 ` Benno Senoner
1999-10-29  0:06 ` Benno Senoner
1999-10-30 16:06 ` Jaroslav Kysela
1999-10-30 18:05 ` Jaroslav Kysela
1999-10-30 18:12 ` Billy Biggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-sound-94111859014288@msgid-missing \
    --to=vektor@div8.net \
    --cc=linux-sound@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox