-
Notifications
You must be signed in to change notification settings - Fork 160
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
Segmentation fault after running for a couple minutes #105
Comments
Please try and run it in |
Running it with |
Okay, maybe compiling a new version of v4l2loopback-dkms, or try installing the actual akvcam. It does appear that running it with |
Just built v4l2lopback following the instructions in the README, and I'm still getting segfaults. I'll try giving akvcam an install. |
Okay, try the following:
Then do the followings: Segfault has got more to do with the C library my Python code is calling, than my own Python code. |
I've been using the Zoom desktop client and Jitsi Meet (via Firefox 89) to test (but not both programs at the same time). ETA: It doesn't segfault when launching any program. It segfaults while using said program. The results of doing the above:
Giving a v4l2loopback virtual camera with I have an |
While this doesn't solve the segfault issue, I made a workaround to restart the script when it does. It produces a bit of a flash when the camera restarts (which can be quite frequently and very annoying), but otherwise starts back up very quickly and seems to work decently in the interim. Exiting with #!/bin/bash
CODE=1
while [ "$CODE" -ne "0" ]; do
python3 /path/to/fake.py -w /dev/video2 -v /dev/video7 -i /path/to/image/folder
CODE=$?
done |
You need to specify |
I can confirm that there's still a segfault running with |
What's your operating system? |
Pop!_OS 20.04 LTS. It's based on Ubuntu 20.04 LTS. |
In that case I have no idea then. I will leave this ticket open. |
@brandoningli , please give the latest commit a go. Please reconfigure akvcam based on the README. |
Did you mean to say the first device or video6? |
video 5, apologise. I will amend the README. |
Also, is |
Nope, I completely removed that option. |
Ok. It's still in the README, but not in the usage info in the program. |
Done, updated README. |
I'm still getting frequent segfaults, and my computer seems to crash completely 15-30 seconds afterwards. I have no way of directly blaming the script or akvcam, but it happens reliably after the segfault and rarely any other time. |
Okay maybe try the Docker version? I suspect it is the difference between OS versions. It runs pretty stably on my Debian Stable |
Has the docker version been updated to use mediapipe? I've used the older docker version before with success, but poor performance. |
Someone supposedly patched the Dockerfile, and if you re-generate the Docker image, it should be up-to-date. |
It has updated to the new mediapipe implementation, but there's two issues with the Docker implementation:
|
Okay, definitely submit your PR. I think I am just going to leave this issue open. I can't suggest any ways for you to fix it. I don't know if vanilla Ubuntu 20.04 would have the same problem. |
Thanks for your help, though! |
@brandoningli , could you give this a go please on normal |
I don''t want to jinx it, but it's already been running longer without segfaulting than any other version. I'll leave it running in the background for a while and report back if it segfaults or keeps running. Performance seems on-par with the regular mediapipe version before it segfaulted as well. |
Basically I tried to add more multithreading, and I tried putting the mask generation within the But if this patch works, then I will merge it to master. |
Ah, race conditions. Gotta love them. It's been running stably for me now for about ten minutes, which is much longer than before the patch. If it was going to segfault, it would've by now. |
Hold that thought.
|
That got patched in b80e1e9 |
Thank you so much for helping out! |
@brandoningli , btw, if you need help with job applications / Masters applications / PhD course applications, feel free to ping me an email. I saw on your Github profile that you are open for work. |
Also, what's your CPU, if you don't mind me asking. |
Intel i5-6300HQ (4) @ 3.200GHz |
While running, I get an average of 19-20fps at 720p, which is much better than previous versions getting single-digit frame rates at that resolution.
However, after running for a minute or two, the program produces a Segmentation fault and stops. I'm able to restart the script and it picks right back up, but again Seg faults after a minute or two.
Pop!_OS (Ubuntu) 20.04
Kernel 5.11.0-7614-generic
Project just pulled minutes ago.
Python 3.8.5
v4l2loopback-dkms
version 0.12.3-1ubuntu0.4 (from repos). I haven't yet tried compiling from source, but can if requested.Pip Package versions:
Program output:
The text was updated successfully, but these errors were encountered: