Author Topic: Skulltronix DMX import synch problem  (Read 1562 times)

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Skulltronix DMX import synch problem
« on: October 17, 2018, 10:47:47 AM »
I can now successfully import a VSA sequence with 4 models. The sequence will play ok from VSA but it loses the sync between movements and sound file starting about 30 seconds in. Happens in last 3 versions of xlights. Now on 2018.36 64 bit.   Playback is still a bit jerky also.

The longer the animation runs the more out of sync it gets.  Not really noticeable until about 20 seconds in. 

I thought it was pc related (slow) but switched to a faster pc, loaded and saved the xml file and get the same problem.

Playing through Enttec Open interface.

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #1 on: October 17, 2018, 11:21:59 AM »
I switched the mp3 to wav. No difference. I switched the 30ms/f to 33ms/f. No difference.
The faster pc is showing 28-30 fps when played back. Shouldn't it be solid 30?

I closed all preview windows to speed up playback. No help.

What mechanism is it that Xlights uses to assure sync with the sound file?

 In Sequence Settings why does it have "Number of Models"?  It is blank.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #2 on: October 17, 2018, 11:46:10 AM »
You know once you have it all rendered in xLights there is absolutely no difference between the DMX data sent to lights vs servos so have you seen anyone complaining that their lights don't stay in sync?  I can't figure anything out cause I'm not seeing what you're seeing.  Its Windows its not going to be a rock solid playback rate plus you only playback sequences in xLights for testing its not used for the official playback mechanism.  You would be using an FPP or xScheduler for official sequence playback.  What happens if you start playback in the middle is it immediately out of sync?  Are the effects lined up where they should be?  I used to know how we synced up with the sound but I'm not sure if its changed so I'm not going to pretend to know I just know I've never seen my light playback out of sync and all because you have servos its still using DMX data so its not different than a set of lights out there.  Number of models has nothing to do with this.  Maybe we need to document it in the user manual "Number of models means the number of models".  If its blank maybe a bug cropped up.  That one I can probably fix.

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #3 on: October 17, 2018, 12:09:15 PM »
If I start the sequence in the middle it starts in sync but becomes noticeably out of sync after about 20-30 seconds.  Its not just out of sync. Its jerky from the very start.

Each time I also transfer it to the Pi3 B+ and get the exact same result from FPP.

I never have Xlights and FPP both physically connected at the same time. No cross talk.

I have often used Xlights as the playback mechanism in a live show without issue, although I agree Windows sucks. 

I know the pi3B+ is plenty fast. 

An aside:  There are many people who use wireless dmx and never see any delays or sync issues with their lights. But matching jaw motions with a soundtrack is much more critical and easier to spot. I've never found wireless DMX acceptable because of the sync issues and slow speed. 1/4 second out of sync might not be noticeable on lights. On jaw motion it is very noticeable. 

The jerky motions tell me the frame rate is too slow. Much too slow. Slower than the display is telling me.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #4 on: October 17, 2018, 01:24:07 PM »
When you use a new frame rate are you reimporting from VSA?  It will quantize the start/stop points to the timing so once imported making it faster doesn't help much.

I just don't know anything I can change to help unless I'm told hey this one effect did not import properly or something like that.  Lagging makes it sound like the data packets are getting held up or stacking up somewhere because I'm sure we are creating them on time.

Not sure if its still true but playback sync used to be controlled by us kicking off Windows Media Player through a wxWidgets control class and then we ask it where are you in playback and then we use its reply to determine which frame to output.  So if Windows Media Player all of sudden says the audio its at the 25 second mark we output the frame associated with that time location.

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #5 on: October 17, 2018, 02:45:00 PM »
I start with a new sequence and re-import each time. 

When watching the girl model, about 20 seconds in she should have a slow pan back and forth but in xlights she turns her head to the right at full extreme and holds it there for about 10 seconds when she should be looking forward and staying mostly centered.  I've compared all the limits in xlights and vsa many times and they are identical. The VSA file just isn't importing correctly.

It is very hard to compare the xlights and vsa files to each other.  If a video would help I could make one and post it on youtube or fb to show that girl pan example.

Offline keithsw1111

  • Administrator
  • Hero Member
  • *****
  • Posts: 2733
    • View Profile
    • Kellyville Christmas Lights
Re: Skulltronix DMX import synch problem
« Reply #6 on: October 17, 2018, 02:57:20 PM »
Not sure if its still true but playback sync used to be controlled by us kicking off Windows Media Player through a wxWidgets control class and then we ask it where are you in playback and then we use its reply to determine which frame to output.  So if Windows Media Player all of sudden says the audio its at the 25 second mark we output the frame associated with that time location.

We don’t use the windows media player any more but the principle still holds. Each time we go to output the frame we ask the sdl player where it is currently up to in the song and that is the frame of data we issue.



Sent from my iPhone using Tapatalk

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #7 on: October 17, 2018, 03:07:46 PM »
I'm looking at the data in the sequence. I expand the model so I see all the tracks.  The fine tracks have all the data. The regular tracks have no data on any of the models.  Am  seeing this the wrong way?

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #8 on: October 17, 2018, 03:21:22 PM »
I've also noticed the events have values such as 4 or 4.5. Never 4.4, 4.1.  With a range of 1 to 100 is it right to say there are only 200 possible values using this method?  That would be ok if both channels get 200 values but if only the fine channel gets the data it would explain the jerkiness. 

I'm curious why dmx uses zero to 255 values but xlights uses 0-100.  Is that just a historic programmer decision? 

I'm going to create a very simple vsa file with just one channel and see how the data compares.

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #9 on: October 17, 2018, 03:29:50 PM »
I created a file with just one servo motion.  It appears to import the correct values but only in the fine channel. There's nothing in the other channel.  Ive got to believe this is correct yet I don't understand it..

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #10 on: October 17, 2018, 03:30:56 PM »
When you say the girls head is stuck in the wrong position that is where I would expect you could narrow it down to a single effect and then we can inspect that effect and compare it to VSA to determine why its different.  We use 0 to 100 to represent a percentage so that when you say you need 50% we look at the min/max limits you defined for the servo and give you the value that is in the middle.  So if you say the limits are min=100 and max=200 and you set it to 50% then it renders it as a 150.  But everything for servos is calculated at the 16 bit level and then that is split into 2 bytes which become the fine and coarse bytes for each servo.

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #11 on: October 18, 2018, 11:16:14 AM »
I'll try to narrow it down for that one particular instance.  Although I'm not sure how that will address the sync issue or jerkiness.

You talk about percentages but with servos we talk about milliseconds.  VSA uses two channels to get to 10 bits, not 16. (yes it takes 16 bits to get there)  I assume you know that.  1024 steps.
I'd like to see your math for the conversions.  EG: If I have a servo with VSA motion restricted to 500 min and 750 max that is 1000 ms to 1500 ms.  It has a total number of possible steps of:

500 ms out of possible 2000 ms = 25% of 1024.  56 possible values between 1000 to 1500 ms. 

Is my math close to yours?

Servos have a normal range of 1000-2000 ms but some can go from 500ms to 2500 ms.

As further education to that one guy who is following this:  Some servos cannot tolerate anything outside 1000-2000 ms. They can fry.  So we try to keep our servo ranges within the safe range. 

I'll go back to the routine and narrow down that girl pan issue. 

This is obviously very important to me and I'm spending a lot of time on it and I really appreciate your help Gil. Thank you.

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #12 on: October 18, 2018, 11:52:37 AM »
Well.... great news - and weird news.

  In the VSA routine there were half a dozen events that had values out of limits for the Girl Pan servo. I corrected those in the VSA routine and then created a new xlights sequence.  It works fine. There seems to be something odd about the conversion process that causes the issues. 

Now on to other projects.  Thanks for your patience.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #13 on: October 18, 2018, 12:12:30 PM »
Jerry I don't convert to milliseconds I assume you enter the limits in the units you want sent over in the command so if the min limit is 500 and you choose 0% for a command then 500 is the command that is sent.  If you need that converted to milliseconds I assume you do that in your chucky board.

So you said you fix some out of limit commands in VSA and now it's working but you think that means there is something odd in the conversion process?  I know I'm clamping to the limits you enter cause I've tested it.  You keep telling me xLights has a problem but you keep fixing the problems without me changing xLights. :)

Offline skulltronix

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Skulltronix DMX import synch problem
« Reply #14 on: October 19, 2018, 10:56:02 AM »
Hi :)
I see a few others in the forum are having sync issues with lights.  Maybe its not a dmx issue at all but something else. 
My VSA file has a number of events that are out of range and fixing it by opening up every single event is killing my carpal tunnel syndrome. I'm looking for a way to fix the VSA file before importing because I could see that just fixing a few events in the girl pan movement noticeably improved the animation.  Not sure what format the data in the vsa file is in.  It would be great to open it in a good text editor and do find and replace.
Suggestions?
Thx!