$ arecord -l **** CAPTURE 하드웨어 장치 목록 **** 카드 0: sofhdadsp [sof-hda-dsp], 장치 0: HDA Analog (*) [] 주변장치: 1/1 주변장치 #0: subdevice #0 카드 0: sofhdadsp [sof-hda-dsp], 장치 1: HDA Digital (*) [] 주변장치: 1/1 주변장치 #0: subdevice #0 카드 0: sofhdadsp [sof-hda-dsp], 장치 6: DMIC (*) [] 주변장치: 1/1 주변장치 #0: subdevice #0 카드 0: sofhdadsp [sof-hda-dsp], 장치 7: DMIC16kHz (*) [] 주변장치: 1/1 주변장치 #0: subdevice #0
먼가 깔아야 한다고 해서 시도. 응 실패
$ sudo apt install kinect-audio-setup 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다... 완료 상태 정보를 읽는 중입니다... 완료 다음 새 패키지를 설치할 것입니다: kinect-audio-setup 0개 업그레이드, 1개 새로 설치, 0개 제거 및 13개 업그레이드 안 함. 16.3 k바이트 아카이브를 받아야 합니다. 이 작업 후 59.4 k바이트의 디스크 공간을 더 사용하게 됩니다. 받기:1 http://kr.archive.ubuntu.com/ubuntu jammy/multiverse amd64 kinect-audio-setup amd64 0.5-1build1 [16.3 kB] 내려받기 16.3 k바이트, 소요시간 1초 (31.8 k바이트/초) 패키지를 미리 설정하는 중입니다... Selecting previously unselected package kinect-audio-setup. (데이터베이스 읽는중 ...현재 486157개의 파일과 디렉터리가 설치되어 있습니다.) Preparing to unpack .../kinect-audio-setup_0.5-1build1_amd64.deb ... Unpacking kinect-audio-setup (0.5-1build1) ... kinect-audio-setup (0.5-1build1) 설정하는 중입니다 ...
This script is going to download the UAC Firmware for the Microsoft Kinect Sensor device from the Microsoft Kinect for Windows SDK: http://kinectforwindows.org/
$ sudo apt install kinect-audio-setup 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다... 완료 상태 정보를 읽는 중입니다... 완료 패키지 kinect-audio-setup는 이미 최신 버전입니다 (0.5-1build1). 0개 업그레이드, 0개 새로 설치, 0개 제거 및 13개 업그레이드 안 함. 1개를 완전히 설치하지 못했거나 지움. 이 작업 후 0 바이트의 디스크 공간을 더 사용하게 됩니다. 계속 하시겠습니까? [Y/n] kinect-audio-setup (0.5-1build1) 설정하는 중입니다 ...
This script is going to download the UAC Firmware for the Microsoft Kinect Sensor device from the Microsoft Kinect for Windows SDK: http://kinectforwindows.org/
$ ls -al /lib/firmware/kinect/ 합계 216 drwxr-xr-x 2 root root 4096 9월 18 14:59 . drwxr-xr-x 93 root root 77824 9월 18 14:59 .. -rw-r--r-- 1 root root 132096 9월 18 14:59 UACFirmware
udev도 추가되어있는데 반응이 없다.
$ cat /lib/udev/rules.d/*kinect* # Rule to load the Kinect UAC firmware on the "generic" usb device ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02ad", RUN+="/usr/sbin/kinect_upload_fw /lib/firmware/kinect/UACFirmware"
일단은 claude 답으로는 xbox360 용이 아닌 kienct for windows 라서 pid가 다르다고 한다.
02ad가 나와야 xbox 360 kinect 라고 한다. 그런데.. 리눅스에서 하려면 원래 오리지널을 써야하나?
$ lsusb | grep -i 045e Bus 001 Device 036: ID 045e:02bf Microsoft Corp. Kinect for Windows NUI Camera Bus 001 Device 035: ID 045e:02be Microsoft Corp. Kinect for Windows NUI Audio Bus 001 Device 034: ID 045e:02c2 Microsoft Corp. Kinect for Windows NUI Motor
const float *depth_data = (float*)depth->data; const unsigned int *rgb_data = (unsigned int*)rgb->data; float *undistorted_data = (float*)undistorted->data; unsigned int *registered_data = (unsigned int*)registered->data; const int *map_dist = distort_map; const float *map_x = depth_to_color_map_x; const int *map_yi = depth_to_color_map_yi;
const int size_depth = 512 * 424; const int size_color = 1920 * 1080; const float color_cx = color.cx + 0.5f; // 0.5f added for later rounding
// size of filter map with a border of filter_height_half on top and bottom so that no check for borders is needed. // since the color image is wide angle no border to the sides is needed. const int size_filter_map = size_color + 1920 * filter_height_half * 2; // offset to the important data const int offset_filter_map = 1920 * filter_height_half;
// map for storing the min z values used for each color pixel float *filter_map = NULL; // pointer to the beginning of the important data float *p_filter_map = NULL;
// map for storing the color offset for each depth pixel int *depth_to_c_off = color_depth_map ? color_depth_map : new int[size_depth]; int *map_c_off = depth_to_c_off;
// initializing the depth_map with values outside of the Kinect2 range if(enable_filter){ filter_map = bigdepth ? (float*)bigdepth->data : new float[size_filter_map]; p_filter_map = filter_map + offset_filter_map;
/* Fix depth distortion, and compute pixel to use from 'rgb' based on depth measurement, * stored as x/y offset in the rgb data. */
// iterating over all pixels from undistorted depth and registered color image // the four maps have the same structure as the images, so their pointers are increased each iteration as well for(int i = 0; i < size_depth; ++i, ++undistorted_data, ++map_dist, ++map_x, ++map_yi, ++map_c_off){ // getting index of distorted depth pixel const int index = *map_dist;
// check if distorted depth pixel is outside of the depth image if(index < 0){ *map_c_off = -1; *undistorted_data = 0; continue; }
// getting depth value for current pixel const float z = depth_data[index]; *undistorted_data = z;
// checking for invalid depth value if(z <= 0.0f){ *map_c_off = -1; continue; }
// calculating x offset for rgb image based on depth value const float rx = (*map_x + (color.shift_m / z)) * color.fx + color_cx; const int cx = rx; // same as round for positive numbers (0.5f was already added to color_cx) // getting y offset for depth image const int cy = *map_yi; // combining offsets const int c_off = cx + cy * 1920;
// check if c_off is outside of rgb image // checking rx/cx is not needed because the color image is much wider then the depth image if(c_off < 0 || c_off >= size_color){ *map_c_off = -1; continue; }
// saving the offset for later *map_c_off = c_off;
if(enable_filter){ // setting a window around the filter map pixel corresponding to the color pixel with the current z value int yi = (cy - filter_height_half) * 1920 + cx - filter_width_half; // index of first pixel to set for(int r = -filter_height_half; r <= filter_height_half; ++r, yi += 1920) // index increased by a full row each iteration { float *it = p_filter_map + yi; for(int c = -filter_width_half; c <= filter_width_half; ++c, ++it) { // only set if the current z is smaller if(z < *it) *it = z; } } } }
/* Construct 'registered' image. */
// reseting the pointers to the beginning map_c_off = depth_to_c_off; undistorted_data = (float*)undistorted->data;
/* Filter drops duplicate pixels due to aspect of two cameras. */ if(enable_filter){ // run through all registered color pixels and set them based on filter results for(int i = 0; i < size_depth; ++i, ++map_c_off, ++undistorted_data, ++registered_data){ const int c_off = *map_c_off;
// check if offset is out of image if(c_off < 0){ *registered_data = 0; continue; } f const float min_z = p_filter_map[c_off]; const float z = *undistorted_data;
// check for allowed depth noise *registered_data = (z - min_z) / z > filter_tolerance ? 0 : *(rgb_data + c_off); }
if (!bigdepth) delete[] filter_map; } else { // run through all registered color pixels and set them based on c_off for(int i = 0; i < size_depth; ++i, ++map_c_off, ++registered_data){ const int c_off = *map_c_off;
// check if offset is out of image *registered_data = c_off < 0 ? 0 : *(rgb_data + c_off); } } if (!color_depth_map) delete[] depth_to_c_off; }