Ctrl+c to exit video not working & segfault on 2nd run #3
Labels
No Label
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yoshino/xr-video-player#3
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I'm unable to get any video running with
xr-video-player
. I downloaded it from the aur, and made sure SteamVR was running when running the commands listed below. I ran them twice as they gave slightly different results. If you need any more information let know so I can provide it.Output for
xr-video-player --video ~/path/to/video.mp4
Second run:
Output for
xr-video-player --use-system-mpv-config --video ~/path/to/video.mp4
System Information
Seems like it can run once but then you need to restart steam.
Working:
Trying again after it worked:
I have built from source but it has the same result.
Exiting within VR by pressing the SteamVR options button on the controller, going to "EXIT GAME" or burger menu and "EXIT OPENXR OPENGL EXAMPLE" allows
xr-video-player
to getKilled
. Which then allows you to manually pick and play another video.Before I was closing the video by pressing Ctrl+c in the terminal that the video was running from.
When the video finishes its a black screen until you manually exit OpenXR OpenGL Example (
xr-video-player
) in SteamVR.Output:
If this is working as intended, can I get a confirmation before closing the issue?
I currently have no working setup for SteamVR so I can / have only tested the application against monado.
I was unable to reproduce the segfault with monado.
"Ctrl+c" in the terminal caused a normal shutdown (while a video was running or after it is finished) and starting another video afterwards was no problem.
It does not seam to be the case that "Ctrl+c" causes a different, less controlled, shutdown compared to other ways.
That is currently the intended behavior. Not quite so intended is the high CPU usage after the video is finished ... going to look into that, when I have a bit of time.
Another option to close the application is by pressing "esc" while the xr-video-player companion window is focused.
(... I am somewhat surprised that I have forgotten to mention this in the readme, I am going to rectify that in the future)
Thank you, for your issue, but as I am unable to reproduce the segfault on my machine, I can not work towards a resolution for that. If you want too, you could try to debug the applications second run after a "Ctrl+c" and post about where the segfault occurred, that might help us / me figure out what the problem is.
But I also do not mind if you close the issue if you are satisfied with this response.
Also thanks for inadvertently pointing out that the application presents itself as "OpenXR OpenGL Example" to the runtime, I am going to fix that :)
Full output from running
$ gdb --args xr-video-player --video ~/downloads/vr/playlist.m3u
: https://hastebin.com/share/vesodojuyo.yamlAfter pressing "Crtl+c"/
^C
xr-video-player
is still on the desktop as a black window, shows up inbtop
and is showing as "waiting..." in SteamVR (in vr)Pressing Esc instead of Ctrl+c shows:
I then have to press "Crtl+c" to exit.
xr-video-player
window is closed but is still showing up inbtop
.After pressing "Crtl+c"/
^C
:gdb
as it was ran once in even though the once was ingdb
gdb
.gdb
(works)gdb
and run it normally (doesn't work)xr-video-player
is run here it gives the segfault and also doesn't show as running inbtop
.gdb
again (works)Hope this helps diagnose the issue better, if it doesn't what would you suggest I try next?
Unable to play videosto Ctrl+c to exit video not workinggdb
by default catches the signalSIGINT
byctrl+c
and halts the program so you can debug and prevents the debugged application from ever seeing the signal.The first command in the following example lets
gdb
pass the signal on and tells it to not stop when encountering the signal.Please test again with this modification and report back :)
I don't think that this is the same problem here, this application does not seem to link against LLVM directly (
ldd /path/to/xr-video-player | grep -i llvm
returns nothing).Here is the new
gdb
log, ran withhandle SIGINT nostop pass
set toy
: https://hastebin.com/share/wotahuvoli.yamlAfter the first
ctrl+c
it was still running in btop (added a capture), it wasn't till after anotherctrl+c
it closed.It is weird that you have to press
ctrl+c
twice ... might for some reason be a difference because of SteamVr, but I am not sure why it would make such kind of a difference ...Kind of forgot that the segfault was not caused by the
ctrl+c
directly... so my previous response did not really help us ...I am going to look a bit closer at the logs you already provided and see if I can deduce a something useful. That will take a bit of time, going to report if I find something.
Just to clarify, you do not only mean that is does not segfault, but that is completely works right (you can see the video via headset)? Same for the last log from a bit ago, correct?
When I
run
inside thegdb
a second time it will show the video inside the headset and thexr-video-player
window will appear.First time running
xr-video-player
ingdb
then exiting out and running it in the terminal will give the segfault.If I run it again, now being the 3rd attempted inside
gdb
it will run correctly.Doing the 4th run for instance inside
gdb
without exiting,xr-video-player
will work correctly. I could also just exit out ofgdb
and go back intogdb
to run it and it will work correctly.I hope that clarifies things better.
I manged to get it to segfault in
gdb
: https://hastebin.com/share/vusalozeju.yamlEDIT: Never mind, the file was moved from this path. Forgot to change it.
I can reproduce the segfault in
gdb
by trying it with--use-system-mpv-config
and--use-system-mpv-config ~/.config/mpv/mpv.conf
though:After a first run
--use-system-mpv-config
hastebin linkAfter a first run
--use-system-mpv-config ~/.config/mpv/mpv.conf
hastebin linkWasn't sure if I had to pass the
mpv.conf
location or not so I tried it with both. There is only the "Xr-Video-Plyer Waiting..." box inside the headset (screenshot of what I mean below).The process of this segfault is the same as running it outside of
gdb
.--use-system-mpv-config
hastebin linkgdb
.Neat that you now are able to reproduce the segfault with
gdb
.Please repeat a run in
gdb
and after the segfault is caught enterbacktrace
andlist
beforeexit
and report back.I am not really experienced with gdb so please excuse my step by step instructions of what to do ... :)
... of course I made such a clever mistake ...
Here you go, I checked it twice and it shows the same result both times.
I accidentally closed, whoops.
Oh that is probably due to my
playlist.m3u
not being setup properly as I edited it yesterday. Trying to get the same segfault as yesterday but not having any luck.playlist.m3u
was pointing to a folder not a list of videos.Never mind, got the same, with the
playlist.m3u
set correctly:Double checked the
playlist.m3u
as well.I'll see if I can set up monado to check if I get the same issue.
No luck in getting monado working.
Steps I did to install monado:
~/.config/openvr/openvrpaths.vrpath
and replaced the "runtime" section to/home/richard/OpenComposite
. Also made the file read only withchmod 0444 ~/.config/openvr/openvrpaths.vrpath
.~/OpenComposite
was extracted from the OpenOVR 64-bit Linux build zip file and placed in the home directory.monado.service
, headsets screens lit out and looked like it was working.xr-video-player --video ~/videos/VR/playlist.m3u
, which output:@yoshino I think this happens because steamvr has a bug where it breaks unless the application cleanly shuts down steamvr. Since openxr is used here I think you need to use xrRequestExitSession when pressing Esc which will then make openxr go into the state XR_SESSION_STATE_EXITING and call xrDestroySession. Then call xrDestroyInstance at the end. At least, that's how it's done here: https://gitlab.freedesktop.org/monado/demos/openxr-simple-example/-/blob/master/main.c?ref_type=heads
since ctrl+c shuts down the application without doing that you also need to catch the SIGINT signal to make it cleanly shutdown instead, see: https://git.dec05eba.com/vr-video-player/tree/src/main.cpp#n2782 but in this case it would have to be modified a bit since I dont think you can call xrRequestExitSession from a signal handler.
Ctrl+c to exit video not workingto Ctrl+c to exit video not working & segfault on 2nd runOkay I have implemented and pushed the changes that @dec05eba brought up, something like that is what I thought it might be.
I apparently completely forgot to also port
xrRequestExitSession
from the example at the time that I created this application...@Kagukara thanks for your continued effort for testing. I haven't had the time so far to look in detail at your reports and because of @dec05eba comment I might not need too (sorry), please try those changes at your convenience :)
The segfault is no longer appearing.
I can type
xr-video-player --video ~/videos/VR/playlist.m3u
into the terminal to play the video and see it within the VR Headset. Will make a new issue if anything else goes wrong/request a functionality.To close
xr-video-player --video ~/videos/VR/playlist.m3u
when pressing either "Esc" on the window or "ctrl+c" it showsRequesting exit..
in the terminal and the window is closed, but still active in the terminal until its killed insidebtop
. Once killed inbtop
it outputsKilled
in the terminal and is no longer active.Typing
xr-video-player --video ~/videos/VR/playlist.m3u
again (which didn't work before) now works with no segfault appearing.This happens in
gdb
as well.Output before killed in
btop
: https://hastebin.com/share/rugusumevo.yamlAfter killed in btop it then shows:
EDIT or it shows:
Maybe xrDestroyInstance is needed as well? it's not clear from the documentation
Spoke too soon that the segfault is no longer appearing.
Steps I did to reproduce:
xr-video-player --video ~/location/to/video
xr-video-player
inbtop
xr-video-player --video ~/location/to/video
Segfault inside
gdb
:xr-video-player
window is still open and black, also black in the VR Headset.Unrelated to steps, but I managed to get this segfault as well in
gdb
:xr-video-player
window is still open and black, also black in the VR Headset.I assume
btop
sends aSIGKILL
signal toxr-video-player
. If such is true then I can not handle the signal at all ... so no clean shutdown viaxrRequestExitSession
which then makes SteamVR unhappy for successive starts.(based upon my reading of https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html#index-SIGKILL)
The reason for the application not to shutdown by itself, is probably because of one
[New Thread 0x7fff237fe6c0 (LWP 21086)]
that is started but not exited... With monado such does not happen, so I think SteamVR is the problem ...I am going to think a bit more about it, but currently I don't have another idea ...
@Kagukara I found ValveSoftware/SteamVR-for-Linux#422 and ValveSoftware/SteamVR-for-Linux#479
Issue 422 matches this:
And 479 matches the segfault backtrace that you reported last.
There are also a bunch of other projects that mention this problem in the issues. It seams like there is nothing that can be done from our side.
If you want, you can add a comment to Valve's issues, mentioning that this project is also affected and that you are interested in a resolution ... no idea if that helps though. One of the issues is close to its second anniversary and the other is already over ... If SteamVR were opensource, a PR would have surly by now been merged, fixing the problem ;)
I'll go link this on the two issue pages. Thank you for your time and getting to the cause of the issue.