ALSA: firewire-digi00x: add data block processing layer
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 30 Sep 2015 00:39:17 +0000 (09:39 +0900)
committerTakashi Iwai <tiwai@suse.de>
Wed, 30 Sep 2015 13:34:25 +0000 (15:34 +0200)
commit163ae6f3f3f059ab44311792af5a73f70f747263
treef746842349ebf50a7bcdc9f8971b25c225a2fb05
parent9edf723fd85822c7b7d8ef4f41a74c5a33eeca0c
ALSA: firewire-digi00x: add data block processing layer

Digi 002/003 family uses its own format for data blocks. The format is
quite similar to AM824 in IEC 61883-6, while there're some differences:

 * The Valid Bit Length (VBL) code is always 0x40 in Multi-bit Linear Audio
   (MBLA) data channel.
 * The first data channel includes MIDI messages, against IEC 61883-6
   recommendation.
 * The Counter field is always zero in MIDI conformant data channel.
 * Sequence multiplexing in IEC 61883-6 is not applied to the MIDI
   conformant data channel.
 * PCM samples are scrambled in received AMDTP packets. We call the way
   as Double-Oh-Three (DOT). The algorithm was discovered by
   Robin Gareus and Damien Zammit in 2012.

This commit adds data processing layer to satisfy these differences.

There's a quirk about transmission mode for received packets. When this
driver applies non-blocking mode to outgoing packets with isochronous
channel 2 or more, after 15 to 20 seconds since playbacking, any PCM
samples causes noisy sound on the device. With isochronous channel 0 or 1,
this doesn't occur. As long as I investigated, this quirk is not observed
when applying blocking mode to the received packets.

This driver applies blocking mode to outgoing packets, while non-blocking
mode to incoming packgets.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/digi00x/Makefile
sound/firewire/digi00x/amdtp-dot.c [new file with mode: 0644]
sound/firewire/digi00x/digi00x.h