39 memset(buffer, 0, 76);
89 if (block->
magic != 0x80000080) {
90 FN_ERROR(
"audio: invalid magic in iso IN packet: %08X\n", block->
magic);
101 for(t = 0; t < 10; t++) {
103 FN_SPEW(
"audio: did not receive data for channel 0x%02x\n", t+1);
130 FN_ERROR(
"audio: invalid channel in iso IN packet: %d\n", block->
channel);
135 }
else if (len == 60) {
137 }
else if (len != 0) {
138 FN_ERROR(
"audio: received an iso IN packet of strange length: %d\n", len);
162 for(i = 0; i < 4; i++) {
178 for(i = 0; i < 10; i++) {
185 FN_ERROR(
"audio: failed to start isochronous IN stream: %d\n", res);
190 FN_ERROR(
"audio: failed to start isochronous OUT stream: %d\n", res);
211 FN_ERROR(
"audio: failed to stop isochronous IN stream: %d\n", res);
216 FN_ERROR(
"audio: failed to stop isochronous OUT stream: %d\n", res);
229 for (i = 0; i < 4; i++) {
void(* freenect_audio_in_cb)(freenect_device *dev, int num_samples, int32_t *mic1, int32_t *mic2, int32_t *mic3, int32_t *mic4, int16_t *cancelled, void *unknown)
void(* freenect_audio_out_cb)(freenect_device *dev, freenect_sample_51 *samples, int *sample_count)
freenect_context * parent
FN_INTERNAL int fnusb_start_iso(fnusb_dev *dev, fnusb_isoc_stream *strm, fnusb_iso_cb cb, int ep, int xfers, int pkts, int len)
uint8_t out_window_parity
static void iso_out_callback(freenect_device *dev, uint8_t *pkt, int len)
FN_INTERNAL int fnusb_stop_iso(fnusb_dev *dev, fnusb_isoc_stream *strm)
uint8_t out_counter_within_window
fnusb_isoc_stream audio_in_isoc
Structure to represent a single 16-bit signed little-endian PCM sample.
freenect_sample_51 * audio_out_ring
static void iso_in_callback(freenect_device *dev, uint8_t *pkt, int len)
uint16_t out_weird_timestamp
void freenect_set_audio_in_callback(freenect_device *dev, freenect_audio_in_cb callback)
void freenect_set_audio_out_callback(freenect_device *dev, freenect_audio_out_cb callback)
int freenect_stop_audio(freenect_device *dev)
static freenect_context * ctx
static void prepare_iso_out_data(freenect_device *dev, uint8_t *buffer)
int freenect_start_audio(freenect_device *dev)
uint16_t last_seen_window[10]
fnusb_isoc_stream audio_out_isoc
freenect_audio_out_cb audio_out_cb
int16_t * cancelled_buffer
freenect_audio_in_cb audio_in_cb