Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   64 Studio Developer (http://www.linux-archive.org/64-studio-developer/)
-   -   Correlation of alsa -p value and hw MIDI jitter (http://www.linux-archive.org/64-studio-developer/399323-correlation-alsa-p-value-hw-midi-jitter.html)

Devin Anderson 07-14-2010 07:30 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 10:29 AM, Ralf Mardorf
<ralf.mardorf@alice-dsl.net> wrote:

> Hi :)
>
> delayed by a thunder-storm I could do another test.
> --snip--

So, what you're saying is that your MIDI device and software synth
sync up less and less as you raise the period size. I had presupposed
before that your MIDI device was triggering *after* your software
synth, but it occurs to me that it might be the other way around. Do
you hear the audio from your software synth first, or from your MIDI
device?

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-devel mailing list
64studio-devel@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-devel

Devin Anderson 07-14-2010 09:12 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 12:43 PM, Ralf Mardorf
<ralf.mardorf@alice-dsl.net> wrote:
> On Wed, 2010-07-14 at 12:30 -0700, Devin Anderson wrote:
>> On Wed, Jul 14, 2010 at 10:29 AM, Ralf Mardorf
>> <ralf.mardorf@alice-dsl.net> wrote:
>>
>> > Hi :)
>> >
>> > delayed by a thunder-storm I could do another test.
>> > --snip--
>>
>> So, what you're saying is that your MIDI device and software synth
>> sync up less and less as you raise the period size.
>
> Yes :).
>
>> I had presupposed
>> before that your MIDI device was triggering *after* your software
>> synth, but it occurs to me that it might be the other way around. *Do
>> you hear the audio from your software synth first, or from your MIDI
>> device?
>
> I can't say it today, now I do some office work. I had the impression
> that it might vary. Sometimes the virtual drum sampler and sometimes the
> standalone drum sampler was played earlier, I need to check this ASAP.
> For older tests with my USB MIDI device it was exactly that way, that
> jitter had positive and negative delay. At least the recorded waveforms
> of external MIDI equipment (when I used USB MIDI, now I'm using PCI
> MIDI), were recorded by Qtractor, before theoretically the MIDI event
> was send ;). Note! Qtractor had no latency compensation, all recorded
> audio of external MIDI instruments should have (positive) delay, but
> negative delay.

If it ends up being the case that your MIDI device is being triggered
before your software synth, then I'm guessing that the issue here is
not MIDI jitter. I'm guessing the issue is that the latency that's
imposed by JACK on incoming and outgoing audio is not imposed on
incoming and outgoing ALSA MIDI. So, while the audio coming out of
the software synth is delayed by a certain amount of frames imposed by
JACK, the audio coming out of your MIDI device is only delayed by the
latency of the ALSA drivers, the latency of the MIDI ports, the
latency of your MIDI device.

This would certainly explain why the problem gets worse as you raise
the period size, and could explain why you had positive and negative
delay in your older USB MIDI tests, as the reported MIDI jitter in
your tests was *far* worse in your older tests than it is now.

At the moment, I happen to be doing some work in JACK 2 that could
potentially solve this issue by enabling MIDI to sync more closely
with audio, so I'm very curious to know if my suspicions are correct.
Please keep me updated. :)

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-devel mailing list
64studio-devel@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-devel

Devin Anderson 07-14-2010 09:12 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 12:43 PM, Ralf Mardorf
<ralf.mardorf@alice-dsl.net> wrote:
> On Wed, 2010-07-14 at 12:30 -0700, Devin Anderson wrote:
>> On Wed, Jul 14, 2010 at 10:29 AM, Ralf Mardorf
>> <ralf.mardorf@alice-dsl.net> wrote:
>>
>> > Hi :)
>> >
>> > delayed by a thunder-storm I could do another test.
>> > --snip--
>>
>> So, what you're saying is that your MIDI device and software synth
>> sync up less and less as you raise the period size.
>
> Yes :).
>
>> I had presupposed
>> before that your MIDI device was triggering *after* your software
>> synth, but it occurs to me that it might be the other way around. *Do
>> you hear the audio from your software synth first, or from your MIDI
>> device?
>
> I can't say it today, now I do some office work. I had the impression
> that it might vary. Sometimes the virtual drum sampler and sometimes the
> standalone drum sampler was played earlier, I need to check this ASAP.
> For older tests with my USB MIDI device it was exactly that way, that
> jitter had positive and negative delay. At least the recorded waveforms
> of external MIDI equipment (when I used USB MIDI, now I'm using PCI
> MIDI), were recorded by Qtractor, before theoretically the MIDI event
> was send ;). Note! Qtractor had no latency compensation, all recorded
> audio of external MIDI instruments should have (positive) delay, but
> negative delay.

If it ends up being the case that your MIDI device is being triggered
before your software synth, then I'm guessing that the issue here is
not MIDI jitter. I'm guessing the issue is that the latency that's
imposed by JACK on incoming and outgoing audio is not imposed on
incoming and outgoing ALSA MIDI. So, while the audio coming out of
the software synth is delayed by a certain amount of frames imposed by
JACK, the audio coming out of your MIDI device is only delayed by the
latency of the ALSA drivers, the latency of the MIDI ports, the
latency of your MIDI device.

This would certainly explain why the problem gets worse as you raise
the period size, and could explain why you had positive and negative
delay in your older USB MIDI tests, as the reported MIDI jitter in
your tests was *far* worse in your older tests than it is now.

At the moment, I happen to be doing some work in JACK 2 that could
potentially solve this issue by enabling MIDI to sync more closely
with audio, so I'm very curious to know if my suspicions are correct.
Please keep me updated. :)

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-users mailing list
64studio-users@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-users

Devin Anderson 07-14-2010 09:50 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 2:38 PM, Ralf Mardorf
<ralf.mardorf@alice-dsl.net> wrote:

> Should I build JACK dummy packages for 64 Studio and daily get JACK2
> from svn co http://subversion.jackaudio.org/jack/jack2/trunk/jackmp ?

There's no reason to do that. When the changes get integrated into
JACK 2, I'll let you know.

BTW, if you have a firewire device that has MIDI input and output,
your soft synth supports JACK MIDI, and you load the FFADO driver,
then you can test the sync theory right now. My MIDI port code in the
FFADO driver should sync JACK audio and outgoing FFADO MIDI.

> I wonder if this should be cross-posted to LAD?
>
> On LAD and the 64 Studio list are people with much knowledge and your
> reply might hit the nail on the head.

Make sure that the MIDI device is being triggered before the soft
synth before you post to LAD. If it ends up being the case, then go
ahead and post it on LAD.

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-users mailing list
64studio-users@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-users

Devin Anderson 07-14-2010 09:50 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 2:38 PM, Ralf Mardorf
<ralf.mardorf@alice-dsl.net> wrote:

> Should I build JACK dummy packages for 64 Studio and daily get JACK2
> from svn co http://subversion.jackaudio.org/jack/jack2/trunk/jackmp ?

There's no reason to do that. When the changes get integrated into
JACK 2, I'll let you know.

BTW, if you have a firewire device that has MIDI input and output,
your soft synth supports JACK MIDI, and you load the FFADO driver,
then you can test the sync theory right now. My MIDI port code in the
FFADO driver should sync JACK audio and outgoing FFADO MIDI.

> I wonder if this should be cross-posted to LAD?
>
> On LAD and the 64 Studio list are people with much knowledge and your
> reply might hit the nail on the head.

Make sure that the MIDI device is being triggered before the soft
synth before you post to LAD. If it ends up being the case, then go
ahead and post it on LAD.

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-devel mailing list
64studio-devel@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-devel

Devin Anderson 07-14-2010 09:52 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 2:50 PM, Devin Anderson
<devin@charityfinders.com> wrote:

>> I wonder if this should be cross-posted to LAD?
>>
>> On LAD and the 64 Studio list are people with much knowledge and your
>> reply might hit the nail on the head.
>
> Make sure that the MIDI device is being triggered before the soft
> synth before you post to LAD. *If it ends up being the case, then go
> ahead and post it on LAD.

Oh. You already were CCing LAD. Huh. I guess I should join LAD.

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-users mailing list
64studio-users@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-users

Devin Anderson 07-14-2010 09:52 PM

Correlation of alsa -p value and hw MIDI jitter
 
On Wed, Jul 14, 2010 at 2:50 PM, Devin Anderson
<devin@charityfinders.com> wrote:

>> I wonder if this should be cross-posted to LAD?
>>
>> On LAD and the 64 Studio list are people with much knowledge and your
>> reply might hit the nail on the head.
>
> Make sure that the MIDI device is being triggered before the soft
> synth before you post to LAD. *If it ends up being the case, then go
> ahead and post it on LAD.

Oh. You already were CCing LAD. Huh. I guess I should join LAD.

--
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
_______________________________________________
64studio-devel mailing list
64studio-devel@lists.64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-devel


All times are GMT. The time now is 12:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.