[GH-ISSUE #2034] [GAME BUG]: Bloodborne crashes when playing certain cutscenes #702

Closed
opened 2026-02-27 21:07:41 +03:00 by kerem · 20 comments
Owner

Originally created by @brad0demx on GitHub (Jan 3, 2025).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/2034

Checklist (we expect you to perform these steps before opening the issue)

  • I have searched for a similar issue in this repository and did not find one.
  • I am using an official build obtained from releases or updated one of those builds using its in-app updater.
  • I have re-dumped the game and performed a clean install without mods and the issue is still present.
  • I have disabled all patches and cheats and the issue is still present.
  • I have all the required system modules installed.

Describe the Bug

When creating a new character, some hardware experiences consistent crashing using any build on main branch sicne commit 48c51bd. I say "some hardware" as with my testing, this crash has been 100% consistent. However Missake and Rainmaker don't seem to have the same consistency in their tests.
In my testing, this crash doesn't occur on Linux.

Reproduction Steps

Main branch from 48c51bd to 345d556
(Latest at time of writing) and clicking new save. Crash occurs as the cut scene begins.

Specify OS Version

Windows 11

CPU

5600X

GPU

NVIDIA 2080 SUPER

Amount of RAM in GB

32GB

Amount of VRAM in GB

8GB

Logs

shad_log(1).txt

Originally created by @brad0demx on GitHub (Jan 3, 2025). Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/2034 ### Checklist (we expect you to perform these steps before opening the issue) - [X] I have searched for a similar issue in this repository and did not find one. - [X] I am using an official build obtained from [releases](https://github.com/shadps4-emu/shadPS4/releases) or updated one of those builds using its in-app updater. - [X] I have re-dumped the game and performed a clean install without mods and the issue is still present. - [X] I have disabled all patches and cheats and the issue is still present. - [X] I have all the required [system modules](https://github.com/shadps4-emu/shadps4-game-compatibility?tab=readme-ov-file#informations) installed. ### Describe the Bug When creating a new character, some hardware experiences consistent crashing using any build on main branch sicne commit [48c51bd](https://github.com/shadps4-emu/shadPS4/actions/runs/12558588863). I say "some hardware" as with my testing, this crash has been 100% consistent. However Missake and Rainmaker don't seem to have the same consistency in their tests. In my testing, this crash doesn't occur on Linux. ### Reproduction Steps Main branch from [48c51bd](https://github.com/shadps4-emu/shadPS4/actions/runs/12558588863) to [345d556 ](https://github.com/shadps4-emu/shadPS4/actions/runs/12589643243) (Latest at time of writing) and clicking new save. Crash occurs as the cut scene begins. ### Specify OS Version Windows 11 ### CPU 5600X ### GPU NVIDIA 2080 SUPER ### Amount of RAM in GB 32GB ### Amount of VRAM in GB 8GB ### Logs [shad_log(1).txt](https://github.com/user-attachments/files/18302809/shad_log.1.txt)
kerem closed this issue 2026-02-27 21:07:41 +03:00
Author
Owner

@hspir404 commented on GitHub (Jan 3, 2025):

Fairly consistent crashes as soon as I open the FMV. I am seeing a variety of stack traces, but mostly all resolving down to some variation of null pointer dereference in locking code or thread local storage, as well as being related to SDL audio.

Ryzen 5950x, 3080 10GB VRAM, 64GB RAM, Windows 10.

I did a git bisect, and this commit seemed to be the start of this problem for me: 48c51bd9ef

<!-- gh-comment-id:2569687019 --> @hspir404 commented on GitHub (Jan 3, 2025): Fairly consistent crashes as soon as I open the FMV. I am seeing a variety of stack traces, but mostly all resolving down to some variation of null pointer dereference in locking code or thread local storage, as well as being related to SDL audio. Ryzen 5950x, 3080 10GB VRAM, 64GB RAM, Windows 10. I did a git bisect, and this commit seemed to be the start of this problem for me: 48c51bd9eff0dc94e84d7b75afb98f8f02a28832
Author
Owner

@Missake212 commented on GitHub (Jan 3, 2025):

I get a lot of crashes on character creation on these new builds but they're not 100% consistent, I also noticed the audio crackling a bit recently on BB.

13900k, 4090, 32Gb RAM, Windows 11 24h2

shad_log.txt

<!-- gh-comment-id:2569689836 --> @Missake212 commented on GitHub (Jan 3, 2025): I get a lot of crashes on character creation on these new builds but they're not 100% consistent, I also noticed the audio crackling a bit recently on BB. 13900k, 4090, 32Gb RAM, Windows 11 24h2 [shad_log.txt](https://github.com/user-attachments/files/18302850/shad_log.txt)
Author
Owner

@MouseManSpecOps commented on GitHub (Jan 4, 2025):

From what others have said on this forum, Nvidia graphic cards do not gel well with ShadPS4 at the moment. I'm still trying to figure out what can be done to get me to play beyond Character Creation.

<!-- gh-comment-id:2570031077 --> @MouseManSpecOps commented on GitHub (Jan 4, 2025): From what others have said on this forum, Nvidia graphic cards do not gel well with ShadPS4 at the moment. I'm still trying to figure out what can be done to get me to play beyond Character Creation.
Author
Owner

@GHU7924 commented on GitHub (Jan 6, 2025):

Apparently the error is "floating?", there were these last lines in the log:

[Lib.AvPlayer] avplayer_source.cpp:EnableStream:221: Audio stream 2 enabled
[Lib.AvPlayer] avplayer_source.cpp:GetStreamInfo:113: Stream 3 language = und
[Lib.AvPlayer] avplayer_source.cpp:GetStreamInfo:137: Stream 3 is an audio stream.
[Lib.AvPlayer] avplayer_source.cpp:GetStreamInfo:113: Stream 4 language = und
[Lib.AvPlayer] avplayer_source.cpp:GetStreamInfo:

or

[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue bac

or

[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (66560 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (77312 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (66560 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (74240 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (74240 queued, 65536 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AvPlayer] avplayer_source.cpp:DemuxerThread:463: EOF reached in demuxer. Exiting.
[Lib.AvPlayer] avplayer_source.cpp:AudioDecoderThread:779: Audio Decoder Thread exited normally
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (66560 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.
[Lib.AudioOut] sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing.

All this happens only in the first video, then everything is fine.
In the latter case, there was a black screen and a broken sound.

<!-- gh-comment-id:2572754514 --> @GHU7924 commented on GitHub (Jan 6, 2025): Apparently the error is "floating?", there were these last lines in the log: >[Lib.AvPlayer] <Info> avplayer_source.cpp:EnableStream:221: Audio stream 2 enabled [Lib.AvPlayer] <Info> avplayer_source.cpp:GetStreamInfo:113: Stream 3 language = und [Lib.AvPlayer] <Info> avplayer_source.cpp:GetStreamInfo:137: Stream 3 is an audio stream. [Lib.AvPlayer] <Info> avplayer_source.cpp:GetStreamInfo:113: Stream 4 language = und [Lib.AvPlayer] <Info> avplayer_source.cpp:GetStreamInfo: or >[Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue bac or >[Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (66560 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (77312 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (66560 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (74240 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (74240 queued, 65536 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AvPlayer] <Info> avplayer_source.cpp:DemuxerThread:463: EOF reached in demuxer. Exiting. [Lib.AvPlayer] <Info> avplayer_source.cpp:AudioDecoderThread:779: Audio Decoder Thread exited normally [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (66560 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. [Lib.AudioOut] <Warning> sdl_audio.cpp:Output:64: SDL audio queue backed up (65536 queued, 61440 threshold), clearing. All this happens only in the first video, then everything is fine. In the latter case, there was a black screen and a broken sound.
Author
Owner

@Masterno25 commented on GitHub (Jan 8, 2025):

I always crash after doing the basic settings in the main screen, however I did manage to make it past this a single time and I had a black screen with a weird sound.

i7-9700k, 2070 SUPER, 32GB Ram, AtlasOS 0.3.2
on 39cbfed
And from my testing, I pretty much always get the same last lines in the log files as the person above me

shad_log.txt
shad_log.txt

<!-- gh-comment-id:2578777968 --> @Masterno25 commented on GitHub (Jan 8, 2025): I always crash after doing the basic settings in the main screen, however I did manage to make it past this a single time and I had a black screen with a weird sound. i7-9700k, 2070 SUPER, 32GB Ram, AtlasOS 0.3.2 on 39cbfed And from my testing, I pretty much always get the same last lines in the log files as the person above me [shad_log.txt](https://github.com/user-attachments/files/18353619/shad_log.txt) [shad_log.txt](https://github.com/user-attachments/files/18353664/shad_log.txt)
Author
Owner

@brad0demx commented on GitHub (Jan 8, 2025):

Those logs, and that commit you referenced are both from unofficial forks. Please test again on latest main 65f9bbb .
Kind of weird you get the crash on Linux, with my testing I didnt experience it on there at all

<!-- gh-comment-id:2578811384 --> @brad0demx commented on GitHub (Jan 8, 2025): Those logs, and that commit you referenced are both from unofficial forks. Please test again on latest main [65f9bbb](https://github.com/shadps4-emu/shadPS4/commit/65f9bbbfed83cc6504332012681bcda0874e7268) . Kind of weird you get the crash on Linux, with my testing I didnt experience it on there at all
Author
Owner

@Missake212 commented on GitHub (Jan 12, 2025):

After some more digging it looks like the crashes happen during certain cutscenes, and all of those cutscenes are in the same folder (the movie folder in the game files, also all those cutscenes are .mp4 instead of the regular .dcx for the cutscenes in the remo folder). There's 4 of them, one plays when you're afk on the main menu, one when you start a new game and two are credits that show up for the game and the DLC, I've tried them all and they all can cause this crash, also for some reason it seems like you're more prone to crash when downloading a new build rather than using one you've updated (this could be rng tbh). Here are some logs (tho they don't show a clear critical crash, you can notice Lib.avplayer appears before all those crashes) of the cutscene you get when afk on menu and the credit one:
CRASH BB INTRO shad_log.txt
CRASH BB CREDITS shad_log.txt

<!-- gh-comment-id:2585724945 --> @Missake212 commented on GitHub (Jan 12, 2025): After some more digging it looks like the crashes happen during certain cutscenes, and all of those cutscenes are in the same folder (the movie folder in the game files, also all those cutscenes are .mp4 instead of the regular .dcx for the cutscenes in the remo folder). There's 4 of them, one plays when you're afk on the main menu, one when you start a new game and two are credits that show up for the game and the DLC, I've tried them all and they all can cause this crash, also for some reason it seems like you're more prone to crash when downloading a new build rather than using one you've updated (this could be rng tbh). Here are some logs (tho they don't show a clear critical crash, you can notice Lib.avplayer appears before all those crashes) of the cutscene you get when afk on menu and the credit one: [CRASH BB INTRO shad_log.txt](https://github.com/user-attachments/files/18389441/CRASH.BB.INTRO.shad_log.txt) [CRASH BB CREDITS shad_log.txt](https://github.com/user-attachments/files/18389442/CRASH.BB.CREDITS.shad_log.txt)
Author
Owner

@C4RTYP4NTS commented on GitHub (Jan 13, 2025):

Take this fix with a grain of salt BUT Try putting in a save file in. Not 100% sure but I got my brother's Bloodborne working so far (or at least past the starting cutscene and character screens. You can save files on Nexus mods I will put them down below. For my brother, I had to take the save file I had going on my working bloodborne and copy and paste mine on his. I was lucky and didn't encounter any issues so I could get past the screens easily. I will also put a save file in if you wanna go for it. brand new run bttw so no progress. Just a few more levels put into strength.

All Class Save Files (TRIED) only tried male file btw so female file might work
https://www.nexusmods.com/bloodborne/mods/190

Bloodborne NG Plus Save (Encrypted and Decrypted) get decrypted for ShadPS4 (TRIED) NEW GAME FILE KNOW
https://www.nexusmods.com/bloodborne/mods/26

Save file after character creator (didn't TRY)
https://www.nexusmods.com/bloodborne/mods/95

My save file if none of those worked. This would be for version 1.0.9 (WORKED FOR ME)
Savefile Bloodborne.zip

Anyway**, I tried a couple of saves and it said his version was unsupported**. His Game is on version 1.0.9 same as mine so I just yoinked my save file on my PC and put it on his and it worked perfectly for the 30 seconds I saw. As soon as it was working I wanted to write this to see if I could help anyone. It has been at least half an hour and his game is still running good in the room. Sorry don't know names haven't played a lot of Bloodborne.

Real Quick how to get to ur userdatafile!
shadps4-win64-qt-0.5.0\user\savedata\1*CUSA00900*### SPRJ0005

Go into the file that corresponds ur Bloodborne (for me the text in the bold may be the same may be different) one you navigate to the file that has your userdata1-10 files and stuff just copy the save file YOU installed on the website or from me and PASTE all of the files into that last file over there in the bold and hopefully slightly bigger. Start up the game and pray. If you won't pray I will pray for you. Goodluck!!! Also I do not endorse installing random files from some random github user I just wanna try to help anyone willing to take that risk.

sorry if this looks rushed cause it very much is. sorry sorry wish u luck and I'm praying for yall.

<!-- gh-comment-id:2586184616 --> @C4RTYP4NTS commented on GitHub (Jan 13, 2025): **Take this fix with a grain of salt BUT** Try putting in a save file in. Not 100% sure but I got my brother's Bloodborne working so far (or at least past the starting **cutscene** and **character** screens. You can save files on Nexus mods I will put them down below. For my brother, I had to take the save file I had going on my working bloodborne and copy and paste mine on his. I was lucky and didn't encounter any issues so I could get past the screens easily. I will also put a save file in if you wanna go for it. brand new run bttw so no progress. Just a few more levels put into strength. **All Class Save Files** **(TRIED)** only tried male file btw so female file might work https://www.nexusmods.com/bloodborne/mods/190 Bloodborne **NG Plus Save** (Encrypted and **Decrypted**) get decrypted for ShadPS4 **(TRIED)** NEW GAME FILE KNOW https://www.nexusmods.com/bloodborne/mods/26 **Save file after character creator** (**didn't TRY**) https://www.nexusmods.com/bloodborne/mods/95 **My save file if none of those worked. This would be for version 1.0.9** **(WORKED FOR ME)** [Savefile Bloodborne.zip](https://github.com/user-attachments/files/18392757/Savefile.Bloodborne.zip) Anyway**, I tried a couple of saves and it said his version was unsupported**. His Game is on **version 1.0.9 same as mine** so I just **yoinked my save file on my PC and put it on his** and it **worked perfectly** for the 30 seconds I saw. As soon as it was working I wanted to write this to see if I could help anyone. It has been at least half an hour and his game is still running good in the room. Sorry don't know names haven't played a lot of Bloodborne. **Real Quick how to get to ur userdatafile!** shadps4-win64-qt-0.5.0\user\savedata\1\**CUSA00900**\### **SPRJ0005** Go into the file that corresponds ur Bloodborne (for me the text in the **bold** may be the same may be different) one you navigate to the file that has your userdata1-10 files and stuff just copy the save file YOU installed on the website or from me and PASTE all of the files into that last file over there in the bold and hopefully slightly bigger. Start up the game and pray. If you won't pray I will pray for you. Goodluck!!! Also I do not endorse installing random files from some random github user I just wanna try to help anyone willing to take that risk. sorry if this looks rushed cause it very much is. sorry sorry wish u luck and I'm praying for yall.
Author
Owner

@brad0demx commented on GitHub (Jan 13, 2025):

That isn't a fix, that is a workaround for one aspect of the issue. Using other save files skips past the starter cutscene to avoid that crash, but doesn't account for Missake's discovery that the crash occurs on other cutscenes in the game. This issue was made to be added to the Aggregate Issue, so that people could verify the status of the problem, and that it is known until it's properly fixed by the developers

<!-- gh-comment-id:2586269634 --> @brad0demx commented on GitHub (Jan 13, 2025): That isn't a fix, that is a workaround for one aspect of the issue. Using other save files skips past the starter cutscene to avoid that crash, but doesn't account for Missake's discovery that the crash occurs on other cutscenes in the game. This issue was made to be added to the [Aggregate Issue](https://github.com/shadps4-emu/shadPS4/issues/1641), so that people could verify the status of the problem, and that it is known until it's properly fixed by the developers
Author
Owner

@Missake212 commented on GitHub (Jan 14, 2025):

Running Bloodborne through the intro cutscene after pressing new game shows this on VS, can't do much more than that though currently as I don't really know how to debug.
image

<!-- gh-comment-id:2590319241 --> @Missake212 commented on GitHub (Jan 14, 2025): Running Bloodborne through the intro cutscene after pressing new game shows this on VS, can't do much more than that though currently as I don't really know how to debug. ![image](https://github.com/user-attachments/assets/be24195c-b893-4b5b-8a2c-88ceb1dd153e)
Author
Owner

@StevenMiller123 commented on GitHub (Jan 14, 2025):

Given that the regression came from https://github.com/shadps4-emu/shadPS4/pull/1986 (based on brad's original post), it makes sense that it's an exception in audio code.
@squidbus any thoughts?

<!-- gh-comment-id:2590510194 --> @StevenMiller123 commented on GitHub (Jan 14, 2025): Given that the regression came from https://github.com/shadps4-emu/shadPS4/pull/1986 (based on brad's original post), it makes sense that it's an exception in audio code. @squidbus any thoughts?
Author
Owner

@hspir404 commented on GitHub (Jan 22, 2025):

@squidbus
I believe this is due to what looks like an upstream bug in SDL3.

The audio device creates a work buffer large enough to fit sample_frames count of frames, but only allocates enough for 2 channels. The math for this is inside SDL_UpdatedAudioDeviceFormat.

When the FMV is doing audio conversion, it looks like it's coming from an 8 channel source. So it copies data from the source buffer to the work buffer, doing gain adjustment, and tries to copy enough frames to fill the device's sample_frames value, but is doing it for 8 channels instead of 2. The math for this (and the buffer overrun) is in SDL_audiocvt.c::ConvertAudio, at line 332.

I figured this out by doing a local build in RelWithDebInfo enabled, running the emulator from the gflags.exe program (which comes with WinDbg), with Enable page heap set, which makes it easier to detect heap corruption. Just launch a new game to trigger the cutscene, and it breaks on ConvertAudio line 332 every time.

There was also another buffer related bug (that seems possibly less serious, due to it being a read access violation instead of write) that I worked around to get to the point of being able to debug this. It is in the LibAtrac9 library. I think that should probably be considered a separate ticket.

Edit: I did a hack in SDL_UpdatedAudioDeviceFormat to multiply the buffer size by 4, and I am no longer getting the crash when the FMV starts. I am still getting a crash when launching the character creator, but I believe that's a separate problem (even though it occurs immediately after the other problem). I don't think that hacking in a larger working buffer is necessarily the right solution, but it does seem to validate that there's a fix in this area.

<!-- gh-comment-id:2606456212 --> @hspir404 commented on GitHub (Jan 22, 2025): @squidbus I believe this is due to what looks like an upstream bug in SDL3. The audio device creates a work buffer large enough to fit `sample_frames` count of frames, but only allocates enough for 2 channels. The math for this is inside `SDL_UpdatedAudioDeviceFormat`. When the FMV is doing audio conversion, it looks like it's coming from an 8 channel source. So it copies data from the source buffer to the work buffer, doing gain adjustment, and tries to copy enough frames to fill the device's `sample_frames` value, but is doing it for 8 channels instead of 2. The math for this (and the buffer overrun) is in `SDL_audiocvt.c::ConvertAudio`, at line 332. I figured this out by doing a local build in `RelWithDebInfo` enabled, running the emulator from the `gflags.exe` program ([which comes with WinDbg](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags)), with [`Enable page heap`](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/enable-page-heap) set, which makes it easier to detect heap corruption. Just launch a new game to trigger the cutscene, and it breaks on `ConvertAudio` line 332 every time. There was also another buffer related bug (that seems possibly less serious, due to it being a read access violation instead of write) that I worked around to get to the point of being able to debug this. It is in the `LibAtrac9` library. I think that should probably be considered a separate ticket. Edit: I did a hack in `SDL_UpdatedAudioDeviceFormat` to multiply the buffer size by 4, and I am no longer getting the crash when the FMV starts. I am still getting a crash when launching the character creator, but I believe that's a separate problem (even though it occurs immediately after the other problem). I don't think that hacking in a larger working buffer is necessarily the right solution, but it does seem to validate that there's a fix in this area.
Author
Owner

@squidbus commented on GitHub (Jan 22, 2025):

@hspir404 Could you report your findings upstream to the SDL devs? Regarding the buffer being only 2 channels wide, I don't think this is necessarily incorrect as the audio stream is supposed to be mixed down to output to the audio device, to my understanding. But it seems for some reason that isn't happening here going by your account.

<!-- gh-comment-id:2606909673 --> @squidbus commented on GitHub (Jan 22, 2025): @hspir404 Could you report your findings upstream to the SDL devs? Regarding the buffer being only 2 channels wide, I don't think this is necessarily incorrect as the audio stream is supposed to be mixed down to output to the audio device, to my understanding. But it seems for some reason that isn't happening here going by your account.
Author
Owner

@hspir404 commented on GitHub (Jan 23, 2025):

PR submitted upstream

<!-- gh-comment-id:2609477366 --> @hspir404 commented on GitHub (Jan 23, 2025): PR submitted upstream
Author
Owner

@hspir404 commented on GitHub (Jan 23, 2025):

@squidbus PR merged upstream: https://github.com/libsdl-org/SDL/pull/12064

<!-- gh-comment-id:2611037027 --> @hspir404 commented on GitHub (Jan 23, 2025): @squidbus PR merged upstream: https://github.com/libsdl-org/SDL/pull/12064
Author
Owner

@lmutig commented on GitHub (Jan 24, 2025):

PR 合并上游:libsdl-org/SDL#12064

After #2221, Lawrence's 60-frame cutscene still collapsed.

<!-- gh-comment-id:2612701301 --> @lmutig commented on GitHub (Jan 24, 2025): > PR 合并上游:[libsdl-org/SDL#12064](https://github.com/libsdl-org/SDL/pull/12064) After #2221, Lawrence's 60-frame cutscene still collapsed.
Author
Owner

@Missake212 commented on GitHub (Jan 24, 2025):

PR 合并上游:libsdl-org/SDL#12064

After #2221, Lawrence's 60-frame cutscene still collapsed.

This doesn't fix the crashes on bosses cutscenes that are in the Remo folder, but the cutscenes that are in the Movie folder.

<!-- gh-comment-id:2612711846 --> @Missake212 commented on GitHub (Jan 24, 2025): > > PR 合并上游:[libsdl-org/SDL#12064](https://github.com/libsdl-org/SDL/pull/12064) > > After [#2221](https://github.com/shadps4-emu/shadPS4/pull/2221), Lawrence's 60-frame cutscene still collapsed. This doesn't fix the crashes on bosses cutscenes that are in the Remo folder, but the cutscenes that are in the Movie folder.
Author
Owner

@lmutig commented on GitHub (Jan 24, 2025):

PR 合并上游:libsdl-org/SDL#12064

After #2221, Lawrence's 60-frame cutscene still collapsed.

This doesn't fix the crashes on bosses cutscenes that are in the Remo folder, but the cutscenes that are in the Movie folder.

I see. Thank you very much for your explanation.

<!-- gh-comment-id:2612795213 --> @lmutig commented on GitHub (Jan 24, 2025): > > > PR 合并上游:[libsdl-org/SDL#12064](https://github.com/libsdl-org/SDL/pull/12064) > > > > > > After [#2221](https://github.com/shadps4-emu/shadPS4/pull/2221), Lawrence's 60-frame cutscene still collapsed. > > This doesn't fix the crashes on bosses cutscenes that are in the Remo folder, but the cutscenes that are in the Movie folder. I see. Thank you very much for your explanation.
Author
Owner

@netslovv1 commented on GitHub (Feb 11, 2025):

help me
crashes in cutscene after killin logarius and using his crown

<!-- gh-comment-id:2650614731 --> @netslovv1 commented on GitHub (Feb 11, 2025): help me crashes in cutscene after killin logarius and using his crown
Author
Owner

@hspir404 commented on GitHub (Mar 16, 2025):

help me crashes in cutscene after killin logarius and using his crown

The problem you are describing is unrelated.
This bug was only for the pre-rendered cutscenes, like those immediately after character creation.

<!-- gh-comment-id:2727298028 --> @hspir404 commented on GitHub (Mar 16, 2025): > help me crashes in cutscene after killin logarius and using his crown The problem you are describing is unrelated. This bug was only for the pre-rendered cutscenes, like those immediately after character creation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#702
No description provided.