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

Crash on Linux with an "undefined symbol" freenect error #83

Open
AlphieAlph opened this issue Jun 12, 2023 · 12 comments
Open

Crash on Linux with an "undefined symbol" freenect error #83

AlphieAlph opened this issue Jun 12, 2023 · 12 comments

Comments

@AlphieAlph
Copy link

Being a novice Linux user, I can't really tell if I have properly installed the plugin, I think that calls for proper installation instructions for Linux since the plugin is not distributed as an installation script (such as AUR #80 package, DEB etc) and there doesn't seem to be any plans to do so.

Despite my best efforts, I could not get my the plugin working after two days of on and off tinkering on my Arch Linux install (+ Kinect V1) resulting only in crashes with this error undefined symbol: freenect_convert_packed_to_16bit that I couldn't work around nor fix.

Here is the log that also contains some comments from me.

obs seems to check for the plugin in /usr/lib/obs-plugins and /usr/lib/ but it only detects a kinect (and subsequently crashes) if the *.so files are in /usr/lib/, it will not detect the kinect if those files are not present in /usr/lib/ .

@SirLynix
Copy link
Owner

Hi,

This is because currently obs-kinect requires a custom-built version of libfreenect (you can find here.

However this shouldn't be required anymore with their last version, so I need to update it on my side.

@Weirdo1312
Copy link

aur package is ready btw, the plugin loads just fine but libraries don't load properly
https://aur.archlinux.org/packages/obs-kinect-bin

@AlphieAlph
Copy link
Author

Thank you for notifying me!
I will check it out as soon as I can :D

@Weirdo1312
Copy link

Thank you for notifying me! I will check it out as soon as I can :D

you're welcome
I also made libfreenect-sirlynix aur package for testing purposes, it's the SirLynix's custom version of libfreenect that he mentioned above, please test obs-kinect-bin with all three libfreenect packages and let us know if any of them works

https://aur.archlinux.org/packages/libfreenect
https://aur.archlinux.org/packages/libfreenect-git
https://aur.archlinux.org/packages/libfreenect-sirlynix-git

@AlphieAlph
Copy link
Author

Hello there!
I've wiped the partially working obs install just to be sure, and tried your obs-kinect package with the official libfreenect binary but sadly no luck; nor even by building it from source.
Crashes, as expected, with: obs: symbol lookup error: /usr/lib/obs-kinect-freenect.so: undefined symbol: freenect_convert_packed_to_16bit.

But good news, building with SirLynix's fork of libfreenect (libfreenect-sirlynix-git) does seem to work with my V1 Kinect model 1414.

What works:

  • Color steam works on low resolution mode.
  • Depth steam and all options work.
  • Faux green screen and all options work.

What does not work:

  • Infrared camera is working, but the separate steam is not available.
  • If Shutdown when not visible is enabled, Obs will crash.
  • Motor control is not available, with no slider to be seen.

@Weirdo1312
Copy link

Hello there! I've wiped the partially working obs install just to be sure, and tried your obs-kinect package with the official libfreenect binary but sadly no luck; nor even by building it from source. Crashes, as expected, with: obs: symbol lookup error: /usr/lib/obs-kinect-freenect.so: undefined symbol: freenect_convert_packed_to_16bit.

But good news, building with SirLynix's fork of libfreenect (libfreenect-sirlynix-git) does seem to work with my V1 Kinect model 1414.

What works:

* Color steam works on low resolution mode.

* Depth steam and all options work.

* Faux green screen and all options work.

What does not work:

* Infrared camera is working, **but the separate steam is not available**.

* If Shutdown when not visible is enabled, Obs will crash.

* Motor control is not available, with no slider to be seen.

thank you so much for testing, for myself it still doesn't work, maybe i have a different kinect model or firmware or something like that, can you please tell me how did you find out the model?

@AlphieAlph
Copy link
Author

thank you so much for testing, for myself it still doesn't work, maybe i have a different kinect model or firmware or something like that, can you please tell me how did you find out the model?

Hey there!
You're most welcome for testing, it was my pleasure.
You can find your Kinect model on its base, there should be the sticker with serial number and all including the model number on the top right portion of the sticker, right underneath the Xbox 360 text.
Also the kinects made for Xbox 360s are identified as kinect v1s while the ones for Xbox ones are v2s according to my understanding.

@AlphieAlph
Copy link
Author

AlphieAlph commented Sep 27, 2023

Also, if it still doesn't work, I suggest you try the packaged and patched OBS that should be somewhere around in this issue:

I've finally figured out how to install it in flatpak. This is definitely not how you're supposed to do things in flatpak (and will probably be erased after every obs update), but it's better than nothing. This works no matter what distro you're on. So if you're struggling to install it, use the flatpak. I'll also look into flatpak extensions as this seems to be the proper way of doing it.

1. Install the official OBS flatpak (https://obsproject.com/download)

2. If you haven't already, copy the libfreenect2 udev rules to `/etc/udev/rules.d/` (restart after that)

3. Make a directory somewhere. I'll make `~/obs-kinect`

4. compile the extension and copy `ubuntu-latest-x64-releasedbg/obs-plugins/64bit/*` files to obs-plugins in obs flatpak and your newly created directory. If installed globally (default), copy it to `/var/lib/flatpak/app/com.obsproject.Studio/current/active/files/lib/obs-plugins/` AND to `~/obs-kinect`

5. copy `ubuntu-latest-x64-releasedbg/data/obs-plugins/obs-kinect/` folder to `/var/lib/flatpak/app/com.obsproject.Studio/current/active/files/share/obs/obs-plugins`

6. compile libfreenect2 and put `libfreenect2.so`, `libfreenect2.so.0.2`, and `libfreenect2.so.0.2.0` in `~/obs-kinect` (I've forked the repo with an action that builds it if you can't build it)

7. You'll also need the libusb and libglfw libraries as they aren't provided by the obs flatpak. They should be already in your system, but in my case they're compiled against a higher glibc version than what is in the flatpak. So I downloaded the ubuntu 20.04 "focal" packages for `libglfw3` and `libusb-1.0-0` from https://packages.ubuntu.com/ and extracted `libglfw.so.3`, `libglfw.so.3.3`, `libusb-1.0.so.0`, and `libusb-1.0.so.0.2.0` to `~/obs-kinect`

8. Now override the obs flatpak filesystem to add `/home/<your_username>/obs-kinect:ro` also override the environment variables to add `LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<your_username>/obs-kinect` If obs crashes for you, also add `LIBFREENECT2_PIPELINE=cpu` (see comment below). I used flatseal for all of this, but you can use `flatpak override --user` command if you like.

After that I get to the same point where I got with the "native" installation. It works but crashes 90% of the time. @SirLynix if you're still working on this project, this is the output of when it crashes: crashed.txt and this is it when it launches properly: launched.txt (though I think it crashed when I tried to exit there)

See #9 (comment)

I admit I don't remember where to find it in tropical forest of replies, and I regret my memory is not amazing, but I am a data hoarder, so I will include the zip file that (hopefully) should have everything you need.

Archive.zip

@Weirdo1312
Copy link

thank you so much for testing, for myself it still doesn't work, maybe i have a different kinect model or firmware or something like that, can you please tell me how did you find out the model?

Hey there! You're most welcome for testing, it was my pleasure. You can find your Kinect model on its base, there should be the sticker with serial number and all including the model number on the top right portion of the sticker, right underneath the Xbox 360 text. Also the kinects made for Xbox 360s are identified as kinect v1s while the ones for Xbox ones are v2s according to my understanding.

I just checked and looks like i indeed have a 1414 model. so let me get this straight, we both have the exact same kinect model, same exact distro, same aur packages but it works for you and not for me? i'm out of ideas

@AlphieAlph
Copy link
Author

AlphieAlph commented Sep 27, 2023

thank you so much for testing, for myself it still doesn't work, maybe i have a different kinect model or firmware or something like that, can you please tell me how did you find out the model?

Hey there! You're most welcome for testing, it was my pleasure. You can find your Kinect model on its base, there should be the sticker with serial number and all including the model number on the top right portion of the sticker, right underneath the Xbox 360 text. Also the kinects made for Xbox 360s are identified as kinect v1s while the ones for Xbox ones are v2s according to my understanding.

I just checked and looks like i indeed have a 1414 model. so let me get this straight, we both have the exact same kinect model, same exact distro, same aur packages but it works for you and not for me? i'm out of ideas

That seems to be the case...
Have you checked the default libfreenect test tools to see if the kinect works at all?
Have you tried listing all usb devices (lsusb) and checking if these are present?

image

@Weirdo1312
Copy link

thank you so much for testing, for myself it still doesn't work, maybe i have a different kinect model or firmware or something like that, can you please tell me how did you find out the model?

Hey there! You're most welcome for testing, it was my pleasure. You can find your Kinect model on its base, there should be the sticker with serial number and all including the model number on the top right portion of the sticker, right underneath the Xbox 360 text. Also the kinects made for Xbox 360s are identified as kinect v1s while the ones for Xbox ones are v2s according to my understanding.

I just checked and looks like i indeed have a 1414 model. so let me get this straight, we both have the exact same kinect model, same exact distro, same aur packages but it works for you and not for me? i'm out of ideas

That seems to be the case... Have you checked the default libfreenect test tools to see if the kinect works at all? Have you tried listing all usb devices (lsusb) and seeing if these are present?

image

yes, freenect cli tools work just fine, all the motors, camera, infrared, audio...
everything works flawlessly, i can even add the kinect to obs as a v4l device but the plugin doesn't work
image

@AlphieAlph
Copy link
Author

yes, freenect cli tools work just fine, all the motors, camera, infrared, audio... everything works flawlessly, i can even add the kinect to obs as a v4l device but the plugin doesn't work image

That is proper weird. The last option would be to run OBS verbose and checking its output to see if there is any kind of hint there...
Hope you don't mind me asking, but have you completely wiped your OBS installation and reinstalled it from scratch? Maybe there is some remanence of one of your older attempts?

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

3 participants