Playing sounds for movies is temperamental (4.14.0)

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Enjay
 
 
Posts: 26835
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Playing sounds for movies is temperamental (4.14.0)

Post by Enjay »

I suspect this isn't specific to 4.14.0, but that's the version I found this on.

I have just been messing around with GZDoom's ability to play movies. I converted an MP4 to IVF plus an OGG for the sound and set it up in MAPINFO & SNDINFO.

I have tried both having the movie at the start of an episode, and at the start of a map (the second is more useful to me).

In both cases, the visual element (the IVF) always plays. However, the sound sometimes plays, and sometimes doesn't. I can't figure out why. The files loaded each time are identical.

It is my impression that the sound plays more reliably at the start of an episode, but it seems that it fails most (all?) of the time if I bring up the menu and start the episode again. If I quit the game and restart, then the sound might play - but not always.

When I say "it fails" I mean that the video works, but there is no sound.

It seems that the sound playing at the start of a map is less likely than at the start of an episode - though it does still work sometimes.

I have even included the exact same definition for a movie as both an episode introduction before map01 and a map introduction for map02 and had the sound play for the episode, but then fail to play for the map.

Here's my mapinfo:

Code: Select all

episode MAP01 // Beginning of our episode block
{
name = "Test"
key = "T"

	Intro // Beginning of our cutscene block
	{
	Video = "movies/testmov.ivf"
	Sound = testsnd
	}
	
}

Code: Select all

map MAP02 lookup "HUSTR_2"
{
	Intro // Beginning of our cutscene block
	{
	Video = "movies/testmov.ivf"
	Sound = testsnd
	}
	titlepatch = "CWILV01"
	next = "MAP03"
	secretnext = "MAP03"
	sky1 = "SKY1"
	cluster = 5
	par = 90
	music = "$MUSIC_STALKS"
}
SNDINFO

Code: Select all

testsnd testsnd
It's all set up correctly because, like I said, sometimes it works. I can also play the sound using the console playsound command. However, success rate for getting the sound to play along with the movie (especially for a the start of a map, or a second start of the game from the menu) seems to be less than 50%. Video success is 100%.
User avatar
Chris
Posts: 2960
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Playing sounds for movies is temperamental (4.14.0)

Post by Chris »

Are any messages printed to GZDoom's console? Increasing the console log verbosity may possibly help show what it's doing and why it's not playing the audio track.

Are any other sounds playing when the movie starts? If so, is it a lot?
User avatar
Enjay
 
 
Posts: 26835
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Playing sounds for movies is temperamental (4.14.0)

Post by Enjay »

OK, I just started a game with developer mode set to 4 and captured the output in a log file. (What a lot of output there is!) Then, with a test file loaded, I fired up GZDoom and started a game from the menu. When the game started, the video played (complete with sound), as it should do, and then moved on to map01. Once map01 started, I opened the menu again and started a new game. This time, the video played, but the sound did not - which is obviously wrong, but it is what I expected to happen.

I'll paste the relevant section of the log below (I assume that there is no need to post hundreds of lines of actor setup etc). Of most interest, I suspect, is that for both starts of the game, the following line exists:

Code: Select all

Loading sound "testsnd" (509) 
That's the sound for the video. Like I said, it's there for both the initial game start, where the sound worked, and for the second one, where the sound didn't work.

Code: Select all

R_Init: Init Doom refresh subsystem.
DecalLibrary: Load decals.
M_Init: Init menus.
4430 symbols removed after compilation
P_Init: Init Playloop state.
ParseSBarInfo: Loading custom status bar definition.
D_CheckNetGame: Checking network game status.
player 1 of 1 (1 nodes)
Found compatible soundfont 1mgm.sf2
Loading sound "menu/activate" (491)
Loading sound "menu/choose" (498)
Loading sound "testsnd" (509)
Setting loop points 0 -> 1456128
16 bots read from bots.cfg

----------------------------------------

MAP01 - Entryway

Found compatible soundfont 1mgm.sf2
Found compatible soundfont 1mgm.sf2
MD5 = 3C9902E376CCA1E9C3BE8763BDC21DF5
BSP generation took 0.004 sec (1041 segs)
Not caching nodes (time = 0.004000)
Starting all scripts of type 4 (Enter)
Starting all scripts of type 1 (Open)
Loading sound "misc/i_pkup" (9)
Loading sound "player"0"*death" (226)
Loading sound "player"0"*xdeath" (228)
Loading sound "player"0"*gibbed" (230)
Loading sound "player"0"*pain100" (231)
Loading sound "player"0"*grunt" (233)
Loading sound "player"0"*fist" (238)
Loading sound "player"0"*usefail" (239)
Loading sound "weapons/sawup" (310)
Loading sound "weapons/sawidle" (311)
Loading sound "grunt/sight1" (335)
Loading sound "grunt/sight2" (336)
Loading sound "grunt/sight3" (337)
Loading sound "grunt/death1" (339)
Loading sound "grunt/death2" (340)
Loading sound "grunt/death3" (341)
Loading sound "grunt/active" (342)
Loading sound "grunt/pain" (343)
Linked grunt/attack to menu/choose (498)
Loading sound "imp/sight1" (392)
Loading sound "imp/sight2" (393)
Loading sound "imp/death1" (395)
Loading sound "imp/death2" (396)
Loading sound "imp/active" (397)
Linked imp/pain to grunt/pain (343)
Loading sound "misc/teleport" (469)
Loading sound "misc/secret" (482)
Setting loop points 0 -> 22491
Loading sound "misc/w_pkup" (483)
Unloaded sound "menu/activate" (491)
Unloaded sound "menu/choose" (498)
Unloaded sound "testsnd" (509)
Reverb Environment Off
Loading sound "menu/activate" (491)
Loading sound "menu/choose" (498)
Loading sound "testsnd" (509)
Setting loop points 0 -> 1456128

----------------------------------------

MAP01 - Entryway

Found compatible soundfont 1mgm.sf2
MD5 = 3C9902E376CCA1E9C3BE8763BDC21DF5
BSP generation took 0.003 sec (1041 segs)
Not caching nodes (time = 0.003000)
Starting all scripts of type 4 (Enter)
Starting all scripts of type 1 (Open)
Unloaded sound "menu/activate" (491)
Unloaded sound "testsnd" (509)
Loading sound "menu/activate" (491)
Loading sound "menu/cursor" (494)
Loading sound "vile/active" (357)
Unloaded sound "misc/i_pkup" (9)
Unloaded sound "player"0"*death" (226)
Unloaded sound "player"0"*xdeath" (228)
Unloaded sound "player"0"*gibbed" (230)
Unloaded sound "player"0"*pain100" (231)
Unloaded sound "player"0"*grunt" (233)
Unloaded sound "player"0"*fist" (238)
Unloaded sound "player"0"*usefail" (239)
Unloaded sound "weapons/sawup" (310)
Unloaded sound "weapons/sawidle" (311)
Unloaded sound "grunt/sight1" (335)
Unloaded sound "grunt/sight2" (336)
Unloaded sound "grunt/sight3" (337)
Unloaded sound "grunt/death1" (339)
Unloaded sound "grunt/death2" (340)
Unloaded sound "grunt/death3" (341)
Unloaded sound "grunt/active" (342)
Unloaded sound "grunt/pain" (343)
Unloaded sound "vile/active" (357)
Unloaded sound "imp/sight1" (392)
Unloaded sound "imp/sight2" (393)
Unloaded sound "imp/death1" (395)
Unloaded sound "imp/death2" (396)
Unloaded sound "imp/active" (397)
Unloaded sound "misc/teleport" (469)
Unloaded sound "misc/secret" (482)
Unloaded sound "misc/w_pkup" (483)
Unloaded sound "menu/activate" (491)
Unloaded sound "menu/cursor" (494)
Unloaded sound "menu/choose" (498)
As for what other sounds are going on at the time: very little. Both instances that I have set up happen at the start of a either a game or a map. So, the video either follows the titlepic and menu, or the intermission screen.

FWiW, just in "trying random things that might work" mode, I swapped the ogg for a wav. This did not change the behaviour.
User avatar
Enjay
 
 
Posts: 26835
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Playing sounds for movies is temperamental (4.14.0)

Post by Enjay »

OK, perhaps a little progress.

It really seems to be a problem if you try to play the video a second time.

Rather than start the game normally, I warped to another map from the command line to bypass the opening video.
Then, using the console, I typed map map01. Again, this was to bypass the video.

I went to the exit room, hit the switch and was taken to the video (which is also set to play at the start of map02) and it worked, complete with sound.

After establishing that this worked, I tried two separate tests (on two separate instances of GZDoom):

After seeing/hearing the video at the start of map02, I started a new game from the menu and the video was silent.

After seeing/hearing the video at the start of map02, I went back to map01 (map map01), went to the exit room, hit the switch and - the video played with no sound.


So, after trying several different ways (not just those above), I am usually (though not always) able to get sound for the video the first time that it plays. However, if I try to get the video to play a second time, even at different places in game, then the sound does not play.


Then, as a final test, I set one video (and sound) to play on game start, and a different video (and sound) to play at the start of map02.
Both worked properly.


So, it seems to be something to do with the video sound being played a second time during a game session.


In case it helps, here's a very a small, simple test file that shows the problem. If it behaves the same for you, you should be able to load it up, start a new game from the titlepic/menu, see (and hear) the video and then move to map01. Then, if you start game from the menu (without restarting GZDoom) you will only see the video and not hear the sound.

Yay! 90s cartoons, or something.
https://aspectsweb.co.uk/enjay/doom/Tes ... eoTest.pk3
User avatar
Enjay
 
 
Posts: 26835
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Playing sounds for movies is temperamental (4.14.0)

Post by Enjay »

OK, interesting additional information. I set up two different videos - one to play at the start of the game, the other to play at the start of map02. (i.e. much as I have done with the other tests.)

However, this time I set the two different videos to play the same sound as each other.

My guess was that, because this was asking GZDoom to play the exact same sound a second time - in a similar way to that which had failed before - the sound would not play on entering map02.

However, that was not the case: the sound played along with both videos (and I have been able to get the same result a few times).

So, despite it normally being the sound file that fails to play a second time, it does somehow seem to be that the video file is also involved in this problem because, when being asked to play the exact same sound entry a second time, but accompanying a different video, it worked!


And here's even weirder. If I start a game, hear/see the video before map01, then start a new game from the menu, the video plays without sound (as previously described), but on progressing to map02, I see the second video, and the sound plays just fine - despite the fact that it has now failed to play on the earlier video.

Moreover, even though I have already heard the sound play at the start of map02, I seem to be able to start a game again (using the menu, not restarting GZDoom). As expected, the pre-map01 video is silent but when I progress to map02 (at last, every time I have tried so far) the sound plays, even though it was already silenced at the start of the game, and it had already played at the start of map02 once as well.

So, yeah, it's very strange. Certainly, trying to get the same sound to play twice seems to be a problem but, under certain circumstances, it seems to be possible to get it to play - just not in particularly useful circumstances.
User avatar
Enjay
 
 
Posts: 26835
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Playing sounds for movies is temperamental (4.14.0)

Post by Enjay »

Perhaps it isn't quite as straight forward as I thought. Here's another small test file:

https://aspectsweb.co.uk/enjay/doom/Tes ... &S_P&B.pk3

It has one video+sound set up to play on starting a game and a different video+sound set up to play at the start of map02.

I have observed the following:

With the file loaded, the first video+sound plays on starting a game from the menu.
If I then start a new game from the menu (without quitting GZDoom), the video plays, but the sound does not. (As previously reported.)

If I start a game from scratch, the first video+sound plays. If I then progress to the exit room of map01 and go to map02, the second video plays, but the sound sometimes does not. So far, it has worked properly twice, and failed seven times.

If I warp to map01 from the command line, complete map01 and go to map02 - so far the video has always played, but the sound has not.

If I warp to map01 from the command line, then call up the menu and start a new game, watch the silent video, play map01 to the end and then progress to map02 - the next video plays. It sometimes has sound, and sometimes doesn't.

So, basically, I don't know what the "rules" are.


Edit:
as an additional thing - using the following in MAPINFO:

Code: Select all

gameinfo 
{ 
	Intro
	{
	Video = "movies/RS_SLM.ivf"
	Sound = RS_SLM
	}
} 
Should, I think, get the video to play before the TITLEPIC. Certainly, the visuals appear but - once again - the sound does not play.

Return to “Bugs [GZDoom]”