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

Freenect(2) update thread (Linux/macOS support) #9

Open
SirLynix opened this issue May 3, 2020 · 131 comments
Open

Freenect(2) update thread (Linux/macOS support) #9

SirLynix opened this issue May 3, 2020 · 131 comments
Assignees

Comments

@SirLynix
Copy link
Owner

SirLynix commented May 3, 2020

Hi,

With the upcoming 0.3 release, I splitted obs-kinect into multiple parts: common stuff like obs plugin registration, depth/infrared/faux green-screen processing, source and general device handling is part of the core but it doesn't know about Kinect devices (or even windows). Kinect v1/v2 handling is done in separate dll which are loaded by obs-kinect at startup.

This was made to add support for Kinect v1 without requiring the install of both v1 and v2 runtimes. And also to support Linux/macOS.

Obviously, Microsoft Kinect SDKs don't work on Linux/macOS, hopefully projects like libfreenect and libfreenect2 allow the use of Kinect on these systems.

Since obs-kinect device handling is done in separate libraries, it's possible to add libfreenect support kinda easily.

I tried both of these libraries on Windows (since they do have Windows support as well) for testing and it's working well!

freenect (v1):
image
image

freenect2 (v2):
image

However since libfreenect(2) needs raw USB commands, it requires to install a custom USB driver (like UsbDk). Hopefully this doesn't conflict with Kinect v2 (I can use libfreenect2 and Kinect SDK v2.0 without problem), but well, for Kinect v1 it's a bit more like hell. You have to replace the Kinect USB driver (using Zadig) for libfreenect to work which prevents Kinect SDK v1.8 to work, and it took me one hour to reinstall the official Kinect drivers, so yeah, I don't think I will release an obs-kinect libfreenect backend on Windows because of that (since it doesn't seem to do things you cannot do with official Kinect v1.8 runtime, except maybe for led control?).

As for Kinect v2, libfreenect2 does add more control, especially with the RGB camera color settings (things like exposure mode, white balance, gain, and such), so I think I'll support it on Windows too (even though I hope to be able to do that as well with the official SDK backend, using this).

Important note

Both libfreenect libs are really cool, but they are lacking some higher-level stuff the Kinect SDK does, like body/skeletal detection, or dedicated background removal (like Kinect SDK v1.8 does). It doesn't mean you won't be able to have background removal on Linux/macOS but it means you won't be able to use body informations for that and there's not much I can do about that. (except implementing body detecting but it requires some skill I don't have).

I will be able to compile the plugin on Linux, or even test it without problems, but I won't be able to do that with macOS. So if you have a mac and are willing to help, please let me know!

Also, as the 0.3 release is already a big one, Linux/macOS support won't be part of it (but I'll try to do it asap).

TL;DR: Linux/macOS support requires an open-source backend since official Microsoft SDKs are for Windows. There are backend for Kinect v1 and v2 but they don't do higher-level processing like body information. Things like body detection/body-based greenscreen filtering won't work on Linux/macOS because of that.

@skinlayers
Copy link

@SirLynix I can do Mac builds and testing for you. I have both a Kinect v2 and a v1.

@SirLynix
Copy link
Owner Author

SirLynix commented May 6, 2020

Thanks! I have little experience with macOS compilation, I'll probably need some help!

@erdemthearch
Copy link

Hello :)
it seems that you only changed "include" and "src" files.
So how can we update the software? Which files must be copied and pasted to where?
Thanks in advance.

@SirLynix
Copy link
Owner Author

SirLynix commented May 7, 2020 via email

@erdemthearch
Copy link

W10 and Kinect v2

@SirLynix
Copy link
Owner Author

SirLynix commented May 8, 2020 via email

@erdemthearch
Copy link

I am really sorry but i am not a coder. I only know node based coding. I am really far away from visual studio. Is there any quick istall file or something like that? Or do you consider to make one for end users like me in future? Thanks :)

@SirLynix
Copy link
Owner Author

SirLynix commented May 8, 2020

You can download the 0.2 release in the releases section of GitHub. The 0.3 binaries will be downloadable soon (I will make a release candidate for them).

As for the Kinect v2, there's not much difference between 0.2 and 0.3 for now, except for some performance improvement.

@A-Cloud-Ninja
Copy link

I've tested libfreenect on my current machine (archlinux install) and it works pretty well. Is there any reasonably straightforward way to build this with libfreenect as it currently stands? I'd be willing to go through the effort and test it on my system, this is something i've been wanting for a while now!

@SirLynix
Copy link
Owner Author

Hi!

From what I saw libfreenect(2) should be kinda easy to use, and Linux support is my next big task. It's just that I have a lot of work to do for other projects (and I have a relatively costly hobby called eating 😄 ) and this is not at the top of my todo list for now.

However a lot of the work that went into 0.3 (that will be 1.0 when out) was to make obs-kinect core portable, and leave Windows/Kinect SDK specific stuff in some backend code. All that to say there's not much work remaining in order to have this plugin on Linux!

@A-Cloud-Ninja
Copy link

Fantastic! If you need someone to test, please feel free to find a way to contact me haha.

@fotiDim
Copy link

fotiDim commented Jan 17, 2021

I am trying to use Kinect 2 as a webcam on Mac (using Slack). Using Libfreenect2 I can get the RGB stream through their example app (Protonect) or code but there is no straightforward way to expose Kinect as a webcam to other software.

Since OBS can act a virtual webcam on Mac having this plugin working would be highly useful.

@oixtron
Copy link

oixtron commented Jan 27, 2021

Hello!
I have to agree, I would love to see a working macOS Plugin. I've been looking for a solution to use my Kinect v2 via libfreenect2 as a webcam too for quite some time now, this is by far the most promising solution. Great work so far!

@SirLynix
Copy link
Owner Author

Just a quick message to tell you guys I'm not forgetting about Linux and macOS, I'm just working on several things at once (a man has to eat). My next big task (and the only remaining missing feature for 1.0) is Linux and macOS support. 😄

@SirLynix
Copy link
Owner Author

image

First KinectV2 color image captured using the WIP freenect2 background!
I'm testing it on Windows for now but this backend is made for Linux and macOS users 😄

I'm also switching from premake to xmake as a build tool for its handling of dependencies, and planning to setup a CI (with nightly builds).

@SirLynix
Copy link
Owner Author

SirLynix commented Feb 2, 2021


I managed to make the fake greenscreen work with libfreenect2. The results seems worse than with the official Windows SDK (it may be because of some options I still have to tweak).

@fotiDim
Copy link

fotiDim commented Feb 2, 2021

That is cool. Personally I am happy with having greenscreen only on Windows. I only need it as a webcam on mac.

@Milliw
Copy link

Milliw commented Feb 8, 2021

Do you know if the Linux version will have the same impact on system performance than on Windows? I dropped the Kinect atm on Windows because of that.

I hope it will be less, as at least the Kinect windows service will not be there?!

Otherwise I will sell my Kinect due to lack of availability of graphics cards at normal prices atm

@SirLynix
Copy link
Owner Author

SirLynix commented Feb 8, 2021

It depends on the Kinect model.

One of the benefit of Freenect2 (kinect for xbox one) is that it is able to exploit either the CPU or GPU to perform depth processing. I don't know if it will be faster than what the official SDK does but at least there will be more control.

I don't really know about Freenect (kinect for 360), as it's a completely different API, but I think it will be handled in a smarter way (the official Windows SDK tries to use all CPU threads at once).

As for Azure Kinect, I don't think there will be a significant difference (as it's the same SDK). Even though there maybe a difference between Windows and Linux/macOS on low-level handling.

So the real answer here is: I don't know yet, it requires some testing.

@SirLynix
Copy link
Owner Author

I managed to setup a CI which will build Linux plugins files (and eventually Windows and macOS) with a preliminary support for Kinect v2 (xbox one) through freenect2, and Azure Kinect support through Kinect for Azure SDK.

If you're feeling adventurous, you can download the Linux plugins files here (click on the last workflow that ran on master and download the ubuntu-latest-x64-releasedbg artifacts).

You'll still need a few other files (currently missing from this package), so you'll need to download the latest Windows nightlies to get theses files (please do it only if you know what you're doing).

This is not tested.

If you went into the troubles of trying this, please let me know if and how it worked for you (even if it didn't)!

Kinect v1 (xbox 360) and macOS users, don't worry. You'll be able to try it out soon!

@SirLynix
Copy link
Owner Author

I improved packaging support for Windows and Linux, which means the Linux package now has obs-kinect data (shaders and locales).

I'm wondering, what would be the best way to distribute obs-kinect on Linux? I've seen that some plugins (such as obs-websocket) build a .deb package which automatically installs the plugin files at the right place, which is something I can do, but doesn't that excludes non-debian based Linux distributions? What about them? Is obs studio even available/used on such distributions?

About mac builds, things seems easier on a technical level but would require me to pay for an Apple Developer Certificate annually. I need to think about this, and if there's another way.

@fotiDim
Copy link

fotiDim commented Feb 13, 2021 via email

@Milliw
Copy link

Milliw commented Feb 13, 2021

I'm wondering, what would be the best way to distribute obs-kinect on Linux? I've seen that some plugins (such as obs-websocket) build a .deb package which automatically installs the plugin files at the right place, which is something I can do, but doesn't that excludes non-debian based Linux distributions? What about them? Is obs studio even available/used on such distributions?

Yes, if it´s a .deb package it´s only for debian based distros. AFAIK advanced users could extract that package and copy to the right places on their distro, too. IIRC I´ve done that once but not sure. I tried Solus, elementaryOS and am now with Manjaro (arch based). For all theses distros there is OBS "natively" available through their package managers.

Compiling it for one/serveral formats would limit it to these distros. Maybe at least give a manual how to install from scratch into most common distros/bases (don´t know the right term) (deb, arch). There are also distro-wide packages like flat, snap and some third I can´t remember. Though I´m not sure if this will work only together with OBS installed using this packages, too.

@SirLynix
Copy link
Owner Author

First image of obs-kinect on Linux!
obs-kinect on Linux

I installed Ubuntu 20.04 and went into some troubles but finally found a way to make it work.

From what I observed, freenect2 works well, and is able to use my KinectV2 without any issue, except for the root permissions (which seems to be easy to fix, see OpenKinect/libfreenect2#870 ).

The Azure backend works too, but for some weird reason I couldn't retrieve the depth or infrared streams, probably something on my side.

The main remaining issue which remains is now a rpath one, I'll explain:
OBS-Studio loads obs-kinect which then loads its backends (obs-kinect-freenect2 for example), but this one is linked against obs-kinect and it seems Linux wants to open libobs-kinect.so back from there, except it just can't be found since libobs-kinect belongs to the plugin folder.

Setting the rpath to $origin doesn't help, as the origin here is OBS, and I can't set it to something like $origin/../../obs-plugins/64bit (which I did to test locally) because this path isn't guaranteed.

I see some solutions to fix this:

  1. Find some rpath trick to retrieve libobs-kinect.so.
  2. Split libobs-kinect.so in two files, set one next to obs executable and the other in obs-plugins folder (and make the backend linked to the first one, so no direct link between the plugin and its backend).
  3. Use static linking.
  4. Merge obs-kinect backend code into the main plugin and dynamically load backend dependencies.

I'm not sure if 1) is even possible, 3) is ugly and 4) is difficult to implement (as the libraries used are not really meant for that), so I think I'll go with 2).

Oh and I had to fix a shader on Linux, which now doesn't compile on Windows, yay.

@SirLynix
Copy link
Owner Author

I managed to work around theses problems and even make my Azure Kinect work on Linux (with depth-based blur!), I was just lacking Microsoft proprietary depth engine.

If the last commit compiles on the CI, it should be working for Linux users.

Capture d’écran du 2021-02-18 16-26-38

@A-Cloud-Ninja
Copy link

I'm wondering, what would be the best way to distribute obs-kinect on Linux? I've seen that some plugins (such as obs-websocket) build a .deb package which automatically installs the plugin files at the right place, which is something I can do, but doesn't that excludes non-debian based Linux distributions? What about them? Is obs studio even available/used on such distributions?

obs studio is available on most mainstream distros (debian, arch, gentoo probably even) and your "duty" as the developer in the typical linux packaging world is just really just tagging releases in github. Then those builds are reproducible for package maintainers in theory.

@SirLynix
Copy link
Owner Author

Do you know a OBS Studio plugins for Linux which does everything that should be done for this platform? The only example I've seen is obs-websocket which only provides a .deb package for Debian-based distributions.

@Milliw
Copy link

Milliw commented Feb 21, 2021

On my previous Manjaro installation I had the "NDI" plugin installed. Oh and on my laptop with Solus OS, too.
Don't know if this helps you.

@weirdal3333
Copy link

weirdal3333 commented Jan 16, 2023

I'm getting a 404 for that url...
I have the Xbox 360 version of the kinect.

@o-kotb
Copy link
Contributor

o-kotb commented Jan 16, 2023

Builds don't last forever on flathub's buildbot repo... I've create a flatpak bundle file that's attached here. Just extract the archive and install the bundle with flatpak install

flatpak install /path/to/obs_kinect.flatpak

obs_kinect.zip

@weirdal3333
Copy link

weirdal3333 commented Jan 16, 2023

image
I am still getting this error after installing the new version. The logs are identical.
2023-01-16 07-02-15.txt
What else can I provide to get this issue resolved? I have tried this on the latest linux mint, plain debian, and manjaro to no avail.

Also, @SirLynix this isn't a normal issue on linux. It's probably something really small that we're all missing, or Something microsoft has done to make things extra-complicated. 99% of the time stuff just works and compiles for everyone without a hitch.

@o-kotb
Copy link
Contributor

o-kotb commented Jan 16, 2023

Can you try this build? I've built this with glfw and libjpeg-turbo. I that doesn't work I'll also try building glut as it was one of the dependencies for the examples of freenect.

obs_kinect.zip

@weirdal3333
Copy link

weirdal3333 commented Jan 16, 2023

2023-01-16 07-53-45.txt
Same errors. I have ruled out the device being at fault with both windows and a regular freenect install.

I came across an unrelated issue; that being that freenect requires firmware for mic access on linux.
OpenKinect/libfreenect#580 (comment) <- This solves that.

Opening OBS while running any of the tests, for example the mic test, kills the kinect.
image
2023-01-16 08-00-11.txt

I can also hear an audible pop in my (aux jack) headphones when I do this, which is really weird.
What would happen if this plugin were recompiled with the latest release of freenect?

@o-kotb
Copy link
Contributor

o-kotb commented Jan 16, 2023

Yes, this is what I was looking at. I was thinking maybe it has to do with how libfreenect was compiled if it needs certain opnegl features. But I can't do much if it needs another program to upload firmware.

and a regular freenect install

Do you mean it works when you run one of the examples of freenect or when you use obs-kinect without flatpak?

@weirdal3333
Copy link

image
If I run the mic test, and then run obs with the plugins, the mic test stops seeing the usb, as if the whole bus were being reloaded. That could be the source of the audible pop. "USB device disappeared" and "USB audio marked dead" are the errors I'm talking about, and obs sees the device and says that it's busy.

@weirdal3333
Copy link

weirdal3333 commented Jan 16, 2023

Oh wow, running the mic test, and then quitting it, then opening OBS makes the plugin work?! What?!
2023-01-16 08-18-09.txt

Okay, so... running the mic test while obs is open, then quitting the mic test freezes it, but then the kinect plugin starts working. This is not okay, but it works for now...........

I'd be open for a screenshare at any point if you want to see how scuffed this is on my end.

@SirLynix
Copy link
Owner Author

I'm sorry I can't really help you with this as your issues seem to be related with libfreenect itself (maybe try to open an issue on their side), or the way the plugin is distributed on Linux (which I think I screwed up but I don't know how to improve that).

@weirdal3333
Copy link

Could you try updating your modified version of libfreenect to the latest source of the original repo? That might fix a few things... You only changed a few things, right?

@o-kotb
Copy link
Contributor

o-kotb commented Jan 19, 2023

I don't think that would make much difference. The issue is still up, and I think the problem is with how the firmware is being uploaded to the kinect, but I've created a patch file with SirLynix's commits and added to the flatpak manifest to be applied while building with the latest upstream git for you to test out.

Also, I'm still learning c++ and, overall, it doesn't seem like there is much developer interest in these types of projects. So I don't think there is much to be done atm.

This is the flatpak, manifest, and the patch

@weirdal3333
Copy link

So I've been playing around with the freenect tools, and I don't think it actually needs the firmware for anything but the mic/mic array.
It just needs to be registered, and this might be specific to the kinect v1. The current obs plugin code does not successfully register the device.
After running this, the kinect light turns green and the camera starts working in obs:
image

@SirLynix
Copy link
Owner Author

I think you're misunderstanding what "registration" means in libfreenect.
See https://github.com/OpenKinect/libfreenect/blob/master/include/libfreenect.h#L104

A "registered" frame (which is what's tested in the regtest demo) is depth aligned to color (which I call color-mapped depth in this plugin), there's no kind of "device registration" required for kinect, you open the device and starts its color and depth streams with the selected mode (see https://github.com/OpenKinect/libfreenect/blob/master/examples/camtest.c#L86), which is what I do.

I think you may have some kind of power or USB issue as it seems you're not getting all data sent by the Kinect. As of why it's working once you run a libfreenect example, that's a total mystery.

Could you try updating your modified version of libfreenect to the latest source of the original repo? That might fix a few things... You only changed a few things, right?

I just added a way to apply registration later on, so I can get the color and depth frames and then map depth to color (which allows to have multiple sources showing color/depth/color-mapped depth at the same time).

I pulled the recent libfreenect changes but I don't think it will help however as the recent libfreenect changes don't seem huge.

@weirdal3333
Copy link

weirdal3333 commented Mar 25, 2023

I've done some looking into things, and it's definitely something to do with the plugin code. Firmware does NOT need to be uploaded for the kinect's mic/video feed to work. I am getting all of the data sent by the kinect. Maybe the code to init the video feeds of the kinect isn't run when it's supposed to?

Currently the plugin is still broken.
Can you make a VM of a common, user-friendly, and up-to-date linux distro like Linux Mint/Fedora to test your flatpaks with? Windows's proprietary linux environment (WSL) is broken and generally not fully compatible with linux applications.

Installing the flatpak plugin should be all a user has to do to get it to work, after they get freenect working.

@SirLynix
Copy link
Owner Author

obs-kinect does not upload firmware, and I'm not sure how different should the plugin init video.

Can you make a VM of a common, user-friendly, and up-to-date linux distro like Linux Mint/Fedora to test your flatpaks with? Windows's proprietary linux environment (WSL) is broken and generally not fully compatible with linux applications.

Installing the flatpak plugin should be all a user has to do to get it to work, after they get freenect working.

I'm not a Linux user and have no idea how to make a flatpak, this is why I need help from advanced Linux users to help me with this plugin distribution.

@o-kotb
Copy link
Contributor

o-kotb commented Mar 25, 2023

Can you make a VM of a common, user-friendly, and up-to-date linux distro like Linux Mint/Fedora to test your flatpaks with?

All the plugin flatpak does is is extend on the OBS flatpak to add the plugin and its required dependencies (freenect, etc). The OBS flatpak would run the same regardless of the distro. And I doubt this behavior would change with native OBS (Speaking of, It’s still not published?? I’ll ask about it later)

Installing the flatpak plugin should be all a user has to do to get it to work, after they get freenect working.

You don’t need to install freenect or anything system else on your system besides the udev rules for the appropriate permissions.

I don’t know much about the original kinect, but it looks like certain models have this problem with libfreenect according to upstream reports. I’ll look into it tomorrow, but it’s hard to debug something you don’t have and can’t actively test with.

@weirdal3333
Copy link

Another problem I have is that it's currently impossible to compile the plugin on linux. Can someone fix this? The current instructions are to configure the cmake.lua file yourself, but there's no build32 or build64 folders after building libobs, and there isn't an obs-module.h file anywhere.
image

@SirLynix
Copy link
Owner Author

SirLynix commented Apr 8, 2023

You can take a look at how it's setup in the CI: https://github.com/SirLynix/obs-kinect/blob/master/.github/workflows/linux-build.yml#L174

@weirdal3333
Copy link

weirdal3333 commented Apr 21, 2023

So I've gotten the updated flatpak that o-kotb provided to reliably function.... but it's weird.
Running the freenect-tiltdemo application from the terminal and then stopping the processs before launching obs is required, otherwise the device fails to init.
Log before tiltdemo:
2023-04-20 23-35-45.txt
Log after tiltdemo
2023-04-20 23-38-54.txt

This might actually be required for the Xbox Kinect v1 now that I think about it! On an actual Xbox, when you start it up, the Kinect camera does that 'calibration' scan where it tilts it's camera all the way up and then all the way down. The green light only turns solid after that. If you interrupt it, the Xbox freaks out.
I wonder why there's so many missing packets? The usb cord isn't lossy and the power supply is stable...
Maybe the kinect is a different framerate?

@PoorPocketsMcNewHold
Copy link

image
Tried installing it onto my local repo obs-studio package, but it doesn't detect my KinectV1 (Xbox 360) despite working seemingly well with libfreenect (Fedora native repo package, as suggested by freenect).
I put the 64 bit .so libraries in /usr/lib64/obs-plugins/ and the rest of the plugin files in /usr/share/obs/obs-plugins/obs-kinect/
From the logs, there's nothing specific reported when adding the kinect source, and trying to refresh the kinect devices and the such.
11:46:07.430: User added source 'Kinect' (kinect_source) to scene 'Screen'
However, I saw a couple of path related issues when obs try to load the external libraries.

11:38:01.861: os_dlopen(/usr//lib64/obs-plugins/obs-kinect-azuresdk.so->/usr//lib64/obs-plugins/obs-kinect-azuresdk.so): libk4a.so.1.4: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.861: 
11:38:01.868: os_dlopen(/usr//lib64/obs-plugins/obs-kinect-azuresdk.so->/usr//lib64/obs-plugins/obs-kinect-azuresdk.so): libk4a.so.1.4: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.868: 
11:38:01.868: Module '/usr//lib64/obs-plugins/obs-kinect-azuresdk.so' not loaded
11:38:01.877: os_dlopen(/usr//lib64/obs-plugins/obs-kinect-freenect2.so->/usr//lib64/obs-plugins/obs-kinect-freenect2.so): libfreenect2.so.0.2: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.877: 
11:38:01.884: os_dlopen(/usr//lib64/obs-plugins/obs-kinect-freenect2.so->/usr//lib64/obs-plugins/obs-kinect-freenect2.so): libfreenect2.so.0.2: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.884: 
11:38:01.884: Module '/usr//lib64/obs-plugins/obs-kinect-freenect2.so' not loaded
11:38:01.946: os_dlopen(obs-kinect-azuresdk->obs-kinect-azuresdk.so): obs-kinect-azuresdk.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.946: 
11:38:01.947: os_dlopen(./obs-kinect-azuresdk->./obs-kinect-azuresdk.so): ./obs-kinect-azuresdk.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(/app/plugins/lib/obs-plugins/obs-kinect-azuresdk->/app/plugins/lib/obs-plugins/obs-kinect-azuresdk.so): /app/plugins/lib/obs-plugins/obs-kinect-azuresdk.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(obs-kinect-freenect->obs-kinect-freenect.so): obs-kinect-freenect.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(./obs-kinect-freenect->./obs-kinect-freenect.so): ./obs-kinect-freenect.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(/app/plugins/lib/obs-plugins/obs-kinect-freenect->/app/plugins/lib/obs-plugins/obs-kinect-freenect.so): /app/plugins/lib/obs-plugins/obs-kinect-freenect.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(obs-kinect-freenect2->obs-kinect-freenect2.so): obs-kinect-freenect2.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(./obs-kinect-freenect2->./obs-kinect-freenect2.so): ./obs-kinect-freenect2.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(/app/plugins/lib/obs-plugins/obs-kinect-freenect2->/app/plugins/lib/obs-plugins/obs-kinect-freenect2.so): /app/plugins/lib/obs-plugins/obs-kinect-freenect2.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(obs-kinect-sdk10->obs-kinect-sdk10.so): obs-kinect-sdk10.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(./obs-kinect-sdk10->./obs-kinect-sdk10.so): ./obs-kinect-sdk10.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(/app/plugins/lib/obs-plugins/obs-kinect-sdk10->/app/plugins/lib/obs-plugins/obs-kinect-sdk10.so): /app/plugins/lib/obs-plugins/obs-kinect-sdk10.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(obs-kinect-sdk20->obs-kinect-sdk20.so): obs-kinect-sdk20.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(./obs-kinect-sdk20->./obs-kinect-sdk20.so): ./obs-kinect-sdk20.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 
11:38:01.947: os_dlopen(/app/plugins/lib/obs-plugins/obs-kinect-sdk20->/app/plugins/lib/obs-plugins/obs-kinect-sdk20.so): /app/plugins/lib/obs-plugins/obs-kinect-sdk20.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
11:38:01.947: 

"Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type" is French for "Can't open the shared library: No file or folder of that type" or something along those lines. Seems obvious when it list "/usr//lib64" instead of just "/usr/lib64".

@djpiper28
Copy link

Hi there, sorry I am an OBS noob. I have the following issue on my machines (mac and arch linux), I am assuming have skipped a very obvious step, please help.

obs-kinect on  master via 🌙 v5.4.6
❯ xmake build
error: ./xmake.lua:120: attempt to index a nil value (global 'LibObs')
stack traceback:
    [./xmake.lua:120]: in main chunk

checking for platform ... macosx
checking for architecture ... arm64
checking for Xcode directory ... %s
checking for Codesign Identity of Xcode ... no
error: ./xmake.lua:120: attempt to index a nil value (global 'LibObs')
stack traceback:
    [./xmake.lua:120]: in main chunk

@JustCryen
Copy link

JustCryen commented Jul 12, 2024

@djpiper28 On Arch you can use an obs-kinect-bin package from the AUR.
Do let me know if obs-kinect works for you as in my case it can't seem to find any devices.
FYI I'm trying to get it working with Kinect v2

@djpiper28
Copy link

Arch package won't install for me

@JustCryen
Copy link

@djpiper28 I just installed it 2 days ago. I remember having some issues before. Not sure what failed for you but be sure you have libfreenect and libfreenect2 installed before installing this package.

@djpiper28
Copy link

[ 88%] Linking CXX executable ../../bin/freenect-cpp_pcview
[ 88%] Built target freenect-cpp_pcview
[ 90%] Generating freenect3.c
[ 91%] Building C object wrappers/python/CMakeFiles/cython3_freenect.dir/freenect3.c.o
In file included from /usr/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1909,
                 from /usr/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                 from /usr/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                 from /home/danny/.cache/yay/libfreenect/src/build/wrappers/python/freenect3.c:756:
/usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
/home/danny/.cache/yay/libfreenect/src/build/wrappers/python/freenect3.c: In function ‘__pyx_pymod_exec_freenect’:
/home/danny/.cache/yay/libfreenect/src/build/wrappers/python/freenect3.c:11918:3: error: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion]
11918 |   import_array();
      |   ^~~~~~~~~~~~
make[2]: *** [wrappers/python/CMakeFiles/cython3_freenect.dir/build.make:80: wrappers/python/CMakeFiles/cython3_freenect.dir/freenect3.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:759: wrappers/python/CMakeFiles/cython3_freenect.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: libfreenect-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
libfreenect - exit status 4

^^ for libfreenect, same for libfreenect-sirlynix-git

@JustCryen
Copy link

@djpiper28 try libfreenect-git from the AUR.

@weirdal3333
Copy link

Tried all of the packages on many different operating systems, and none of them work. They all spit out different errors. It's great that the devs have managed to bodge together something that worked for them, but they also seem to have abandoned the project. Anyone have any other way to get this camera working on linux?

@SirLynix
Copy link
Owner Author

SirLynix commented Jul 29, 2024

It's not really that I have abandonned the project but rather that the only Linux I have (and work with) are servers or VM that can't use Kinect.

obs-kinect works on Linux but distributing it is really complicated for me as there are many ways to install OBS.

I think the main blocking points are that with Kinect v1 you need to use my own libfreenect fork (https://github.com/SirLynix/libfreenect) (#83) - which xmake uses - and the way obs-kinect is distributed and loads its backend libraries: https://github.com/SirLynix/obs-kinect/blob/master/src/obs-kinect/KinectPlugin.cpp#L43-L53

I'm sure this can be improved to help supporting Linux but I don't know how and don't have much time to install Linux on my own computer to try it out, however I'd be glad to help if I can.

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