From: Antonio Ospite Date: Sat, 9 Jan 2016 14:16:50 +0000 (+0100) Subject: Merge tag 'v0.5' into debian X-Git-Url: https://git.ao2.it/kinect-audio-setup.git/commitdiff_plain/afb13862732bf152b6226860c2285e0b03780870?hp=43f54e5f0e63594690631600175a231060034bd7 Merge tag 'v0.5' into debian Release v0.5 --- diff --git a/Makefile b/Makefile index b3b755d..28813ba 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ all: - $(MAKE) -C kinect_upload_fw + $(MAKE) -C kinect_upload_fw install: $(MAKE) -C kinect_upload_fw install + +install_udev_rules: install -d $(DESTDIR)/lib/udev/rules.d install -m 644 contrib/55-kinect_audio.rules.in $(DESTDIR)/lib/udev/rules.d/55-kinect_audio.rules + ./kinect_patch_udev_rules \ + "$(FIRMWARE_PATH)" \ + "$(LOADER_PATH)" \ + "$(DESTDIR)/lib/udev/rules.d/55-kinect_audio.rules" clean: $(MAKE) -C kinect_upload_fw clean - -changelog: - git log --pretty="format:%ai %aN <%aE>%n%n%x09* %s%d%n" > ChangeLog diff --git a/NEWS b/NEWS index abd781d..4f956e9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,13 @@ +News for v0.5: +============== + + * Fix broken links to the Kinect For Windows EULA + * kinect_fetch_fw: save the firmware as UACFirmware instead of + UACFirmware.C9C6E852_35A3_41DC_A57D_BDDEB43DFD04 + * Add a kinect_patch_udev_rules script to improve the installation of the + udev rules file provided in contrib/ + * Makefile: add a install_udev_rules target + News for v0.4: ============== diff --git a/README b/README index 9e9bf1a..fb0d057 100644 --- a/README +++ b/README @@ -34,6 +34,12 @@ Install kinect_upload_fw first: it will be copied to /usr/local/sbin by default, assign the PREFIX variable on the command line to install it to another location. +Then install the udev rules to automate the firmware loading: + + # make install_udev_rules \ + FIRMWARE_PATH=/lib/firmware/kinect/UACFirmware + LOADER_PATH=/usr/local/sbin/kinect_upload_fw + Then run the firmware fetcher script (remember this is only needed once): @@ -43,7 +49,7 @@ once): The UAC firmware is downloaded from the Microsoft Kinect SDK at http://www.kinectforwindows.org, the license of the SDK can be found at -http://www.kinectforwindows.org/download/EULA.htm +http://research.microsoft.com/en-us/um/legal/kinectsdk-tou_noncommercial.htm === Acknowledgements diff --git a/kinect_fetch_fw b/kinect_fetch_fw index 28a9fe7..3459dca 100755 --- a/kinect_fetch_fw +++ b/kinect_fetch_fw @@ -1,8 +1,8 @@ #!/bin/sh # -# kinect_fetch_fw - Fetch and install the Microsoft Kinect UAC firmware +# kinect_fetch_fw - Fetch and install the Microsoft Kinect UAC firmware # -# Copyright (C) 2011 Antonio Ospite +# Copyright (C) 2011-2016 Antonio Ospite # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it @@ -21,9 +21,8 @@ set -e SDK_URL=${SDK_URL:-"http://download.microsoft.com/download/F/9/9/F99791F2-D5BE-478A-B77A-830AD14950C3/KinectSDK-v1.0-beta2-x86.msi"} SDK_MD5="40764fe9e00911bda5095e5be777e311" -[ $# -lt 1 ] && { echo "usage: $(basename "$0") []" 1>&2; exit 1; } -FW_DESTDIR=$(readlink -f $1) -LOADER_PATH=${2:-"/usr/local/sbin/kinect_upload_fw"} +[ $# -lt 1 ] && { echo "usage: $(basename "$0") " 1>&2; exit 1; } +FW_DESTDIR=$(readlink -m $1) command -v wget >/dev/null 2>&1 || { echo "$(basename "$0"): command 'wget' is needed." 1>&2 ; exit 1; } command -v 7z >/dev/null 2>&1 || { echo "$(basename "$0"): command '7z' is needed." 1>&2; exit 1; } @@ -34,12 +33,12 @@ trap "exit 2" 1 2 3 15 cat << EOM -This script is going to download the UAC Firmware for the Microsoft +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/ The full license of the SDK can be found at: -http://www.kinectforwindows.org/download/EULA.htm +http://research.microsoft.com/en-us/um/legal/kinectsdk-tou_noncommercial.htm EOM @@ -59,15 +58,7 @@ echo -n "Extracting the UAC firmware..." echo " done." FW_FILE=$(ls UACFirmware.* | cut -d ' ' -f 1) +FIRMWARE_PATH="${FW_DESTDIR}/UACFirmware" -install -d "${DESTDIR}${FW_DESTDIR}" -install -m 644 "$FW_FILE" "${DESTDIR}${FW_DESTDIR}" - -FIRMWARE_PATH=$FW_DESTDIR/$(basename "$FW_FILE") - -if [ -f "${DESTDIR}/lib/udev/rules.d/55-kinect_audio.rules" ]; -then - sed -e "s|@LOADER_PATH@|$LOADER_PATH|g" \ - -e "s|@FIRMWARE_PATH@|$FIRMWARE_PATH|g" \ - -i "${DESTDIR}/lib/udev/rules.d/55-kinect_audio.rules" -fi +install -d "$FW_DESTDIR" +install -m 644 "$FW_FILE" "$FIRMWARE_PATH" diff --git a/kinect_patch_udev_rules b/kinect_patch_udev_rules new file mode 100755 index 0000000..85027ce --- /dev/null +++ b/kinect_patch_udev_rules @@ -0,0 +1,36 @@ +#!/bin/sh +# +# kinect_patch_udev_rules - Patch contrib/ udev rules file to load UACFirmware +# +# Copyright (C) 2016 Antonio Ospite +# +# This program is free software. It comes without any warranty, to +# the extent permitted by applicable law. You can redistribute it +# and/or modify it under the terms of the Do What The Fuck You Want +# To Public License, Version 2, as published by Sam Hocevar. See +# http://sam.zoy.org/wtfpl/COPYING for more details. + +set -e + +[ $# -lt 3 ] && { echo "usage: $(basename "$0") <55-kinect_audio.rules path>" 1>&2; exit 1; } +FIRMWARE_PATH="$1" +LOADER_PATH="$2" +UDEV_RULES_PATH="$3" + +[ "x$FIRMWARE_PATH" != "x" ] || { echo "Empty FIRMWARE_PATH" 1>&2; exit 1;} +[ "x$LOADER_PATH" != "x" ] || { echo "Empty LOADER_PATH" 1>&2; exit 1;} + +# The udev rules file must exist the other files may not exist just yet: they +# may be under a prefixed path different from the final one, like in the case +# when this is called at package creation time. +[ -f "$UDEV_RULES_PATH" ] || { echo "Cannot find the udev rules file: $UDEV_RULES_PATH" 1>&2; exit 1; } + +if grep -q "@LOADER_PATH@ @FIRMWARE_PATH@" "$UDEV_RULES_PATH"; +then + sed -e "s|@LOADER_PATH@|${LOADER_PATH}|g" \ + -e "s|@FIRMWARE_PATH@|${FIRMWARE_PATH}|g" \ + -i "$UDEV_RULES_PATH" +else + echo "$UDEV_RULES_PATH does not contain the expected placeholders." 2>&1 + exit 1 +fi diff --git a/kinect_upload_fw/kinect_upload_fw.c b/kinect_upload_fw/kinect_upload_fw.c index b258ba0..1bd4102 100644 --- a/kinect_upload_fw/kinect_upload_fw.c +++ b/kinect_upload_fw/kinect_upload_fw.c @@ -1,5 +1,6 @@ /* * Copyright 2011 Drew Fisher . All rights reserved. + * Copyright (C) 2016 Antonio Ospite * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -305,7 +306,7 @@ int main(int argc, char *argv[]) { goto out_libusb_close; } - /* + /* * Checking that the configuration has not changed, as suggested in * http://libusb.sourceforge.net/api-1.0/caveats.html */ diff --git a/windows/README.asciidoc b/windows/README.asciidoc index 00ec5e4..646f309 100644 --- a/windows/README.asciidoc +++ b/windows/README.asciidoc @@ -40,16 +40,16 @@ Compiling kinect_upload_fw Using kinect_upload_fw.exe on Windows ------------------------------------- -First of all, make sure the drivers from ''libfreenect'' are installed, they are +First of all, make sure the drivers from ''libfreenect'' are installed, they are under ''platform/windows/inf''. Download the MSR Kinect SDK from: http://download.microsoft.com/download/8/4/C/84C9EF40-EE49-42C2-AE26-C6E30921182F/KinectSDK32.msi -Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the -''media1.cab'' file in it and extract the firmware file from ''media1.cab'', the +Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the +''media1.cab'' file in it and extract the firmware file from ''media1.cab'', the firmware file is named ''UACFirmware.*''. -Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat'' -file in the same directory and double_click on the ''kinect_upload_fw.bat'' +Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat'' +file in the same directory and double_click on the ''kinect_upload_fw.bat'' file. diff --git a/windows/kinect_upload_fw.bat b/windows/kinect_upload_fw.bat index 3757670..d388666 100644 --- a/windows/kinect_upload_fw.bat +++ b/windows/kinect_upload_fw.bat @@ -1,14 +1,14 @@ -REM First of all, make sure the drivers from ''libfreenect'' are installed, +REM First of all, make sure the drivers from ''libfreenect'' are installed, REM they are in ''platform/windows/inf'' in the libfreenect code base.. -REM +REM REM Download the MSR Kinect SDK from: REM http://download.microsoft.com/download/8/4/C/84C9EF40-EE49-42C2-AE26-C6E30921182F/KinectSDK32.msi -REM -REM Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the +REM +REM Explore ''KinectSDK32.msi'' using 7-zip from http://www.7-zip.org, extract the REM ''media1.cab'' file in it and get the firmware file, named ''UACFirmware.*'' -REM -REM Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat'' -REM file in the same directory and double_click on the ''kinect_upload_fw.bat'' +REM +REM Put ''kinect_upload_fw.exe'', the firmware file and ''kinect_upload_fw.bat'' +REM file in the same directory and double_click on the ''kinect_upload_fw.bat'' REM file. Set FIRMWARE="UACFirmware.C9C6E852_35A3_41DC_A57D_BDDEB43DFD04"