Posted: . At: 10:34 AM. This was 5 months ago. Post ID: 18842
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Using an Xbox 360 Kinect on Linux is very easy.


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.

90-kinect2.rules
# 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.

Bash
┏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.

Xbox 360 Kinect running on Ubuntu with libFreeNect.

Or, use this for a better camera view. This will open the depth view and the camera view in separate windows.

Bash
┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:~$ freenect-hiview

Use freenect-tiltdemo to test the tilting movement of the Xbox Kinect device. This is fun to watch.

Bash
┏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.

Xbox 360 Kinect alternate camera view.

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.

https://www.temu.com/goods.html?_bg_fs=1&goods_id=601099519525823&_x_sessn_id=0xajn3kdxo&refer_page_name=bgt_order_detail&refer_page_id=10045_1701300252724_sjlg08odf6&refer_page_sn=10045. Temu website.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.