From: Christopher Arndt <chris.arndt@web.de>
To: alsa-devel@alsa-project.org
Subject: pyalsa: SeqEvent.time strangeness (Was: synchronizing queue with MIDI clock events)
Date: Fri, 31 Jul 2009 20:26:27 +0200 [thread overview]
Message-ID: <4A733753.60808@web.de> (raw)
In-Reply-To: <4A65EADE.70007@web.de>
Christopher Arndt schrieb:
>> You can tell ALSA to timestamp all events that are received; just call
>> the snd_seq_port_info_set_timestamping() function and set a queue that
>> is running, then you'll get the queue's current time in each event.
>> This isn't implemented in pyalsa, but you can set this for a specific
>> connection with the queue, time_update, and time_real parameters of the
>> connect_ports function.
I've tested this now and encountered a very strange bevahior of the
event time set by the queue:
a) SeqEvent.time seems to be in milliseconds instead of seconds as would
be expected by the ALSA documentation and looking at the source of
pyalsa.alsaseq.
5) Consecutive timestamp go up to ~1000,00 and then seem to wrap around
and start from zereo again.
I have created a small test program, which demonstrates this:
http://paste.chrisarndt.de/paste/fa8ca7201bc7419f9e001315ca02b1ef
It outputs the time of each MIDI clock signal it receives and whether it
is in tick or real time and whether it's absolute (= from the start of
the queue) or relative (to the preceding event). Here's some output from
the script:
MIDI CLOCK 0.0 ABS REAL
MIDI CLOCK 23.697488 ABS REAL
MIDI CLOCK 48.701538 ABS REAL
MIDI CLOCK 73.70515 ABS REAL
MIDI CLOCK 98.705762 ABS REAL
MIDI CLOCK 123.709812 ABS REAL
MIDI CLOCK 148.702424 ABS REAL
MIDI CLOCK 173.707474 ABS REAL
MIDI CLOCK 198.711086 ABS REAL
[...]
MIDI CLOCK 898.73904 ABS REAL
MIDI CLOCK 923.74909 ABS REAL
MIDI CLOCK 948.744702 ABS REAL
MIDI CLOCK 973.742314 ABS REAL
MIDI CLOCK 998.749364 ABS REAL
MIDI CLOCK 24.738976 ABS REAL
MIDI CLOCK 49.741026 ABS REAL
MIDI CLOCK 74.743638 ABS REAL
MIDI CLOCK 99.74725 ABS REAL
As you can see, once the time would exceed 1000.0 it seems to start from
zero again. This happens only when the queue sets the event times to
REAL. When ticks are used, the increase infinitely, as expected.
I fail to understand why this is and what I am doing wrong. I would
expect SeqEvent.time to be in seconds and always ascending until I stop
the queue. Please, somebody enlighten me!
Chris
next prev parent reply other threads:[~2009-07-31 18:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-17 12:54 pyalsa: synchronizing queue with MIDI clock events Christopher Arndt
2009-07-20 12:31 ` Christopher Arndt
2009-07-21 13:32 ` Clemens Ladisch
2009-07-21 16:20 ` Christopher Arndt
2009-07-31 18:26 ` Christopher Arndt [this message]
2009-08-02 15:42 ` pyalsa: SeqEvent.time strangeness (Was: synchronizing queue with MIDI clock events) Christopher Arndt
2009-08-03 11:55 ` Clemens Ladisch
2009-08-03 12:21 ` pyalsa: SeqEvent.time strangeness Christopher Arndt
2009-08-04 9:45 ` Clemens Ladisch
2009-08-04 11:10 ` Christopher Arndt
2009-08-04 13:03 ` Clemens Ladisch
2009-08-05 13:18 ` [PATCH] alsa-python: Add support for setuptools Christopher Arndt
2009-08-05 13:30 ` Clemens Ladisch
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=4A733753.60808@web.de \
--to=chris.arndt@web.de \
--cc=alsa-devel@alsa-project.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 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.