Page MenuHome

Rendering crashes when synced to JACK Transport
Closed, ResolvedPublic

Description

I guess the JACK transport influence on the playhead is messing up with the rendering process.

I tried rendering out form the Sequencer and the playhead was jumping around the timeline randomly for a few seconds, and after that Blender crashed.

Here's the crash.txt file generated by Blender:

# Blender 2.78 (sub 4), Commit date: 2016-12-12 14:56, Hash 5f852a4
Read library:  '/data/Projects/PVC Factory/The PVC Factory Story/Production/Assets/Wyspa/Wyspa 24.blend', '//../Assets/Wyspa/Wyspa 24.blend', parent '<direct>'  # Info
Read library:  '/data/Projects/PVC Factory/The PVC Factory Story/Production/Assets/Wyspa/Wyspa 25.blend', '//../Assets/Wyspa/Wyspa 25.blend', parent '<direct>'  # Info
bpy.context.scene.render.filepath = "//"  # Property
bpy.ops.script.python_file_run(filepath="/data/Applications/Blender/blender-2.78-5f852a4-linux-glibc219-x86_64/2.78/scripts/presets/framerate/24.py")  # Operator
bpy.ops.sequencer.select(extend=False, linked_handle=False, left_right='NONE', linked_time=False)  # Operator
bpy.context.scene.sequence_editor.sequences_all["Click.wav"].mute = False  # Property
bpy.ops.sequencer.view_all()  # Operator
bpy.ops.script.python_file_run(filepath="/data/Applications/Blender/blender-2.78-5f852a4-linux-glibc219-x86_64/2.78/scripts/presets/framerate/30.py")  # Operator

# backtrace
blender2(BLI_system_backtrace+0x1d) [0x19b4e6d]
blender2() [0x1051719]
/lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7fb3bc0474b0]
blender2(_ZNSt8_Rb_treeIPvS0_St9_IdentityIS0_ESt4lessIS0_ESaIS0_EE8_M_eraseEPSt13_Rb_tree_nodeIS0_E+0x10) [0x1e4f3d0]
blender2(_ZNSt8_Rb_treeIPvS0_St9_IdentityIS0_ESt4lessIS0_ESaIS0_EE8_M_eraseEPSt13_Rb_tree_nodeIS0_E+0x1c) [0x1e4f3dc]
blender2(_ZNSt8_Rb_treeIPvS0_St9_IdentityIS0_ESt4lessIS0_ESaIS0_EE8_M_eraseEPSt13_Rb_tree_nodeIS0_E+0x1c) [0x1e4f3dc]
blender2(AUD_destroySet+0x12) [0x1e4f202]
blender2(BKE_sound_update_scene+0x3bf) [0x17e7c9f]
blender2(BKE_scene_update_for_newframe_ex+0x2e9) [0x17bc6c9]
blender2(RE_BlenderAnim+0x29b) [0x13d3f2b]
blender2() [0x1315ac9]
blender2() [0x106128a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x770a) [0x7fb3bd62370a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fb3bc11882d]

Event Timeline

Bastien Montagne (mont29) triaged this task as Normal priority.Dec 16 2016, 7:08 PM

@Joerg Mueller (nexyon) Think this one falls in your area, mind checking it? Thanks. :)

So yeah this is happening. I managed to fix the bug by preventing the sound system to change the current frame (cfra) and start/stop playback while rendering in an ugly way (if WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)). The problem atm. is that I can only do these tests in the user interface, but not in sound.c of blenkernel, so if playback is started via jack transport while rendering, sound starts playing in blender and you don't have a way to stop it at the moment, ideally it would be completely ignored during rendering. To fix this I have to find a way in sound.c to find out whether blender is rendering right now (having access to a Main*). Can you help me with that @Bastien Montagne (mont29)?

@Joerg Mueller (nexyon) quick and dirty fix would simply be getting main from global (G.main, and including "BKE_global.h" if not yet done), though not ideal…

Ideal solution would be to add a Main * parameter to chain of calls leading to the point where you need it, not sure if that solution is doable though?

Fixing this with a workaround by disabling JACK Transport functionality during rendering. Thanks @Bastien Montagne (mont29) for the help on IRC. A proper solution would be blender supporting animation playback during rendering, but I guess we are far away from that. ;-)