Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: myriadgamers on February 11, 2019, 11:38:43 AM

Title: video/audio snap out of sync
Post by: myriadgamers on February 11, 2019, 11:38:43 AM
I honestly cant fathom why this is occurring but all my videos on my main menu will eventually get out of sync with the audio. Its really driving me crazy. It was all working fine until I moved my computer into the actually arcade cabinet. I can play the videos in a media player and they play normal with out sync issues. I dont know if I messed up some settings or what, but the hardware in the machine is more than capable of playing these videos with no issue. Games all run just fine. Any help would be wonderful.
Title: Re: video/audio snap out of sync
Post by: eulogy37 on March 04, 2019, 10:02:16 PM
The same thing is happening to me, but no cabinet...just a naked pi.

Some helpful info:
attract -v
Code: [Select]
Attract-Mode v2.4.0 (Linux, SFML 2.4 +FontConfig +GLES +SWF +7z)
avcodec 58.22.100 / avformat 58.17.101 / swscale 5.2.100 / swresample 3.2.100

Shaders are not available.


ffmpeg -codecs | grep h264_mmal
Code: [Select]
ffmpeg version git-2018-07-31-481741e Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --enable-mmal --disable-debug --enable-shared
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 22.100 / 58. 22.100
  libavformat    58. 17.101 / 58. 17.101
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 26.100 /  7. 26.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_mmal ) (encoders: h264_v4l2m2m )
Title: Re: video/audio snap out of sync
Post by: myriadgamers on March 05, 2019, 06:00:22 AM
Yeah, I recently lowered the res of all the videos in question, Changed my hardware to a 4 ghz 8 core amd with 20 gigs of DDr 3, and a GTX 750 (was a 550 ti). The problem still persists for me. It wouldnt be so bad but I included some FMV style games and the preview of the game its self has the audio go out of sync while the characters are speaking in the video, which to be honest drives me a little crazy.

Now the audio is perfectly in sync when the game is actually being played. Its simply the videos I have  for my snaps.
Title: Re: video/audio snap out of sync [RESOLUTION]
Post by: eulogy37 on March 06, 2019, 10:11:52 PM
I'm commenting here because I've fixed this issue on my Raspberry Pi.

The issue (as of today...hopefully it will be fixed in the future) was introduced in some version of Attract Mode and rolling back to an older version will fix it. This assumes you have already installed all the prerequisites of Attract Mode and Attract Mode itself. From there, go to a command line and enter these commands:

Code: [Select]
mkdir develop
cd develop

Note: Do not use "--depth 1" since it will only get the most recent version. We need a past version.
Code: [Select]
git clone https://github.com/mickelson/attract attract
cd attract

This will get us the most recent version that has no loss of sync. The last line should say "HEAD is now at 793c2f8... Fix 'non-blocking mode wait'" (etc)
Code: [Select]
git checkout 793c2f8

Now we compile and install.
Code: [Select]
make USE_GLES=1
sudo make install USE_GLES=1

Now you check your version of Attract Mode with this command. It should be v2.4.0-10
Code: [Select]
attract -v

If everything worked, we can get rid of our develop folder because we don't need it anymore.
Code: [Select]
cd ../..
rm -r -f develop

And you're done. Feel free to reboot or just run Attract Mode by typing "attract".
Title: Re: video/audio snap out of sync
Post by: myriadgamers on March 07, 2019, 07:22:53 AM
Wow, thank you very much. I will definitely try this!
Title: Re: video/audio snap out of sync
Post by: Oomek on March 09, 2019, 02:12:27 PM
All of you having issues with a/v sync on Windows with nVidia cards please try creating a profile for Attract Mode in nVidia Control Panel and setting Threaded Optimizations to OFF.
Title: Re: video/audio snap out of sync
Post by: Mah0uPh0x on March 09, 2019, 04:54:47 PM
All of you having issues with a/v sync on Windows with nVidia cards please try creating a profile for Attract Mode in nVidia Control Panel and setting Threaded Optimizations to OFF.

I've tried exactly that, and still no luck. My videos still are out of sync. I'm on Windows 10 with a GTX 970.
Title: Re: video/audio snap out of sync
Post by: Oomek on March 09, 2019, 04:56:24 PM
Would you share some of the videos that exhibit desynchronization please?
Title: Re: video/audio snap out of sync
Post by: Mah0uPh0x on March 09, 2019, 04:58:08 PM
Would you share some of the videos that exhibit desynchronization please?

A preview video of Super Mario Bros. is what I'm testing with. It seems to go out of sync the most when the player is hit by the Goomba. I linked the video in the attachment below.
Title: Re: video/audio snap out of sync
Post by: Oomek on March 09, 2019, 05:01:58 PM
Thanks, I'll try to get to the bottom of this.
Title: Re: video/audio snap out of sync
Post by: Mah0uPh0x on March 09, 2019, 05:03:16 PM
Thanks, I'll try to get to the bottom of this.

You're welcome. I also made a thread on github about this issue a while back. I posted a video link in it that shows another case of this happening.
https://github.com/mickelson/attract/issues/463 (https://github.com/mickelson/attract/issues/463)
Title: Re: video/audio snap out of sync
Post by: Oomek on March 09, 2019, 05:04:38 PM
Yes, I've seen it. I'll continue the conversation on github.
Title: Re: video/audio snap out of sync
Post by: BadFurDay on March 10, 2019, 11:30:07 AM
This has sorted out the issue I had on the separate post. However the ones that would stop are now just stuttering a lot, though they do play all the way through now.