Author Topic: video/audio snap out of sync  (Read 6081 times)

myriadgamers

  • Full Member
  • ***
  • Posts: 43
    • View Profile
video/audio snap out of sync
« 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.
Arcade Machine 1:
AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

eulogy37

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: video/audio snap out of sync
« Reply #1 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 )

myriadgamers

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: video/audio snap out of sync
« Reply #2 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.
Arcade Machine 1:
AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

eulogy37

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: video/audio snap out of sync [RESOLUTION]
« Reply #3 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".

myriadgamers

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: video/audio snap out of sync
« Reply #4 on: March 07, 2019, 07:22:53 AM »
Wow, thank you very much. I will definitely try this!
Arcade Machine 1:
AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: video/audio snap out of sync
« Reply #5 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.

Mah0uPh0x

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: video/audio snap out of sync
« Reply #6 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.

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: video/audio snap out of sync
« Reply #7 on: March 09, 2019, 04:56:24 PM »
Would you share some of the videos that exhibit desynchronization please?

Mah0uPh0x

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: video/audio snap out of sync
« Reply #8 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.

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: video/audio snap out of sync
« Reply #9 on: March 09, 2019, 05:01:58 PM »
Thanks, I'll try to get to the bottom of this.

Mah0uPh0x

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: video/audio snap out of sync
« Reply #10 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

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: video/audio snap out of sync
« Reply #11 on: March 09, 2019, 05:04:38 PM »
Yes, I've seen it. I'll continue the conversation on github.

BadFurDay

  • Full Member
  • ***
  • Posts: 82
    • View Profile
Re: video/audio snap out of sync
« Reply #12 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.