firewire-lib: Use IEC 61883-6 compliant labels for Raw Audio data
diff mbox

Message ID 1401641416-14127-1-git-send-email-o-takashi@sakamocchi.jp
State Accepted
Commit a6975f2af8a5d72b822e51b79894c81151d4e963
Headers show

Commit Message

Takashi Sakamoto June 1, 2014, 4:50 p.m. UTC
According to AM824 in IEC 61883-6:2002, 2 bits in LSB of label for Raw Audio
data means Valid Length Code (VBL). Ths value is:
- b00 for 24 bits sample (label is 0x40)
- b01 for 20 bits sample (label is 0x41)
- b10 for 16 bits sample (label is 0x42)

But current firewire-lib apply 24 bits label for both of 16/24 bits samples.

As long as developers investigate BeBoB/Fireworks/OXFW/Dice, all of them
have a behaviour to ignore the label. They can generate correct sound even
if firewire-lib gives wrong label (i.e. 0xff). On BeBoB, this is not only
for Raw Audio data channel, but also for IEC 60958 Conformant data channel.

So there is little possibility of regression.

Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/amdtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Takashi Iwai June 2, 2014, 6:53 a.m. UTC | #1
At Mon,  2 Jun 2014 01:50:16 +0900,
Takashi Sakamoto wrote:
> 
> According to AM824 in IEC 61883-6:2002, 2 bits in LSB of label for Raw Audio
> data means Valid Length Code (VBL). Ths value is:
> - b00 for 24 bits sample (label is 0x40)
> - b01 for 20 bits sample (label is 0x41)
> - b10 for 16 bits sample (label is 0x42)
> 
> But current firewire-lib apply 24 bits label for both of 16/24 bits samples.
> 
> As long as developers investigate BeBoB/Fireworks/OXFW/Dice, all of them
> have a behaviour to ignore the label. They can generate correct sound even
> if firewire-lib gives wrong label (i.e. 0xff). On BeBoB, this is not only
> for Raw Audio data channel, but also for IEC 60958 Conformant data channel.
> 
> So there is little possibility of regression.
> 
> Acked-by: Clemens Ladisch <clemens@ladisch.de>
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied.


Takashi

> ---
>  sound/firewire/amdtp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
> index 31dd1cf..f96bf4c 100644
> --- a/sound/firewire/amdtp.c
> +++ b/sound/firewire/amdtp.c
> @@ -418,7 +418,7 @@ static void amdtp_write_s16(struct amdtp_stream *s,
>  	for (i = 0; i < frames; ++i) {
>  		for (c = 0; c < channels; ++c) {
>  			buffer[s->pcm_positions[c]] =
> -					cpu_to_be32((*src << 8) | 0x40000000);
> +					cpu_to_be32((*src << 8) | 0x42000000);
>  			src++;
>  		}
>  		buffer += s->data_block_quadlets;
> -- 
> 1.8.3.2
>

Patch
diff mbox

diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 31dd1cf..f96bf4c 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -418,7 +418,7 @@  static void amdtp_write_s16(struct amdtp_stream *s,
 	for (i = 0; i < frames; ++i) {
 		for (c = 0; c < channels; ++c) {
 			buffer[s->pcm_positions[c]] =
-					cpu_to_be32((*src << 8) | 0x40000000);
+					cpu_to_be32((*src << 8) | 0x42000000);
 			src++;
 		}
 		buffer += s->data_block_quadlets;