diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-09-30 03:39:17 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-09-30 16:34:25 +0300 |
commit | 163ae6f3f3f059ab44311792af5a73f70f747263 (patch) | |
tree | f746842349ebf50a7bcdc9f8971b25c225a2fb05 /sound/firewire/digi00x/digi00x.h | |
parent | 9edf723fd85822c7b7d8ef4f41a74c5a33eeca0c (diff) | |
download | linux-163ae6f3f3f059ab44311792af5a73f70f747263.tar.xz |
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>
Diffstat (limited to 'sound/firewire/digi00x/digi00x.h')
-rw-r--r-- | sound/firewire/digi00x/digi00x.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/firewire/digi00x/digi00x.h b/sound/firewire/digi00x/digi00x.h index 0bb2ca3ae471..fe21d7778004 100644 --- a/sound/firewire/digi00x/digi00x.h +++ b/sound/firewire/digi00x/digi00x.h @@ -19,8 +19,12 @@ #include <sound/core.h> #include <sound/initval.h> +#include <sound/pcm.h> +#include <sound/pcm_params.h> #include "../lib.h" +#include "../iso-resources.h" +#include "../amdtp-stream.h" struct snd_dg00x { struct snd_card *card; @@ -29,4 +33,14 @@ struct snd_dg00x { struct mutex mutex; }; +int amdtp_dot_init(struct amdtp_stream *s, struct fw_unit *unit, + enum amdtp_stream_direction dir); +int amdtp_dot_set_parameters(struct amdtp_stream *s, unsigned int rate, + unsigned int pcm_channels, + unsigned int midi_ports); +void amdtp_dot_reset(struct amdtp_stream *s); +int amdtp_dot_add_pcm_hw_constraints(struct amdtp_stream *s, + struct snd_pcm_runtime *runtime); +void amdtp_dot_set_pcm_format(struct amdtp_stream *s, snd_pcm_format_t format); + #endif |