Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv crashes on windows playing a certain file with --gpu-api=vulkan (rev1 and rev2) #4943

Closed
Artoriuz opened this issue Oct 1, 2017 · 17 comments

Comments

@Artoriuz
Copy link

Artoriuz commented Oct 1, 2017

mpv version and platform

Tested on both 052ae53 and 33973dc (branch-vulkan-rev2), Windows 10 x64 15063.608 with a a RX470 (Polaris AMD card, should expose async compute)

Reproduction steps

Playing a certain file with --gpu-context=win --gpu-api=vulkan always makes mpv crash on the exact same frame, but it doesn't seem to happen with other files (at least I don't think I've seen it crashing with anything else). The file which makes it crash is a normal AVC High10p AAC file.

Log files provided with a [bench] profile since I was originally trying to benchmark vulkan's performance against opengl.

The [bench] profile is just this:
[bench]
audio=no
untimed=yes
video-sync=display-desync
vulkan-swap-mode=immediate
opengl-swapinterval=0
osd-msg1="FPS: ${estimated-display-fps}"

Expected behavior

Just like with any other possible configuration (OpenGL with angle, win or dxinterop) it should work fine without crashing.

Actual behavior

It crashes every single time on the same frame. Making the player skip the frame makes it able to go until the end of the file just fine. What's even weirder is that making it skip the frame once (just forcing it to go to any other part of the video), then making it go back to the beginning "fixes" the problem and mpv is able to go through the entire file without crashing where it would previously crash.

I tried to make a short length sample from the original file with FFMpeg (problem occurs at 00:01:03, my sample had the first 5 minutes of the movie) so it would be easier to share, but the problem isn't reproducible in the sample. Instead of crashing on the same frame, it works as expected and stays working. I don't really think uploading a 10GB file will work, so I don't know how to proceed.

Log file

Log file with vulkan-rev1:
https://pastebin.com/1h5037Ka
Log file with vulkan-rev2:
https://pastebin.com/Sxj8jjfN

@haasn
Copy link
Member

haasn commented Oct 1, 2017

Does it still happen if you disable the subtitles?

@Artoriuz
Copy link
Author

Artoriuz commented Oct 1, 2017

Disabling the subs in the OSD, pressing j or with --no-sub-visibility fixes it indeed. Plays perfectly fine.

@shinchiro
Copy link
Contributor

I also have the movie (but from different group) and yes it also crash at certain time. Checking with the sub, it is .pgs format unlike usual .ass format so there might something weird with it

@haasn
Copy link
Member

haasn commented Oct 1, 2017

I've had some weird subtitle-related crashes recently as well. I wonder if it's possibly a libass bug? It seems like the subtitle uploading code writes out-of-bounds, at least compared to how big the buffer is allocated.

@haasn
Copy link
Member

haasn commented Oct 1, 2017

Anyway, can you upload just the subtitle track?

@Artoriuz
Copy link
Author

Artoriuz commented Oct 1, 2017

@haasn
Copy link
Member

haasn commented Oct 1, 2017

Hmm, it works fine here. Can you reproduce it on any file with just --sub-file=Foy.sup? Including with --no-config --gpu-api=vulkan?

@Artoriuz
Copy link
Author

Artoriuz commented Oct 1, 2017

Yeah, with that sub it always crashes at 00:01:03 regardless of which file mpv is playing.

Log on a different file:
https://pastebin.com/pH3qc43i

@Artoriuz
Copy link
Author

Artoriuz commented Oct 8, 2017

I'd just like to add that the exact same problem used to happen with the very first ra_d3d11 build available in shinchiro's sourceforge (exactly the same, it worked fine with OpenGL (angle, dxinterop or win) but didn't with d3d11), but now with the current d3d11 build available there it's working fine. It might help with trying to figure out what's still causing the issue under Vulkan.

@rossy
Copy link
Member

rossy commented Oct 8, 2017

The only difference between the original d3d11 build and the current one is this commit:
rossy@8cce5fb56527

Basically, for partial tex_upload() regions where the region touched the top or left edge of the texture, it would ignore the region and copy way too much data.

@shinchiro
Copy link
Contributor

shinchiro commented Oct 18, 2017

@haasn Apart from this bug, I also got crash when switching to secondary subtitle after faster seek in vulkan which doesn't happen in d3d11. I can reproduce this on win10. Dont know whether this is driver bug or not

@haasn
Copy link
Member

haasn commented Oct 18, 2017

@shinchiro Can you get me a backtrace?

@shinchiro
Copy link
Contributor

shinchiro commented Oct 18, 2017

here's debug (generated by drmingw)
https://0x0.st/CCJ.txt

Both crash seem to point to same line. Hopefully this will be useful

@haasn
Copy link
Member

haasn commented Oct 18, 2017

Yeah all of the crashes I've seen seem to point at the exact same stack. If I can reproduce it again I'll have a look through the variables, I suppose.

@notanuser
Copy link

notanuser commented Oct 19, 2017

Disabling the subs in the OSD, pressing j or with --no-sub-visibility fixes it indeed. Plays perfectly fine.

--no-osc helps as well.

@Artoriuz
Copy link
Author

@notanuser still crashes here with --no-osc, our problems might be unrelated.

@haasn
Copy link
Member

haasn commented Oct 27, 2017

Found the bug. (Caused, of course, by the nonsensical design of ra_tex_upload)

@haasn haasn closed this as completed Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants