Game Development Community

GuiTheora Crashes on Play

by Jorge Luis Gandulfo · in Torque 3D Professional · 11/11/2009 (1:19 pm) · 23 replies

All i did last night is add a new GuiTheora control in MainMenuGui, nothing fancy, was just for testing.
Selected a video and when it plays it, it crashes.

Console don't give any error, it reports the video loaded OK.

I tried 2 video samples from inet, and also made a new video using ffmpeg2theora.

The video i made plays a few frames and crashes too, this happens even if i set the video via script instead of GuiEditor.

Any tips?

I will run this in the debug version i have home tonight and report here.
Page «Previous 1 2
#1
11/11/2009 (1:23 pm)
Thanks for moving the thread.

My guess is that the threading code produces a crash. A stackdump for the crash will be most useful. Also, it would be very helpful if you could provide a dump for both the main thread as well as the streaming thread(s) (one or more of the ThreadPool threads--the threads are named so should be easy to find in the debugger).
#2
11/11/2009 (1:26 pm)
Also, if possible, if you can point to one of the videos you downloaded from the net, I will run it on my end here and see if I reproduce the crash.
#3
11/11/2009 (2:04 pm)
I downloaded a video from this link http://www.polycrystal.org/lego/movies.html.

This was taken from http://wiki.xiph.org/index.php/List_of_Theora_videos.

Thanks

Edit: Remember i also made a video using ffmpeg2theora (http://v2v.cc/~j/ffmpeg2theora/)

Edit2: This also (http://v2v.cc/~j/theora_testsuite/)
#4
11/11/2009 (2:27 pm)
Ok, thanks for posting the links.

Swim plays fine but for "A New Computer" I get a lockup (but not a crash) in Xiph's Ogg Vorbis code. Apparently, the code won't manage to correctly parse out the Vorbis headers and just loops infinitely over the data. Sigh.

The testsuite files all play without problems (which does *not* surprise me as I've tested all the Theora sample videos from Xiph before).

I'll look more deeply this. Stack dump would still be very much appreciated.

---

As for the problem above, here's some explanation: I opted to separate the Vorbis streaming from the Theora streaming into two separate physical streams as that resulted in a lot less interference between threads (all the Ogg states can only be accessed from a single thread). For the Vorbis streaming, I just use standard Vorbis support already there in SFX.

However, I've left the original code with the combined streaming in. To activate this, undefine SPLIT_VORBIS at the top of gfx/video/theoraTexture.cpp. But then, I don't remember if this ever worked completely, so it may make matters worse actually.
#5
11/11/2009 (2:29 pm)

From your report, I conclude that you are getting crashes both for videos without and for videos with sound. Is that correct?

If so, it's definitely not the Vorbis code in your case.
#6
11/11/2009 (3:12 pm)
Well i tested the first videos from the testsuite(320x240 or something), i bet that is video only.

Also testes A New Computer, and then another video i encoded myself that had audio too.

You think i should try to encode videos only files?

Sorry i can't upload a dump yet, i need to get home to do that, will do later tonight, and thanks a lot for your help.
#7
11/11/2009 (3:33 pm)

Ok, cool, thanks for all the testing. The problem you are encountering probably is somewhere in the threading code.

I keep drilling here on my end.
#8
11/11/2009 (4:17 pm)

Ok, fixed the deadlocking problem. It was actually caused by the SFX Vorbis code not initializing the Vorbis stream fully when doing a stream clone thus causing the Ogg code to loop infinitely because it assumed it was already further into the stream.

Line 40 in sfx/media/sfxVorbisStream.cpp should read:

if( !_readHeader() )  // previously was _openVorbis
#9
11/11/2009 (6:18 pm)
Great Rene, you are fast! i will apply this tonight, thanks a lot for your time.
#10
11/11/2009 (6:23 pm)

:)

Unfortunately this only fixes possible lockups in relation to video with sound so it probably won't help with the crashes you are experiencing. But we'll get to the root of that as well.
#11
11/12/2009 (11:45 am)
I'm still having the same problem, even tested on another computer.

This is the dump i got from my project (its an empty project modified but the exe only have a few lines modified in the input system to support driving wheels).

http://www.he-labs.com.ar/birdman/VTour_DEBUG.dmp

You were right about that the problems was related to threads.

Also the last tests i did with the modified line you sent me gave an error in script, this is the error.

TheoraTexture - Loading file 'art/videos/video.ogv'
- Theora: 320x240 pixels, 30.00 fps, 4:2:0 format
TheoraTexture - could not create Vorbis stream for 'art/videos/video.ogv'

I really don't know how to deal with this, and it seems not everybody is having the same problem, which is weird also.
#12
11/12/2009 (3:49 pm)
Thanks for posting the dump. Unfortunately, I can't it use as such. If you don't mind, could you post screenshots of the stacktraces from the main and play threads when it crashes? This should point me in the right direction and I hope to have this resolved soon then.

The error message from TheoraTexture is a bit misleading. It has no way or telling whether the video contains audio or not (due to the above-mentioned physical separation between the streaming systems) and just blindly tries to create a Vorbis stream in the file. If it fails because there really was an error or just because the stream creation fails when there is no Vorbis stream, it will emit the error message above.
#13
11/13/2009 (2:59 pm)
Rene, if i run the precompiled FPS Example exe, it won't fail while using theora video.

So i suggest that if you want to test this, you should create a new project from the empty one, then build that and test there.

Here is the shoot i took from the debugging session.

http://www.he-labs.com.ar/birdman/test.JPG

Hope you can discover whats going on, and thanks a lot in advance.

#14
11/13/2009 (3:50 pm)
Hmm, no luck reproducing so far. Tested it with the empty template and all videos played without problems.

If you do compile FPS Example yourself, do you then get a crash, too, or does it run fine then?

Thanks for the stack snapshot. The readout is pretty odd. Apparently it fails when trying to copy the decoded Theora frame data to the frame buffer texture. However, while the initial pointers passed to dMemcpy all seem valid, they get all mixed up in the runtime. Source becomes destination, length is taken as the destination pointer, and length itself is nonsense.

This *strongly* hints at a compile/setup issue. It looks as if the calling conventions there don't match up and thus the callframes are set up incorrectly and all frame positions are shifted upwards.
#15
11/20/2009 (1:56 pm)
Rene, i was out on a trip and i couldn't check this earlier.

If i compile the FPS example it works, so i will try to make a new project from scratch and see how it goes, i can't see any way to debug this further..
#16
11/20/2009 (7:04 pm)

Great, thanks for testing. Confirms that this is a compile issue.

BTW, are you using projectGenerator? With this, re-generating your projects is trivial and maybe things are just fine then.
#17
02/12/2014 (5:46 pm)
"Ok, fixed the deadlocking problem. It was actually caused by the SFX Vorbis code not initializing the Vorbis stream fully when doing a stream clone thus causing the Ogg code to loop infinitely because it assumed it was already further into the stream.

Line 40 in sfx/media/sfxVorbisStream.cpp should read:




view plaincopy to clipboardprint?
01.if( !_readHeader() ) // previously was _openVorbis "


So Where is this file located? I cannot find it in my torque installation.
#18
02/12/2014 (6:03 pm)
That file is in engine/sfx/media ... It's called "sfxVorbisStream.cpp" ... Lookin' right at it....
www.roostertailgames.com/images/sfxVorbisStream_cpp.png
#19
02/26/2014 (5:48 pm)
My bad. I was looking in
J:\2014\Torque3D\My Projects\Multiplayer Corps
not
J:\2014\Torque3D\Engine\source\sfx\media
#20
02/26/2014 (5:55 pm)
I'm getting it to load the theora file.

It plays the animation for a second and then crashes.

I'm going to debug the program and see if I can fix it.

Here's to hoping I can.
Page «Previous 1 2