Skip to contentSkip to conversation

ymfpci, big-endian, and spdif out

DISCUSSION Troy Benjegerdes 4 participants 16 messages Jan 3, 2003 – Jan 12, 2003

lore
Share & tools
lore
#0 lore raw

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with digital optical TOSlink input.

I'm trying to get xine or some other DVD player to output AC/3 sound to the receiver for watching dvd's, and I have a couple of problems.

1) xmms (and xine 2-channel sound) works with OSS emulation, but is static with native ALSA drivers. This seems like some endian problem

2) spdif out does not seem to work. Here are some of the messages from xine:

audio_alsa_out : supported modes are 8bit mono stereo (4-channel not enabled in xine config) (5-channel not enabled in xine config) (5.1-channel not enabled in xine config) a/52 and DTS pass-through

audio_out: stream audio format is 48000 kHz sampling rate, 16 bits. mode is 1.
audio_alsa_out: Audio Device name = iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
audio_alsa_out: Number of channels = 2
audio_alsa_out: pcm hw_params failed: No such device or ALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: No such device or addressALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: No such device or address

So where do I get started to fix this?

Also, where can I get some short raw AC3 encoded sounds to test with something like aplay?

Thanks!

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 28 lines · Troy Benjegerdes

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with digital optical TOSlink input.

I'm trying to get xine or some other DVD player to output AC/3 sound to the receiver for watching dvd's, and I have a couple of problems.

1) xmms (and xine 2-channel sound) works with OSS emulation, but is static with native ALSA drivers. This seems like some endian problem

2) spdif out does not seem to work. Here are some of the messages from xine:

audio_alsa_out : supported modes are 8bit mono stereo (4-channel not enabled in xine config) (5-channel not enabled in xine config) (5.1-channel not enabled in xine config) a/52 and DTS pass-through

audio_out: stream audio format is 48000 kHz sampling rate, 16 bits. mode is 1.
audio_alsa_out: Audio Device name = iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
audio_alsa_out: Number of channels = 2
audio_alsa_out: pcm hw_params failed: No such device or ALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: No such device or addressALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: No such device or address

Quoted 4 lines

So where do I get started to fix this?

Also, where can I get some short raw AC3 encoded sounds to test with something like aplay?

We have command-line ac3dec in our alsa-tools package.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#2 lore raw
Quoted 30 lines · Jaroslav Kysela
Quoted 28 lines · Troy Benjegerdes

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with digital optical TOSlink input.

I'm trying to get xine or some other DVD player to output AC/3 sound to the receiver for watching dvd's, and I have a couple of problems.

1) xmms (and xine 2-channel sound) works with OSS emulation, but is static with native ALSA drivers. This seems like some endian problem

2) spdif out does not seem to work. Here are some of the messages from xine:

audio_alsa_out : supported modes are 8bit mono stereo (4-channel not enabled in xine config) (5-channel not enabled in xine config) (5.1-channel not enabled in xine config) a/52 and DTS pass-through

audio_out: stream audio format is 48000 kHz sampling rate, 16 bits. mode is 1.
audio_alsa_out: Audio Device name = iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
audio_alsa_out: Number of channels = 2
audio_alsa_out: pcm hw_params failed: No such device or ALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: No such device or addressALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: No such device or address

Quoted 8 lines
Quoted 4 lines

So where do I get started to fix this?

Also, where can I get some short raw AC3 encoded sounds to test with something like aplay?

We have command-line ac3dec in our alsa-tools package.

Jaroslav

So what is the simplest command line options and .asoundrc config file setup I should try to verify if SPDIF AC/3 output works? I also need to get a short AC3 encoded sound file somewhere.. are there some directions or a FAQ on how to extract an AC3 sound file from a DVD?

Signature · 11 lines
Troy Benjegerdes | master of mispeeling | 'da hozer' |  [email protected]
-----"If this message isn't misspelled, I didn't write it" -- Me -----
"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't. That's 
why I draw cartoons. It's my life." -- Charles Schulz


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#3 lore raw
Quoted 2 lines · Troy Benjegerdes

So what is the simplest command line options and .asoundrc config file setup I should try to verify if SPDIF AC/3 output works? I also need to

It should work simply typing 'ac3dec -C <ac3file>'.

Quoted 2 lines

get a short AC3 encoded sound file somewhere.. are there some directions or a FAQ on how to extract an AC3 sound file from a DVD?

See alsa-tools/ac3dec/tools directory (there is extract_ac3 utility).

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#4 lore raw
In reply to Jaroslav Kysela
Quoted 3 lines

We have command-line ac3dec in our alsa-tools package.

current cvs doesn't compile.

output.c: In function `output_open':
output.c:146: warning: passing arg 3 of `snd_pcm_hw_params_set_period_time_near' makes integer from pointer without a cast
output.c:154: warning: passing arg 3 of `snd_pcm_hw_params_set_period_time_near' makes integer from pointer without a cast
output.c:43: warning: unused variable `rate'

I'm not sure how to fix line 145.. does the rate it got set to get returned in the return value??

Signature · 11 lines
Troy Benjegerdes | master of mispeeling | 'da hozer' |  [email protected]
-----"If this message isn't misspelled, I didn't write it" -- Me -----
"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't. That's 
why I draw cartoons. It's my life." -- Charles Schulz


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#5 lore raw
Quoted 16 lines · Troy Benjegerdes
Quoted 3 lines

We have command-line ac3dec in our alsa-tools package.

current cvs doesn't compile.

output.c: In function `output_open':
output.c:146: warning: passing arg 3 of `snd_pcm_hw_params_set_period_time_near' makes integer from pointer without a cast
output.c:154: warning: passing arg 3 of `snd_pcm_hw_params_set_period_time_near' makes integer from pointer without a cast
output.c:43: warning: unused variable `rate'

Quoted 2 lines

I'm not sure how to fix line 145.. does the rate it got set to get returned in the return value??

You don't use the current CVS sources. I have first *period_time_near call on line 147.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#6 lore raw
In reply to Troy Benjegerdes

At Thu, 2 Jan 2003 22:22:34 -0600,

Quoted 10 lines · Troy Benjegerdes

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with digital optical TOSlink input.

I'm trying to get xine or some other DVD player to output AC/3 sound to the receiver for watching dvd's, and I have a couple of problems.

1) xmms (and xine 2-channel sound) works with OSS emulation, but is static with native ALSA drivers. This seems like some endian problem

then most likely it's a bug of alsa output plugin.

Takashi

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#7 lore raw
Quoted 7 lines · Takashi Iwai

At Thu, 2 Jan 2003 22:22:34 -0600,

Quoted 5 lines · Troy Benjegerdes

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with digital optical TOSlink input.

Quoted 7 lines
Quoted 5 lines

I'm trying to get xine or some other DVD player to output AC/3 sound to the receiver for watching dvd's, and I have a couple of problems.

1) xmms (and xine 2-channel sound) works with OSS emulation, but is static with native ALSA drivers. This seems like some endian problem

then most likely it's a bug of alsa output plugin.

It seems the latest xmms source uses 'S16_NE' (which is S16_BE on big-endian platforms) as the pcm format, which works correctly.

alsa-tools/acdec/output.c also has a problem.. it uses S16_LE on big-endian platforms.

I am able to successfully open the SPDIF output and output *something* with a commandline like:

ac3dec -D hw:0,0 -C THX.ac3

However, the hardware decoder (yamaha receiver) is getting garbled data and plays what sounds like stacatto static.

ac3dec -C THX.ac3 gives the following:

Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2' ALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS
failed: No such device or address
PCM hw_params failed: No such device or address
Output open failed

Another interesting bit...
If I change S16_LE to S16_BE in output.c, now it works with regular 2 channel audio, but anything with the '-C' option gives:

Using PCM device 'hw:0,0'
Sample format non availableOutput open failed

Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2' Sample format non availableOutput open failed

Should the alsa drive be able to byteswap SPDIF data??

Signature · 15 lines
--------------------------------------------------------------------------
Troy Benjegerdes                'da hozer'                [email protected]   

Somone asked my why I work on this free (http://www.fsf.org/philosophy/)
software stuff and not get a real job. Charles Shultz had the best answer:

"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't. That's why
I draw cartoons. It's my life." -- Charles Shultz


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
#8 lore raw
Quoted 42 lines · Troy Benjegerdes
Quoted 7 lines · Takashi Iwai

At Thu, 2 Jan 2003 22:22:34 -0600,

Quoted 5 lines · Troy Benjegerdes

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with digital optical TOSlink input.

Quoted 7 lines
Quoted 5 lines

I'm trying to get xine or some other DVD player to output AC/3 sound to the receiver for watching dvd's, and I have a couple of problems.

1) xmms (and xine 2-channel sound) works with OSS emulation, but is static with native ALSA drivers. This seems like some endian problem

then most likely it's a bug of alsa output plugin.

It seems the latest xmms source uses 'S16_NE' (which is S16_BE on big-endian platforms) as the pcm format, which works correctly.

alsa-tools/acdec/output.c also has a problem.. it uses S16_LE on big-endian platforms.

I am able to successfully open the SPDIF output and output *something* with a commandline like:

ac3dec -D hw:0,0 -C THX.ac3

However, the hardware decoder (yamaha receiver) is getting garbled data and plays what sounds like stacatto static.

ac3dec -C THX.ac3 gives the following:

Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2' ALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS
failed: No such device or address
PCM hw_params failed: No such device or address
Output open failed

Another interesting bit...
If I change S16_LE to S16_BE in output.c, now it works with regular 2 channel audio, but anything with the '-C' option gives:

Quoted 8 lines

Using PCM device 'hw:0,0'
Sample format non availableOutput open failed

Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2' Sample format non availableOutput open failed

Should the alsa drive be able to byteswap SPDIF data??

There were a few bad assumtions in the spdif code. Could you try the latest CVS code of ac3dec (or attached patch)?

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

? out.txt
Index: ac3spdif.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/ac3spdif.c,v retrieving revision 1.3

ac3spdif.c +1 -1
diff -u -r1.3 ac3spdif.c
@@ -154,7 +154,7 @@
         done_banner = 1;
       }
       
-#ifndef WORDS_BIGENDIAN
+#ifndef _a_b_c_d_e_f /* WORDS_BIGENDIAN */
       // extract_ac3 seems to write swabbed data
       swab(&buf[10], &buf[10], syncinfo.frame_size * 2 - 2);
 #endif

Index: output.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/output.c,v retrieving revision 1.17

output.c +9 -7
diff -u -r1.17 output.c
@@ -41,6 +41,7 @@
 	char devstr[128];
 	snd_pcm_hw_params_t *params;
 	unsigned int rate, buffer_time, period_time, tmp;
+	snd_pcm_format_t format = output->bits == 16 ? SND_PCM_FORMAT_S16 : SND_PCM_FORMAT_U8;
 	int err, step;
 	snd_pcm_hw_params_alloca(&params);
 
@@ -76,6 +77,7 @@
 				sprintf(devstr, "iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", s[0], s[1], s[2], s[3]);
 				if (out_config.card)
 					sprintf(devstr + strlen(devstr), ",CARD=%s", out_config.card);
+				format = SND_PCM_FORMAT_S16_LE;
 			} else {
 				if (out_config.card)
 					sprintf(devstr, "plughw:%s", out_config.card);
@@ -114,29 +116,29 @@
 	err = snd_pcm_hw_params_set_access(pcm, params,
 					   SND_PCM_ACCESS_RW_INTERLEAVED);
 	if (err < 0) {
-		fprintf(stderr, "Access type not available");
+		fprintf(stderr, "Access type not available\n");
 		goto __close;
 	}
-	err = snd_pcm_hw_params_set_format(pcm, params, output->bits == 16 ? SND_PCM_FORMAT_S16_LE : SND_PCM_FORMAT_U8);
+	err = snd_pcm_hw_params_set_format(pcm, params, format);
 	if (err < 0) {
-		fprintf(stderr, "Sample format non available");
+		fprintf(stderr, "Sample format non available\n");
 		goto __close;
 	}
 	err = snd_pcm_hw_params_set_channels(pcm, params, output->channels);
 	if (err < 0) {
-		fprintf(stderr, "Channels count non available");
+		fprintf(stderr, "Channels count non available\n");
 		goto __close;
 	}
 	rate = output->rate;
 	err = snd_pcm_hw_params_set_rate_near(pcm, params, &rate, 0);
 	if (err < 0) {
-		fprintf(stderr, "Rate not available");
+		fprintf(stderr, "Rate not available\n");
 		goto __close;
 	}
 	buffer_time = 500000;
 	err = snd_pcm_hw_params_set_buffer_time_near(pcm, params, &buffer_time, 0);
 	if (err < 0) {
-		fprintf(stderr, "Buffer time not available");
+		fprintf(stderr, "Buffer time not available\n");
 		goto __close;
 	}
 	step = 2;
@@ -146,7 +148,7 @@
 		tmp = period_time;
 		err = snd_pcm_hw_params_set_period_time_near(pcm, params, &tmp, 0);
 		if (err < 0) {
-			fprintf(stderr, "Period time not available");
+			fprintf(stderr, "Period time not available\n");
 			goto __close;
 		}
 		if (tmp == period_time) {
#9 lore raw
Quoted 11 lines
Quoted 7 lines · Takashi Iwai
Quoted 5 lines

At Thu, 2 Jan 2003 22:22:34 -0600,

Quoted 3 lines · Troy Benjegerdes

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with

There were a few bad assumtions in the spdif code. Could you try the latest CVS code of ac3dec (or attached patch)?

Okay, I've dumped some printk's in core/pcm_memory.c, and found that the following error:

hozer@narn ac3dec$ ./ac3dec -C ~/testac3/THX.ac3
Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2' ALSA lib pcm_hw.c:297:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS
failed: Cannot allocate memory
PCM hw_params failed: Cannot allocate memory
Output open failed

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

This definitely seems to be a driver problem.. Do you think this is related to PowerPC, or a general ymfpci driver problem?

Thanks.

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#10 lore raw

At Fri, 10 Jan 2003 00:55:45 -0600,

Quoted 23 lines · Troy Benjegerdes
Quoted 6 lines
Quoted 6 lines · Takashi Iwai
Quoted 3 lines

At Thu, 2 Jan 2003 22:22:34 -0600,

Quoted 1 line · Troy Benjegerdes
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I have a mac G4 (running debian testing), a ymfpci card (MaxiSound Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with

There were a few bad assumtions in the spdif code. Could you try the latest CVS code of ac3dec (or attached patch)?

Okay, I've dumped some printk's in core/pcm_memory.c, and found that the following error:

hozer@narn ac3dec$ ./ac3dec -C ~/testac3/THX.ac3
Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2' ALSA lib pcm_hw.c:297:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS
failed: Cannot allocate memory
PCM hw_params failed: Cannot allocate memory
Output open failed

Quoted 2 lines

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

oh, you found a bug :) it was introduced due to my last change to pcm pre-allocator. now fixed on cvs.

thanks for your report!

Takashi

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#11 lore raw
Quoted 7 lines
Quoted 2 lines

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

oh, you found a bug :) it was introduced due to my last change to pcm pre-allocator. now fixed on cvs.

thanks for your report!

Okay, now we're getting somewhere.. I'm not getting any errors anymore. The reciever (hardware AC3 decoder) is recognizing I'm sending it something other than PCM, but no sound comes out and none of the dolby digital or other indicators light up. Any ideas?

(Xine is still giving me a 'sample format not available' error, not that it matters while ac3dec doesn't even work)

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#12 lore raw
Quoted 6 lines · Troy Benjegerdes
Quoted 6 lines
Quoted 2 lines

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

oh, you found a bug :) it was introduced due to my last change to pcm pre-allocator. now fixed on cvs.

Quoted 6 lines
Quoted 1 line

thanks for your report!

Okay, now we're getting somewhere.. I'm not getting any errors anymore. The reciever (hardware AC3 decoder) is recognizing I'm sending it something other than PCM, but no sound comes out and none of the dolby digital or other indicators light up. Any ideas?

Please, use this patch and try to change '#if 0' to '#if 1' until it works (any combination):

Index: ac3spdif.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/ac3spdif.c,v retrieving revision 1.4

ac3spdif.c +6 -1
diff -u -r1.4 ac3spdif.c
@@ -154,10 +154,15 @@
         done_banner = 1;
       }
       
-#ifndef _a_b_c_d_e_f /* WORDS_BIGENDIAN */
+#if 0
       // extract_ac3 seems to write swabbed data
       swab(&buf[10], &buf[10], syncinfo.frame_size * 2 - 2);
 #endif
+
+#if 0
+      swab(buf, buf, (syncinfo.frame_size * 2 - 2) + 10);
+#endif
+
       res = output_play((short *)buf, BLOCK_SIZE / 2 / 2);	/* 2 channels, 16-bit samples */
       ret = ret < 0 ? ret : res;
       bzero(buf,BLOCK_SIZE);

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#13 lore raw

No dice. :-/

I played around with some of my own changes that did the same thing, as well as your patch, and I always get nothing on the receiver.

What next? try an x86 box and make sure it works with that? Is there something In the ymfpci driver I should look at? (also, are there any IRC channels you or someone else that knows about iec958 would be on?)

Thanks!

Quoted 50 lines · Jaroslav Kysela
Quoted 6 lines · Troy Benjegerdes
Quoted 6 lines
Quoted 2 lines

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

oh, you found a bug :) it was introduced due to my last change to pcm pre-allocator. now fixed on cvs.

Quoted 6 lines
Quoted 1 line

thanks for your report!

Okay, now we're getting somewhere.. I'm not getting any errors anymore. The reciever (hardware AC3 decoder) is recognizing I'm sending it something other than PCM, but no sound comes out and none of the dolby digital or other indicators light up. Any ideas?

Please, use this patch and try to change '#if 0' to '#if 1' until it works (any combination):

Index: ac3spdif.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/ac3spdif.c,v retrieving revision 1.4
diff -u -r1.4 ac3spdif.c

ac3spdif.c +6 -1
@@ -154,10 +154,15 @@
         done_banner = 1;
       }
 
-#ifndef _a_b_c_d_e_f /* WORDS_BIGENDIAN */
+#if 0
       // extract_ac3 seems to write swabbed data
       swab(&buf[10], &buf[10], syncinfo.frame_size * 2 - 2);
 #endif
+
+#if 0
+      swab(buf, buf, (syncinfo.frame_size * 2 - 2) + 10);
+#endif
+
       res = output_play((short *)buf, BLOCK_SIZE / 2 / 2);	/* 2 channels, 16-bit samples */
       ret = ret < 0 ? ret : res;
       bzero(buf,BLOCK_SIZE);

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

Signature · 15 lines
--------------------------------------------------------------------------
Troy Benjegerdes                'da hozer'                [email protected]   

Somone asked my why I work on this free (http://www.fsf.org/philosophy/)
software stuff and not get a real job. Charles Shultz had the best answer:

"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't. That's why
I draw cartoons. It's my life." -- Charles Shultz


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
#14 lore raw
In reply to Troy Benjegerdes
Quoted 6 lines · Troy Benjegerdes
Quoted 6 lines
Quoted 2 lines

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

oh, you found a bug :) it was introduced due to my last change to pcm pre-allocator. now fixed on cvs.

Quoted 6 lines
Quoted 1 line

thanks for your report!

Okay, now we're getting somewhere.. I'm not getting any errors anymore. The reciever (hardware AC3 decoder) is recognizing I'm sending it something other than PCM, but no sound comes out and none of the dolby digital or other indicators light up. Any ideas?

Okay.... why does snd_ymfpci_playback_spdif_open use writel and every other write to YDSXGR_SPDIFOUTSTATUS register use writew?

thanks!

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#15 lore raw
Quoted 9 lines · Troy Benjegerdes
Quoted 8 lines · Troy Benjegerdes
Quoted 7 lines
Quoted 2 lines

results in alsa-kernel/core/pcm_memory.c:alloc_pcm_pages() getting called with substream->dma_type= SNDRV_PCM_DMA_TYPE_UNKNOWN.

oh, you found a bug :) it was introduced due to my last change to pcm pre-allocator. now fixed on cvs.

thanks for your report!

Quoted 7 lines
Quoted 4 lines

Okay, now we're getting somewhere.. I'm not getting any errors anymore. The reciever (hardware AC3 decoder) is recognizing I'm sending it something other than PCM, but no sound comes out and none of the dolby digital or other indicators light up. Any ideas?

Okay.... why does snd_ymfpci_playback_spdif_open use writel and every other write to YDSXGR_SPDIFOUTSTATUS register use writew?

The register is 16-bit, but I think that 32-bit accesses are not invalid (high 16-bits are not used in the register space). Anyway, I replaced writel with writew, thanks.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com