overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
138 stars 50 forks source link

Recording API is broken. #828

Open AleziaKurdis opened 7 months ago

AleziaKurdis commented 7 months ago

Debugging the "Record" app. i find out that the Recording API seems to be broken currently. (it stopped to work after V8)

When the the app is calling "Recording.startRecording" method, interface just freeze and need to be killed.

When we want to play an existing recording, the app sent a message to an AC script that normally plays the recording. But the nothing get played. The ACscript do at least : "Recording.loadRecording" ans then "Recording.startPlaying" I can't say which one of them fail. I haven't found any crash in the consol. (it probably crach internally)

All this lead me to believe that the whole API is just not working.

The application use all those methods (2 are deprecated, i don't know if it cause issue, they are in the ACscipt): Recording.startRecording Recording.loadRecording Recording.setPlayFromCurrentLocation Recording.setPlayerUseDisplayName Recording.setPlayerUseHeadModel (Deprecated (Not used)) Recording.setPlayerUseAttachments (Deprecated (Not used)) Recording.setPlayerLoop Recording.setPlayerUseSkeletonModel Recording.setPlayerTime Recording.startPlaying Recording.isPlaying Recording.stopPlaying Recording.saveRecordingToAsset

Also, the Recording API is not visible anymore in the documentation, since the file get moved. (I had to see in Vircadia doc to figure it out) Fixed in #829

JulianGro commented 7 months ago

Fixed by: https://github.com/overte-org/overte/pull/829

JulianGro commented 7 months ago

Actually, sorry, this reports multiple issues and only one is fixed.

ksuprynowicz commented 7 months ago

I will need to try to run it with debugger and see where it freezes. It sounds liek a deadlock and could be easy to fix.

ksuprynowicz commented 6 months ago

What would be the best way to test this? Could you provide simple scripts and necessary recording files for debugging?

ksuprynowicz commented 6 months ago

I found the reason for deadlock. This happens on main thread:

futex_wait 0x00007ffff02a33db
__GI___lll_lock_wait 0x00007ffff02a33db
lll_mutex_lock_optimized 0x00007ffff02a96f2
___pthread_mutex_lock 0x00007ffff02a96f2
v8::internal::ThreadManager::Lock() 0x00007fffdffcbd31
v8::Locker::Initialize(v8::Isolate*) 0x00007fffdffcc290
v8::Locker::Locker v8-locker.h:114
ScriptValueV8Wrapper::isFunction ScriptValueV8Wrapper.cpp:710
ScriptValue::isFunction ScriptValue.h:270
RecordingScriptingInterface::saveRecordingToAsset RecordingScriptingInterface.cpp:265
RecordingScriptingInterface::qt_static_metacall moc_RecordingScriptingInterface.cpp:234
QObject::event 0x00007ffff62f9940
QApplicationPrivate::notify_helper 0x00007fffeeb62f32
Application::notify Application.cpp:4292
QCoreApplication::notifyInternal2 0x00007ffff62cc748
QCoreApplication::sendEvent 0x00007ffff62cc922
QCoreApplicationPrivate::sendPostedEvents 0x00007ffff62cfe51
QCoreApplication::sendPostedEvents 0x00007ffff62d03ac
postEventSourceDispatch 0x00007ffff6328697
g_main_dispatch 0x00007fffefb111f4
g_main_context_dispatch_unlocked 0x00007fffefb14317
g_main_context_iterate_unlocked 0x00007fffefb14317
g_main_context_iteration 0x00007fffefb14930
QEventDispatcherGlib::processEvents 0x00007ffff6327d4a
QEventLoop::exec qflags.h:69
QCoreApplication::exec qflags.h:121
main main.cpp:776
__libc_start_call_main 0x00007ffff02456ca
__libc_start_main_impl 0x00007ffff0245785
_start 0x000055555577f441
AleziaKurdis commented 6 months ago

there is probably another issue for the playback. (if not the same)