Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AM Video Crashing #720

Closed
sergiohinniger opened this issue Jun 5, 2022 · 15 comments
Closed

AM Video Crashing #720

sergiohinniger opened this issue Jun 5, 2022 · 15 comments

Comments

@sergiohinniger
Copy link

I recently have experienced AM crashing when i leave the video looping (in rpi4 complied with mmal and xinerama).
I saw that Oomek have fix such issue in attractplus in that commit: oomek/attractplus@71022a3
So i have used his fix in attract, manually editing src/fe_image.cpp from line 797, compiled and it worked, so AM is not crashing anymore. Maybe his solution should be adopted in AM.

@OzFalcon
Copy link
Contributor

OzFalcon commented Jun 9, 2022

Update: Looks like they are separate issues.

m_movie->play();

Though the location is somewhat different in attractplus.

Is this the same issue?
#717
7c351f7

@sergiohinniger
Copy link
Author

Apparently its not the same issue. Just compiled the current attract version and after less than 30 minutes attract crashed. With oomek fix i left my system more than 12 hours running and attract didn't crash.

@OzFalcon
Copy link
Contributor

OzFalcon commented Jun 10, 2022

You will have to give some more detail on what your doing. Layout, Video file etc.
I am unable to reproduce the crash on my Debian box. Could be a Pi related issue.....?
I just ran AM with a 4 frame video file for 7 hours with no apparent mem leaks or crashes.

@sergiohinniger
Copy link
Author

sergiohinniger commented Jun 12, 2022

Here is a loglevel debug until the problem appears. I am using hyperspin.nut as layout: https://pastebin.com/xt6uyMAw

@mickelson
Copy link
Owner

mickelson commented Jun 12, 2022 via email

@OzFalcon
Copy link
Contributor

OzFalcon commented Jun 15, 2022

terminate called without an active exception
Error decoding video (receiving frame): End of file
End Video Thread - /home/pi/.attract/menu-art/snap/Handhelds.mp4

  • bit_rate=188740, width=320, height=240
  • displayed=0
  • average qscore=0
    Aborted
    �]0;pi@retropie: ��[01;32mpi@retropie�[00m:�[01;34m $�[00m stop��[K��[K��[K��[Kxe��[K��[K�exit
    exit

Does it crash if your looping a video using the basic layout or is it only the hyperspin Theme Loader?

@sergiohinniger
Copy link
Author

Actually, after some testing i realize that the crash happens when in it is in the screensaver. The screensaver loads video, images and logos that start to play and loop. You can see a lot of videos being loaded by the screensaver in that log.

@OzFalcon
Copy link
Contributor

OzFalcon commented Jun 15, 2022

Crash confirmed in under a minute when running video in the screensaver (Using Basic layout).
(Switching off all modes except Movie Collage is the quickest way to cause AM to crash)

Just compiled with oomek/attractplus@71022a3
And it hasn't crashed yet and memory usage looks normal.

@stazna01
Copy link

stazna01 commented Sep 8, 2022

I'm having this exact same issue on a Pi 4 (screensaver videos always eventually crash attractmode). It's not a specific video that causes it, as I finally removed all but 3 snap videos, and while it would loop and play every video fine for awhile, eventually attractmode would crash and I'd get the same error. It does happen faster if using movie collage, but it eventually happens even when using the single movie option (usually takes a little over an hour with single movie mode). If I have no video snaps, the machine goes to a black screen during screensaver time, but it never crashes, so it's definitely the screensaver videos.

---begin error---
terminate called without an active exception
Error decoding video (sending packet): End of file
/usr/bin/attract: line 12: 720 aborted LD_LIBRARY_PATH="/opt/retropie/supplementary/attractmode/sfml/lib" "/opt/retropie/supplementary/attractmode/bin/attract" "$@"
---end error---

The videos are all from emumovies, and standard quality or high quality versions make no difference. I even tried re-encoding to 30 frames per second, but still the same issue. I also tried setting both mmal and software for video processing.

@kwyxz
Copy link

kwyxz commented Jan 7, 2023

I am having a similar issue, seemingly very random, during screen saver. I am on a Raspberry Pi 4 using kms, and the latest Raspbian. Videos are all encoded for mmal, using these specs:

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 356 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)

Compiled attract with debug symbols and ran through gdb for a few hours, here's what I get when it crashes:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0xf5e91804 in __GI_abort () at abort.c:79
#2  0xf60e6f88 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#3  0xf60e4acc in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0xf60e4b58 in std::terminate() ()
   from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#5  0x004135c4 in std::thread::operator= (this=0x88aab4, __t=...)
    at /usr/include/c++/10/thread:170
#6  0x0041073c in FeVideoImp::play (this=0x88aa60) at src/media.cpp:551
#7  0x004114f0 in FeMedia::play (this=0x737228) at src/media.cpp:879
#8  0x0037b6f8 in FeTextureContainer::set_play_state (this=0x99cd58, play=true)
    at src/fe_image.cpp:800
#9  0x0037da9c in FeImage::setVideoPlaying (this=0x999ac0, f=true)
    at src/fe_image.cpp:1468
#10 0x003c8958 in Sqrat::SqMember<FeImage, void>::Func1<bool, true> (
    vm=0x9a9500) at extlibs/sqrat/include/sqrat/sqratMemberMethods.h:2583
#11 0x00467b08 in SQVM::CallNative (this=0x9a9500, nclosure=0x83b6b0, nargs=2, 
    newbase=36, retval=..., suspend=@0xfffedfcf: 255)
    at extlibs/squirrel/squirrel/sqvm.cpp:1163
#12 0x00469410 in SQVM::Call (this=0x9a9500, closure=..., nparams=2, 
    stackbase=36, outres=..., raiseerror=1)
    at extlibs/squirrel/squirrel/sqvm.cpp:1530
#13 0x004494f8 in sq_call (v=0x9a9500, params=2, retval=0, raiseerror=1)
    at extlibs/squirrel/squirrel/sqapi.cpp:1086
#14 0x003adfa0 in Sqrat::sqVarSet (vm=0x9a9500)
    at extlibs/sqrat/include/sqrat/sqratMemberMethods.h:4063
#15 0x00467b08 in SQVM::CallNative (this=0x9a9500, nclosure=0x841b10, nargs=3, 
--Type <RET> for more, q to quit, c to continue without paging--
    newbase=31, retval=..., suspend=@0xfffee0af: false)
    at extlibs/squirrel/squirrel/sqvm.cpp:1163
#16 0x00469410 in SQVM::Call (this=0x9a9500, closure=..., nparams=3, 
    stackbase=31, outres=..., raiseerror=0)
    at extlibs/squirrel/squirrel/sqvm.cpp:1530
#17 0x00468814 in SQVM::FallBackSet (this=0x9a9500, self=..., key=..., val=...)
    at extlibs/squirrel/squirrel/sqvm.cpp:1346
#18 0x004685dc in SQVM::Set (this=0x9a9500, self=..., key=..., val=..., 
    selfidx=3) at extlibs/squirrel/squirrel/sqvm.cpp:1317
#19 0x0046435c in SQVM::Execute (this=0x9a9500, closure=..., nargs=2, 
    stackbase=15, outres=..., raiseerror=1, et=SQVM::ET_CALL)
    at extlibs/squirrel/squirrel/sqvm.cpp:817
#20 0x004693dc in SQVM::Call (this=0x9a9500, closure=..., nparams=2, 
    stackbase=15, outres=..., raiseerror=1)
    at extlibs/squirrel/squirrel/sqvm.cpp:1526
#21 0x004494f8 in sq_call (v=0x9a9500, params=2, retval=0, raiseerror=1)
    at extlibs/squirrel/squirrel/sqapi.cpp:1086
#22 0x003b8c48 in Sqrat::Function::Execute<int> (this=0x81e2a4, a1=92621951)
    at extlibs/sqrat/include/sqrat/sqratFunction.h:686
#23 0x003a6538 in FeVM::on_tick (this=0xfffeea18) at src/fe_vm.cpp:1196
#24 0x0040d1c8 in main (argc=5, argv=0xfffef664) at src/main.cpp:1080

I am using the latest git version of attract and sfml-pi.
Cheers!

mickelson added a commit that referenced this issue Jan 8, 2023
- Check if video thread is already running and shut it down before initating
  a new one in media play() function.  Also added exception handling and
  error logging for errors creating video thread
@mickelson
Copy link
Owner

Hi thanks for the reports and info. I've not been able to reproduce this myself locally but it looks to be an error during video thread creation. I think the code in the following pull request should fix it, if you could test and let me know that would be appreciated: #734

@kwyxz
Copy link

kwyxz commented Jan 8, 2023

Thanks @mickelson ! Built and running now. Sometimes it takes several hours to crash on my Pi 4, I will let it run and will keep you posted.

@kwyxz
Copy link

kwyxz commented Jan 10, 2023

It's been running for almost 48 hours now with no crash, as far as I am concerned #734 is a valid fix for my issue.

@mickelson
Copy link
Owner

mickelson commented Jan 10, 2023 via email

mickelson added a commit that referenced this issue Jan 10, 2023
Issue #720 - Try to fix video crashing
@mickelson
Copy link
Owner

Fixed with #734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants