Open gataria opened 3 years ago
Sorry, forgot to attach install-webcam.sh
. Here is what I used:
apt-get install ffmpeg
echo "Cloning GSPCA Repo..."
git clone https://github.com/grandchild/gspca-kinect2.git && cd gspca-kinect2
echo "Building & Installing Modules (copying into /lib/modules/`uname -r`/kernel/drivers/kinect)"
make -C /lib/modules/`uname -r`/build M=`pwd` SRCROOT=`pwd` clean modules
cp gspca_main.ko gspca_kinect_main.ko
cp gspca_kinect_main.ko /lib/modules/`uname -r`/kernel/drivers/kinect/gspca_kinect_main.ko
cp gspca_kinect2.ko /lib/modules/`uname -r`/kernel/drivers/kinect/gspca_kinect2.ko
cd ..
echo "Cloning V4L2Loopback Repo..."
git clone https://github.com/umlaeute/v4l2loopback.git && cd v4l2loopback
echo "Building and Installing Modules"
make && make install
cd ..
echo "Resolving Module Dependencies"
depmod -a
echo "Enabling GSPCA & V4L2Loopback Modules at boot"
for module in "videodev" "gspca_kinect_main" "gspca_kinect2" "v4l2loopback"
do
if grep -Fxq $module /etc/modules
then
echo "$module found - skipping..."
else
echo "$module not found - adding to /etc/modules"
echo $module >> /etc/modules
fi
done
echo "options video_nr=10 card_label='Kinect v2'" > /etc/modprobe.d/v4l2loopback.conf
echo "Creating ffmpeg service v4l2-loopback.service"
echo "[Unit]
Description=V4L2 Loopback Service for Kinect Webcam
[Service]
Type=simple
ExecStart=ffmpeg -i /dev/video1 -vsync drop -filter:v fps=30,scale=1920:-1,hflip -pix_fmt yuyv422 -color_trc bt709 -color_primaries bt709 -color_range tv -f v4l2 /dev/video0
[Install]
WantedBy=multi-user.target" > /lib/systemd/system/v4l2-loopback.service
echo "Enabling v4l2-loopback.service at boot"
systemctl enable v4l2-loopback
I should also note that I disabled the v4l2-loopback.service
by issuing systemctl disable v4l2-loopback
and I commented out the modules that were added to /etc/modules
.
OS/Package information
Pop!_OS 20.10 x86_64
, based on Ubuntu 20.105.8.0-7642-generic
Relevant package versions:
alsa-base
:1.0.25+dfsg-0ubuntu5
Issue
Had to do some troubleshooting to figure out the issue, but I got to it: After compiling and installing this driver and restarting (@grandchild's fork in particular, using a slightly modified version of @SterlingButters's
install-webcam.sh
script that I have attached), the Kinect's webcam does appear to work as a v4l2 loopback device. However, after this, the Kinect's microphones came to be undetected by ALSA. Running ALSA'salsa-info.sh
troubleshooting script (from https://www.alsa-project.org/wiki/AlsaInfo looked to only show the following sound cards:0 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xf7080000 irq 107 1 [Generic ]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xf7900000 irq 110
Do not load gspca modules. Enabling them results in the Kinect refusing to work as a microphone.
blacklist gspca_kinect2 blacklist gspca_main
!!Soundcards recognised by ALSA !!-----------------------------
0 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xf7080000 irq 107 1 [Sensor ]: USB-Audio - Xbox NUI Sensor Microsoft Xbox NUI Sensor at usb-0000:02:00.0-4, super speed 2 [Generic ]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xf7900000 irq 109
I'm not sure if there's just some conflict between ALSA and the modules that use the Kinect as a webcam, but hopefully there's a way to resolve this problem. I figure that not only would someone want to use the Kinect as a webcam, but also as a microphone as well. It's also possible that this is just an issue with my own system -- I did have to screw around with multiple programs to be able to successfully use the Kinect as a webcam (which may have screwed with some things I'm unaware of), and I'm not certain if I ever did or did not see the webcam and microphone working at the same time -- so hopefully creating an issue helps in making sure whether or not this is a unique issue.