aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp-stream.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-10-11ALSA: firewire-lib: continue packet processing at detecting wrong CIP headersTakashi Sakamoto1-4/+6
In firewire-lib, isochronous packet streaming is stopped when detecting wrong value for FMT field of CIP headers. Although this is appropriate to IEC 61883-1 and 6, some BeBoB based devices with vendors' customization use invalid value to FMT field of CIP headers in the beginning of streaming. $ journalctl snd-bebob fw1.0: Detect unexpected protocol: 01000000 8000ffff I got this log with M-Audio FireWire 1814. In this line, the value of FMT field is 0x00, while it should be 0x10 in usual AMDTP. Except for the beginning, these devices continue to transfer packets with valid value for FMT field, except for the beginning. Therefore, in this case, firewire-lib should continue to process packets. The former implementation of firewire-lib performs it. This commit loosens the handling of wrong value, to continue packet processing in the case. Fixes: 414ba022a528 ('ALSA: firewire-lib: add support arbitrary value for fmt/fdf fields in CIP header') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: complete AM824 data block processing layerTakashi Sakamoto1-295/+21
This commit moves the codes related to data block processing from packet streaming layer to AM824 layer. Each driver initializes amdtp stream structure for AM824 data block by calling amdtp_am824_init(). Then, a memory block is allocated for AM824 specific structure. This memory block is released by calling amdtp_stream_destroy(). When setting streaming parameters, it calls amdtp_am824_set_parameters(). When starting packet streaming, it calls amdtp_stream_start(). When stopping packet streaming, it calls amdtp_stream_stop(). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: rename macros with AM824 prefixTakashi Sakamoto1-2/+2
This commit renames some macros just related to AM824 format. In later commit, they're moved to AM824 layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: rename PCM format helper functionTakashi Sakamoto1-4/+3
Setting the format of PCM substream to AMDTP stream structure is important to set a handler to copy actual PCM samples between buffers. The processing should be in data block processing layer because essentially it has no relationship to packet streaming. This commit renames PCM format setting function to prepare for integrating AM824 layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: move PCM substream constraint to AM824 layerTakashi Sakamoto1-5/+0
In IEC 61883-6, PCM frames are transferred in Multi Bit Linear Audio data channel. The data channel transfers 16/20/24 bit PCM samples. Thus, PCM substream has a constrain about it. This commit moves codes related to the constraint from packet streaming layer to AM824 data block processing layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: rename parameter setting function for AM824 with FDF fieldTakashi Sakamoto1-19/+2
The value of FDF field in CIP header is protocol-dependent. Thus, it's better to allow data block processing layer to decide the value in any timing. In AM824 data format, the value of FDF field in CIP header indicates N-flag and Nominal Sampling Frequency Code (sfc). The N-flag is for switching 'Clock-based rate control mode' and 'Command-based rate control mode'. In our implementation, 'Clock-based rate control mode' is just supported. Therefore, When sampling transfer frequency is decided, then the FDF can be set. This commit replaces 'amdtp_stream_set_parameters' with 'amdtp_am824_set_parameters' to set the FDF. This is the same timing to decide the ration between the number of data blocks and the number of PCM frames. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: add data block processing layer for AM824 formatTakashi Sakamoto1-3/+4
This commit adds data block processing layer for AM824 format. The new layer initializes streaming layer with its value for fmt field. Currently, most implementation of data block processing still remains streaming layer. In later commits, these codes will be moved to the layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: rename 'amdtp' to 'amdtp-stream' to prepare for functional separationTakashi Sakamoto1-0/+1157
In later commit, data block processing layer will be newly added. This layer will be named as 'amdtp-am824'. This commit renames current amdtp file to amdtp-stream, to distinguish it from the new layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>