I recently purchased an Xbox 360 Kinect and an adapter to connect it to a PC. I was trying to use Alma Linux to use this hardware and had no luck. I booted into Ubuntu 23.04 and I got it to work. I installed the required libraries.
┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:~$ sudo apt install libfreenect0.5
[sudo] password for jcartwright:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
libfreenect0.5
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 41.2 kB of archives.
After this operation, 146 kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com/ubuntu mantic/universe amd64 libfreenect0.5 amd64 1:0.5.3-3build1 [41.2 kB]
Fetched 41.2 kB in 0s (196 kB/s)
Selecting previously unselected package libfreenect0.5:amd64.
(Reading database ... 215824 files and directories currently installed.)
Preparing to unpack .../libfreenect0.5_1%3a0.5.3-3build1_amd64.deb ...
Unpacking libfreenect0.5:amd64 (1:0.5.3-3build1) ...
Setting up libfreenect0.5:amd64 (1:0.5.3-3build1) ...
Processing triggers for libc-bin (2.38-1ubuntu6) ...
Then install the required software to use the hardware.
┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:~$ sudo apt install freenect
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libfreenect-bin libfreenect-dev libfreenect-doc libglut3.12 libusb-1.0-0-dev libusb-1.0-doc
The following NEW packages will be installed:
freenect libfreenect-bin libfreenect-dev libfreenect-doc libglut3.12 libusb-1.0-0-dev libusb-1.0-doc
0 upgraded, 7 newly installed, 0 to remove and 4 not upgraded.
Need to get 573 kB of archives.
After this operation, 3,647 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://au.archive.ubuntu.com/ubuntu mantic/universe amd64 libglut3.12 amd64 3.4.0-1 [97.9 kB]
Get:2 http://au.archive.ubuntu.com/ubuntu mantic/main amd64 libusb-1.0-0-dev amd64 2:1.0.26-1 [76.4 kB]
Get:3 http://au.archive.ubuntu.com/ubuntu mantic/main amd64 libusb-1.0-doc all 2:1.0.26-1 [183 kB]
Get:4 http://au.archive.ubuntu.com/ubuntu mantic/universe amd64 libfreenect-bin amd64 1:0.5.3-3build1 [55.0 kB]
Get:5 http://au.archive.ubuntu.com/ubuntu mantic/universe amd64 libfreenect-dev amd64 1:0.5.3-3build1 [14.5 kB]
Get:6 http://au.archive.ubuntu.com/ubuntu mantic/universe amd64 libfreenect-doc all 1:0.5.3-3build1 [143 kB]
Get:7 http://au.archive.ubuntu.com/ubuntu mantic/universe amd64 freenect amd64 1:0.5.3-3build1 [3,388 B]
Fetched 573 kB in 0s (1,600 kB/s)
Once this was done, I had to install a rules file under the /etc/udev/rules.d/ directory.
# this file belongs in /etc/udev/rules.d/
# ATTR{product}=="Kinect2"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c4", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d8", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d9", MODE="0666"
This is required to allow hardware access, much as I had to do when I set up my SDR dongle.
Then, once you have unplugged and replugged the device, use this command to test the camera.
┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:~$ freenect-glview
This should pop up a window and allow you to see the camera views. This is working very well. Not hard to set up at all.
Or, use this for a better camera view. This will open the depth view and the camera view in separate windows.
┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:~$ freenect-hiview
Use freenect-tiltdemo to test the tilting movement of the Xbox Kinect device. This is fun to watch.
┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:~$ freenect-tiltdemo
led[1] tilt[-13] accel[0.227505,9.567171,2.215177]
led[5] tilt[-9] accel[0.131713,9.615067,-2.143334]
led[0] tilt[-8] accel[0.227505,9.662963,-1.664376]
led[2] tilt[10] accel[0.227505,9.662963,-1.664376]
led[3] tilt[14] accel[0.083818,9.662963,1.879907]
led[3] tilt[-10] accel[0.059870,9.471380,2.263073]
led[0] tilt[-2] accel[0.131713,9.662963,-1.568585]
led[4] tilt[2] accel[0.047896,9.854546,-0.227505]
This was not too hard to do, and it was fun to play with the Kinect camera.
Press f when using freenect-glview to change the video format.
I used this adapter to connect the Kinect to a PC, this required an adapter to work in a 240v socket, but it works perfectly.