-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preliminary audio support #217
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit supports streaming of audio from the four microphones. We still need to implement timestamps, user-provided audio (for cancellation), and firmware upload support. But if you have already loaded the firmware (say, with NUIse), this works great. Due to the way we're handling isochronous transfers in libusbemu, this will probably not work on Windows yet. To enable audio, add -DBUILD_AUDIO to your cmake command line or enable the BUILD_AUDIO option in the cmake gui. Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
This commit adds a python script to download and extract the audio firmware. Since we do not have permission to redistribute the audio firmware itself, we add a build option (BUILD_REDIST_PACKAGE) to disable adding the firmware to the install and instead shipping the firmware fetcher program. Packagers should enable this option and add a postinstallation hook that downloads and places the firmware in /usr/share/libfreenect/. Users should leave this option disabled, but should NOT redistribute packages or firmware. Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
This patch separates audio support out into a separate libfreenect-audio.h header. It updates the CMake lists to place audio support files (either fwfetcher.py or audios.bin) in the appropriate install folder, rather than under $PREFIX/lib. To support uploading the audio firmware, I added two new calls to our libusb wrapper - we need bulk transfer support to actually send the firmware, and we need to count the number of interfaces in the current configuration to distinguish a device in the bootloader from one which has already had firmware uploaded. These calls will need to be implemented in libusbemu before audio will work on Windows. Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
… paths. The firmware uploader will look for audios.bin in the following locations: $LIBFREENECT_FIRMWARE_PATH/ ./ ~/.libfreenect/ /usr/local/share/libfreenect/audios.bin /usr/share/libfreenect/audios.bin Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
This program should show the audio waveforms that are being received in real time. Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
If you enabled BUILD_AUDIO but not BUILD_PYTHON, then nothing ever included FindPythonInterp, so PYTHON_EXECUTABLE path wouldn't be set, and fwfetcher.py would be the first argument in the call to download the firmware. Since fwfetcher.py is not marked executable, this would fail. Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
zarvox
added a commit
that referenced
this pull request
Jul 9, 2011
Preliminary audio support This patchset adds support for obtaining the audio core firmware, booting the audio core, and streaming audio from the four microphones. A demonstration is provided in examples/wavrecord.c, which writes each microphone's output to a WAV file. A viewer is provided in examples/micview.c, which draws the waveforms of the four microphones to the screen in realtime. Since audio can't be supported on Windows without a different firmware and driver, I've made audio support a build-time option (BUILD_AUDIO). Due to the questionable legality of directly redistributing the audio core firmware, I've added a python script which downloads the latest Xbox360 firmware update from Microsoft and extracts the firmware from that .zip file. The firmware is installed as $PREFIX/share/audios.bin, which is great for people running straight from the source, but we also have people who want to use binary packages. For them (and their heroic packagers), I've added a build option BUILD_REDIST_PACKAGE that provides the fwfetcher.py script, rather than audios.bin (which would probably be illegal to redistribute directly). Packages should include a postinstallation hook to download the firmware and place it in /usr/share/libfreenect/, or something of the sort. This patch adds more API than it guarantees is correctly implemented; further, timestamps need to be added somewhere, so this API is by no means stable. Relevant declarations are contained in a new header: libfreenect-audio.h.
Any news on the TODO? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patchset adds support for obtaining the audio core firmware, booting the audio core, and streaming audio from the four microphones. A demonstration is provided in examples/wavrecord.c, which writes each microphone's output to a WAV file.
Since audio can't be supported on Windows without some more libusbemu work, I've made audio support a build-time option (BUILD_AUDIO).
Due to the questionable legality of directly redistributing the audio core firmware, I've added a python script which downloads the latest Xbox360 firmware update from Microsoft and extracts the firmware from that .zip file. The firmware is installed as $PREFIX/share/audios.bin, which is great for people running straight from the source, but we also have people who want to use binary packages. For them (and their heroic packagers), I've added a build option BUILD_REDIST_PACKAGE that provides the fwfetcher.py script, rather than audios.bin (which would probably be illegal to redistribute directly). Packages should include a postinstallation hook to download the firmware and place it in /usr/share/libfreenect/, or something of the sort.
This patch adds more API than it guarantees is correctly implemented; further, timestamps need to be added somewhere, so this API is by no means stable. Relevant declarations are contained in a new header: libfreenect-audio.h.
TODO: