All of lore.kernel.org
 help / color / mirror / Atom feed
* sequencer buffer
@ 2003-11-07 11:00 Bernhard Gerlach
  2003-11-07 13:08 ` Paul Davis
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Gerlach @ 2003-11-07 11:00 UTC (permalink / raw)
  To: alsa-devel


Hello NG,

again I've got a question regarding the ALSA midi sequencer. I tried to 
generate Midi time code. For that, I allocated a queue, started it and 
then filled it up with a couple of midi quarter frame messages. Each 
messages had got a timestamp containing the (real/absolute) time, at 
which the message should be sent by the queue. After filling the queue, 
I drained the buffer and tried to let the process sleep until 
snd_seq_event_output_pending( handle ) falls below a given value (I 
tried 500). But I realized, that the buffer size is never decremented, 
even if the queue outputs events.

The first 7 seconds of output seem to be ok (I control the output on a 
harddisk recorder which just reads the incoming midi time code and 
displays it). But then I get "Resource temporarily unavailable" errors 
when enqueueing another quarter frame event. I think, thats because the 
output buffer is full. But why isn't an event extracted from buffer when 
it is sent by a queue?

Thanks for answers,

Bernhard

-- 

---------------------------------
Bernhard Gerlach
Fraunhofer AEMT
Am Helmholtzring 1 (Haus M)
98693 Ilmenau
Germany

mail: gerlacbd@emt.iis.fhg.de
---------------------------------



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sequencer buffer
  2003-11-07 11:00 sequencer buffer Bernhard Gerlach
@ 2003-11-07 13:08 ` Paul Davis
  2003-11-13 15:27   ` Bernhard Gerlach
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Davis @ 2003-11-07 13:08 UTC (permalink / raw)
  To: Bernhard Gerlach; +Cc: alsa-devel

>again I've got a question regarding the ALSA midi sequencer. I tried to 
>generate Midi time code. 

you cannot send 100% valid MIDI time code on a Linux system without
the high resolution timers patch or some other interrupt source that provides
a suitable timing resolution.

MIDI time code is not just a sequence of bytes, it has very precise
semantics about when those bytes are to be delivered. there is no
mechanism in a default linux kernel on 99%-100% of all hardware today
that can implement those semantics.

i know that this isn't directly related to your question, but i wanted
to alert you to this issue. although other devices will be able to
chase your MTC data stream, some or even all will not lock to it
because it is jittery/bursty.

--p


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sequencer buffer
  2003-11-07 13:08 ` Paul Davis
@ 2003-11-13 15:27   ` Bernhard Gerlach
  0 siblings, 0 replies; 3+ messages in thread
From: Bernhard Gerlach @ 2003-11-13 15:27 UTC (permalink / raw)
  To: alsa-devel

Hi,

late, but its comes: my answer.

Paul Davis wrote:
> you cannot send 100% valid MIDI time code on a Linux system without
> the high resolution timers patch or some other interrupt source that provides
> a suitable timing resolution.
> [..]

Ok. I didn't really think about that. I deferred generating time code, 
since it is not very important at the moment. Maybe I have to work on 
that later, but then I'll first have to look for a appropriate timing 
hardware and something like a realtime/high res timer patch for the 
linux kernel.

> i know that this isn't directly related to your question, but i wanted
> to alert you to this issue. although other devices will be able to
> chase your MTC data stream, some or even all will not lock to it
> because it is jittery/bursty.

Thanks a lot for this suggestion!

Bernhard

-- 

---------------------------------
Bernhard Gerlach
Fraunhofer AEMT
Am Helmholtzring 1 (Haus M)
98693 Ilmenau
Germany

mail: gerlacbd@emt.iis.fhg.de
---------------------------------



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-13 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-07 11:00 sequencer buffer Bernhard Gerlach
2003-11-07 13:08 ` Paul Davis
2003-11-13 15:27   ` Bernhard Gerlach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.