Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Bug in the generation of IEC958 subframes
@ 2005-11-16  0:45 Nicolas Boullis
  2005-11-17 12:09 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Boullis @ 2005-11-16  0:45 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Hi,

While working on an ALSA driver for the audio part of em8300-based MPEG 
decoder boards (Sigma Designs' Hollywood+ boards and Creative Labs' DXR3 
boards), I think I discovered a bug in the code that generates IEC958 
subframes from linear samples (iec958 plugin): M and W preambles are 
swapped, and B preambles should only be used on even subframes. The 
attached patch fixes this issue.

Moreover, (using debian's 1.0.9-3 package, I haven't checked with 
1.0.10rc3), I get segfaults whenever I try to specify the preambles in 
my ~/.asoundrc file.

(https://bugtrack.alsa-project.org/alsa-bug/ times out, that's why I'm 
sending this report here.)


Cheers,

Nicolas

PS: please CC replies to me, as I don't read the alsa-devel ML.

[-- Attachment #2: alsa-lib.patch --]
[-- Type: text/plain, Size: 668 bytes --]

diff -ruN alsa-lib-1.0.10rc3.orig/src/pcm/pcm_iec958.c alsa-lib-1.0.10rc3/src/pcm/pcm_iec958.c
--- alsa-lib-1.0.10rc3.orig/src/pcm/pcm_iec958.c	2005-05-24 16:14:35.000000000 +0200
+++ alsa-lib-1.0.10rc3/src/pcm/pcm_iec958.c	2005-11-16 01:35:46.000000000 +0100
@@ -116,10 +116,10 @@
 		data |= 0x80000000;
 
 	/* Preamble */
-	if (! iec->counter)
-		data |= iec->preamble[PREAMBLE_Z];	/* Block start, 'Z' */
-	else if (! channel)
+	if (channel)
 		data |= iec->preamble[PREAMBLE_Y];	/* odd sub frame, 'Y' */
+	else if (! iec->counter)
+		data |= iec->preamble[PREAMBLE_Z];	/* Block start, 'Z' */
 	else
 		data |= iec->preamble[PREAMBLE_X];	/* even sub frame, 'X' */
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-19  0:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-16  0:45 Bug in the generation of IEC958 subframes Nicolas Boullis
2005-11-17 12:09 ` Takashi Iwai
2005-11-17 19:47   ` Nicolas Boullis
2005-11-18 19:58     ` Takashi Iwai
2005-11-19  0:37       ` Nicolas Boullis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox