Page MenuHome

Blender VSE with a Scene Strip Crash
Closed, ResolvedPublicBUG


System Information
Operating system: Linux-5.2.0-3-amd64-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce GTX 950/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.50

Blender Version
Broken: version: 2.81 (sub 15), branch: master, commit date: 2019-10-14 16:46, hash: rB879d269e8769
Worked: (optional)

Short description of error
Blender VSE with a Scene Strip Crash

Exact steps for others to reproduce the error
Please see the attach video. This method is necessary for compositor playback as well.

Blend File

Blender 2.81 (sub 15), Commit date: 2019-10-14 16:46, Hash 879d269e8769'NEW') # Operator = "Dummy" # Property = "Main" # Property
bpy.ops.sequencer.scene_strip_add(frame_start=1, channel=2, scene='Dummy') # Operator


./blender(BLI_system_backtrace+0x1d) [0x14ee17d]
./blender() [0x12cb799]
/lib/x86_64-linux-gnu/ [0x7f25e3ca1100]
./blender(AUD_SequenceEntry_setAnimationData+0x7) [0x4683ef7]
./blender(BKE_sound_set_scene_sound_volume+0x20) [0x142fb30]
./blender(BKE_scene_eval_sequencer_sequences+0xa7) [0x13fac67]
./blender() [0x150cadc]
./blender(BLI_task_pool_work_and_wait+0x159) [0x14ef109]
./blender(_ZN3DEG23deg_evaluate_on_refreshEPNS_9DepsgraphE+0x1eb) [0x150cdab]
./blender(DEG_evaluate_on_refresh+0x65) [0x14f6345]
./blender() [0x13f8a83]
./blender(wm_event_do_depsgraph+0xc3) [0x16a1943]
./blender(wm_event_do_refresh_wm_and_depsgraph+0x87) [0x16a1aa7]
./blender(wm_event_do_notifiers+0x472) [0x16a7612]
./blender(WM_main+0x28) [0x169d8b8]
./blender(main+0x2fe) [0x1237b9e]
/lib/x86_64-linux-gnu/ [0x7f25e3c8dbbb]
./blender() [0x12c80bc]

Event Timeline

Sergey Sharybin (sergey) lowered the priority of this task from 90 to 30.Oct 15 2019, 5:18 PM

Please always attach .blend file demonstrating the issue.

Hello, it's a fresh 2.81 scene with nothing attached or modified. Should I upload it? Thanks.

Blend files attached. Thank you for looking into this.

Philipp Oeser (lichtwerk) raised the priority of this task from 30 to 50.

Confirmed, will check...

Full crash report

@Jerome Scholler (jscholler) : cant see anything relating sound in your crash report...
Sure this is the right one? Sure this is the right report?

Oops, Sorry about this. I got confused.
Reposting under another report.

Since rBd025119aeb12: Fix T69352: Audio strips don't update when changing `frame_start`, we are asserting here

BLI_assert failed: /blender/blenkernel/intern/sound.c:88, sound_verify_evaluated_id(), at 'id->tag & (LIB_TAG_COPIED_ON_WRITE | LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_NO_MAIN)'

1  raise                                0x7ffff1ae6e35 
2  abort                                 0x7ffff1ad1895 
3  sound_verify_evaluated_id                       sound.c        88   0x2f4257d      
4  BKE_sound_set_scene_volume                      sound.c        679  0x2f4257d      
5  BKE_scene_eval_sequencer_sequences              scene.c        2293 0x2ef82f1      
6  std::__invoke_impl<void, void ( *&)(Depsgraph *, Scene *), Depsgraph *, Scene *&>                                                                                           invoke.h       60   0x30caaff      
7  std::__invoke<void ( *&)(Depsgraph *, Scene *), Depsgraph *, Scene *&>                                                                                                      invoke.h       95   0x30c904d      
8  std::_Bind<void ( *(std::_Placeholder<1>, Scene *))(Depsgraph *, Scene *)>::__call<void, Depsgraph *&&, 0ul, 1ul>(std::tuple<Depsgraph *&&>&&, std::_Index_tuple<0ul, 1ul>) functional     400  0x30c6ef1      
9  std::_Bind<void ( *(std::_Placeholder<1>, Scene *))(Depsgraph *, Scene *)>::operator()<Depsgraph *, void>(Depsgraph *&&)                                                    functional     484  0x30c4369      
10 std::_Function_handler<void (Depsgraph *), std::_Bind<void ( *(std::_Placeholder<1>, Scene *))(Depsgraph *, Scene *)>>::_M_invoke(std::_Any_data const&, Depsgraph *&&)     std_function.h 300  0x30c103d

We can get past sound_verify_evaluated_id (avoid the assert) by doing something like

3diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
4index c42cf91944e..94f7d3316d3 100644
5--- a/source/blender/makesrna/intern/rna_sequencer.c
6+++ b/source/blender/makesrna/intern/rna_sequencer.c
7@@ -129,6 +129,24 @@ static void rna_Sequence_invalidate_raw_update(Main *UNUSED(bmain),
8 }
9 }
11+static void rna_Sequence_scene_switch(Main *bmain, Scene *scene, PointerRNA *ptr)
13+ rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
15+ /* this avoids the assert */
16+ DEG_relations_tag_update(bmain);
18+ /* ignore all the following, this is just stabbing in the dark... */
19+ Editing *ed = BKE_sequencer_editing_get(scene, false);
20+ if (ed) {
21+ Sequence *seq = (Sequence *)ptr->data;
22+ if (seq->scene != NULL) {
23+ DEG_id_tag_update(&seq->scene->id, ID_RECALC_COPY_ON_WRITE | ID_RECALC_AUDIO);
24+ }
25+ }
26+ DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS | ID_RECALC_AUDIO);
29 static void rna_Sequence_invalidate_preprocessed_update(Main *UNUSED(bmain),
30 Scene *UNUSED(scene),
31 PointerRNA *ptr)
32@@ -2227,7 +2245,7 @@ static void rna_def_scene(BlenderRNA *brna)
33 prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
34 RNA_def_property_flag(prop, PROP_EDITABLE);
35 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
36- RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
37+ RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_scene_switch");
39 prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
40 RNA_def_property_flag(prop, PROP_EDITABLE);

But still, we are crashing a line later because seq->scene->sound_scene is NULL (seq->scene_sound is not NULL).
Of course, we can still get around that by doing something like

3diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
4index 6cbb01861e2..d42436ecb40 100644
5--- a/source/blender/blenkernel/intern/sound.c
6+++ b/source/blender/blenkernel/intern/sound.c
7@@ -677,6 +677,9 @@ void BKE_sound_set_cfra(int cfra)
8 void BKE_sound_set_scene_volume(Scene *scene, float volume)
9 {
10 sound_verify_evaluated_id(&scene->id);
11+ if (scene->sound_scene == NULL) {
12+ return;
13+ }
14 AUD_Sequence_setAnimationData(scene->sound_scene,
16 CFRA,

But really, someone with more knowledge of the relation between scene strips and audio should be looking at this...
@Sergey Sharybin (sergey), @Richard Antalik (ISS), interested?

If it helps:

In 2.8, I can make it work if I Save the project first, adding the dummy strip>Close the project > Open the project again and change the strip to main.

But in 2.81 it's now simply crashing.

@Philipp Oeser (lichtwerk) Honestly, I didn't looked on why crash happens, knowing that use-case is not supported.

As for relations, I am pretty lost there at this point.
Paste almost seems like it could fix T69444: VSE Linked external scene with audio with input Sequencer only works if the scene is NOT also linked with input Camera will look into that in a bit

@Philipp Oeser (lichtwerk) Honestly, I didn't looked on why crash happens, knowing that use-case is not supported.

@Richard Antalik (ISS): not sure why this should not be supported?
It is not supported setting scene to self, but switching to a different scene (other than self) should be supported, no?

! In T70845#796716, @Philipp Oeser (lichtwerk) wrote:
It is not supported setting scene to self, but switching to a different scene (other than self) should be supported, no?

Yes, that's what I meant.

This comment was removed by Robert Zhang (zhruith).

Well, we are now missing the auto render feature for Compositor render layer. Will it be possible to implement this auto render in the compositor render layer node?

The algo is>>

if the auto switch is on and user scrub in timeline the render layers will be updated just like all nodes in the compositor. Should be a bool, because it's only usable for animation.

If that could be done Blender compositor will be free of VSE dependency for good. We already have a way to cache the playback in image viewer.

@Fahad Hasan (cgvirus) if this fix breaks any fundamental workflow, I guess it should be reported as a bug explaining what is broken with reference to correct behavior and tag specific project.

@Philipp Oeser (lichtwerk) isn't this report technically fixed?
perhaps there should be some versioning code, so users can at least open affected files?

@Richard Antalik (ISS) What is gonna happen when someone opens 2.79 files with scene strips with the same scene? (currently crashes on render, and a lot of other crashes depending on the configuration it was saved in)
T52586: Disable scenes using themselves as sequence strips 2.8 Proposal hasn't really addressed a long term solution (well it has, just none have been implemented...).

A current issue I see is: a working .blend (from 2.79) with lots of scene strips using their own scene, gets opened up in 2.8x, gets saved, and that's it; an unusable file. No going back to 2.79...
One thing I am confused on though... Features and functionality, like this, don't get removed very often, and it's not clear from the task, so I'm curious as to what the support level is/can be?
Disable scenes using themselves as sequence strips got closed because it was implemented but the commit was clearly Disable adding scene sequence strips into themselves.
The task seems to be about disabling then out right, but the commit just disables the ability to add new scene strips to the project, it doesn't mess with stripes already in place and apart of a project's workflow...
So I'm not sure the fate of them (scene strips using their own scene and the entire workflow behind it) in newer versions of Blender...

This comment was removed by Fahad Hasan (cgvirus).

@Philipp Oeser (lichtwerk) isn't this report technically fixed?
perhaps there should be some versioning code, so users can at least open affected files?

No, afaict this is still crashing if you are switching the scene-strips scene to another scene [which should be supported].
(And this is because of the "depsgraph update as a part of cache invalidation" from rBd025119aeb12)

@Fahad Hasan (cgvirus), @Christopher_Anderssarian : we obviously dont want to remove features if there is no good reason for it, T52586: Disable scenes using themselves as sequence strips 2.8 Proposal listed some annoying issues that justify removal I think. Will wrap my head around your workflow though [have to check T52586, comments here and in D6073...], intuition would suggest to just use 2 scenes for this, but then this looks like there would be issues with Audio? [like I said, will check on this]

That being said, I think for this discusion we would need a different place? To me it seems this should take place in T52586 (unless I am mistaken)?

@Philipp Oeser (lichtwerk) It's a complete valid decision from VSE perspective. Rather than hacks, it's always better to have solid workflows. .
I will try to come up with some method too and if positive will discuss it here . Thanks for your time.

This comment was removed by Fahad Hasan (cgvirus).

We obviously don't want to remove features if there is no good reason for it.

Yeah, but unfortunately it not always as black and white (in terms of what a good reason is) [insert recent dramas of this happening here]...
When I see a commit message saying: "Remove X properties" with no reason; I just wish I could know what's going though their head when they hit submit...
I can understand if it's a mistake or a miscommunication, as that happens all the time, even here (you missed T66461 when titling 0dcc5572d6ab)
It's just a shame that I have a folder marked Do Not Report that's full things I can't report, else that piece of functionality would get removed.

@Philipp Oeser (lichtwerk) I have successfully hack the way out.
After seeing it with GDB it is more or less clear that the sound data is going nuts.

So I have created a Dummy scene>imported the Comp strip and made it a metastrip. Then in the comp scene Imported the Dummy strip and set it to show the sequencer instead of camera.
And all get line up.

Here's the line up if you guys need any help with it. For Now it's all OK. So Please, No need to worry.

Also The right Click select proposal has some serious fallback after testing. So it is deleted.

Thank you all for your time.

Fahad Hasan (cgvirus) changed the task status from Unknown Status to Resolved.Oct 18 2019, 2:57 AM
Fahad Hasan (cgvirus) claimed this task.
Richard Antalik (ISS) changed the task status from Resolved to Unknown Status.Oct 18 2019, 6:23 AM
Richard Antalik (ISS) raised the priority of this task from 50 to High.

There is still crash when changing scenes, so I am reopening this.