All of lore.kernel.org
 help / color / mirror / Atom feed
* ymfpci, big-endian, and spdif out
@ 2003-01-03  4:22 Troy Benjegerdes
  2003-01-03  9:54 ` Jaroslav Kysela
  2003-01-07 16:02 ` Takashi Iwai
  0 siblings, 2 replies; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-03  4:22 UTC (permalink / raw)
  To: alsa-devel

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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-03  4:22 ymfpci, big-endian, and spdif out Troy Benjegerdes
@ 2003-01-03  9:54 ` Jaroslav Kysela
  2003-01-04 18:44   ` Troy Benjegerdes
  2003-01-04 23:58   ` Troy Benjegerdes
  2003-01-07 16:02 ` Takashi Iwai
  1 sibling, 2 replies; 16+ messages in thread
From: Jaroslav Kysela @ 2003-01-03  9:54 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: alsa-devel@lists.sourceforge.net

On Thu, 2 Jan 2003, Troy Benjegerdes wrote:

> 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?

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

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-03  9:54 ` Jaroslav Kysela
@ 2003-01-04 18:44   ` Troy Benjegerdes
  2003-01-05 14:31     ` Jaroslav Kysela
  2003-01-04 23:58   ` Troy Benjegerdes
  1 sibling, 1 reply; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-04 18:44 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel@lists.sourceforge.net

On Fri, Jan 03, 2003 at 10:54:44AM +0100, Jaroslav Kysela wrote:
> On Thu, 2 Jan 2003, Troy Benjegerdes wrote:
> 
> > 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?
> 
> 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?

-- 
Troy Benjegerdes | master of mispeeling | 'da hozer' |  hozer@drgw.net
-----"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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-03  9:54 ` Jaroslav Kysela
  2003-01-04 18:44   ` Troy Benjegerdes
@ 2003-01-04 23:58   ` Troy Benjegerdes
  2003-01-05 14:30     ` Jaroslav Kysela
  1 sibling, 1 reply; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-04 23:58 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel@lists.sourceforge.net

> 
> 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??

-- 
Troy Benjegerdes | master of mispeeling | 'da hozer' |  hozer@drgw.net
-----"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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-04 23:58   ` Troy Benjegerdes
@ 2003-01-05 14:30     ` Jaroslav Kysela
  0 siblings, 0 replies; 16+ messages in thread
From: Jaroslav Kysela @ 2003-01-05 14:30 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: alsa-devel@lists.sourceforge.net

On Sat, 4 Jan 2003, Troy Benjegerdes wrote:

> > 
> > 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??

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

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs




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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-04 18:44   ` Troy Benjegerdes
@ 2003-01-05 14:31     ` Jaroslav Kysela
  0 siblings, 0 replies; 16+ messages in thread
From: Jaroslav Kysela @ 2003-01-05 14:31 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: alsa-devel@lists.sourceforge.net

On Sat, 4 Jan 2003, Troy Benjegerdes wrote:

> 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>'.

> 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 <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-03  4:22 ymfpci, big-endian, and spdif out Troy Benjegerdes
  2003-01-03  9:54 ` Jaroslav Kysela
@ 2003-01-07 16:02 ` Takashi Iwai
  2003-01-08  5:37   ` Troy Benjegerdes
  1 sibling, 1 reply; 16+ messages in thread
From: Takashi Iwai @ 2003-01-07 16:02 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: alsa-devel

At Thu, 2 Jan 2003 22:22:34 -0600,
Troy Benjegerdes wrote:
> 
> 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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-07 16:02 ` Takashi Iwai
@ 2003-01-08  5:37   ` Troy Benjegerdes
  2003-01-08 11:30     ` Jaroslav Kysela
  0 siblings, 1 reply; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-08  5:37 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Tue, Jan 07, 2003 at 05:02:53PM +0100, Takashi Iwai wrote:
> At Thu, 2 Jan 2003 22:22:34 -0600,
> Troy Benjegerdes wrote:
> > 
> > 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.

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??


-- 
--------------------------------------------------------------------------
Troy Benjegerdes                'da hozer'                hozer@drgw.net   

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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-08  5:37   ` Troy Benjegerdes
@ 2003-01-08 11:30     ` Jaroslav Kysela
  2003-01-10  6:55       ` Troy Benjegerdes
  0 siblings, 1 reply; 16+ messages in thread
From: Jaroslav Kysela @ 2003-01-08 11:30 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: Takashi Iwai, alsa-devel@lists.sourceforge.net

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2177 bytes --]

On Tue, 7 Jan 2003, Troy Benjegerdes wrote:

> On Tue, Jan 07, 2003 at 05:02:53PM +0100, Takashi Iwai wrote:
> > At Thu, 2 Jan 2003 22:22:34 -0600,
> > Troy Benjegerdes wrote:
> > > 
> > > 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.
> 
> 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??

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 <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

[-- Attachment #2: Type: TEXT/plain, Size: 3027 bytes --]

? out.txt
Index: ac3spdif.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/ac3spdif.c,v
retrieving revision 1.3
diff -u -r1.3 ac3spdif.c
--- ac3spdif.c	6 Aug 2001 16:08:01 -0000	1.3
+++ ac3spdif.c	8 Jan 2003 11:28:48 -0000
@@ -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
diff -u -r1.17 output.c
--- output.c	22 Oct 2002 18:01:16 -0000	1.17
+++ output.c	8 Jan 2003 11:28:48 -0000
@@ -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) {

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-08 11:30     ` Jaroslav Kysela
@ 2003-01-10  6:55       ` Troy Benjegerdes
  2003-01-10 11:57         ` Takashi Iwai
  0 siblings, 1 reply; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-10  6:55 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Takashi Iwai, alsa-devel@lists.sourceforge.net

> 
> > On Tue, Jan 07, 2003 at 05:02:53PM +0100, Takashi Iwai wrote:
> > > At Thu, 2 Jan 2003 22:22:34 -0600,
> > > Troy Benjegerdes wrote:
> > > > 
> > > > 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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-10  6:55       ` Troy Benjegerdes
@ 2003-01-10 11:57         ` Takashi Iwai
  2003-01-11  1:48           ` Troy Benjegerdes
  0 siblings, 1 reply; 16+ messages in thread
From: Takashi Iwai @ 2003-01-10 11:57 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: Jaroslav Kysela, alsa-devel@lists.sourceforge.net

At Fri, 10 Jan 2003 00:55:45 -0600,
Troy Benjegerdes wrote:
> 
> > 
> > > On Tue, Jan 07, 2003 at 05:02:53PM +0100, Takashi Iwai wrote:
> > > > At Thu, 2 Jan 2003 22:22:34 -0600,
> > > > Troy Benjegerdes wrote:
> > > > > 
> > > > > 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.
 
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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-10 11:57         ` Takashi Iwai
@ 2003-01-11  1:48           ` Troy Benjegerdes
  2003-01-11  9:53             ` Jaroslav Kysela
  2003-01-11 20:10             ` Troy Benjegerdes
  0 siblings, 2 replies; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-11  1:48 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jaroslav Kysela, alsa-devel@lists.sourceforge.net

> > 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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-11  1:48           ` Troy Benjegerdes
@ 2003-01-11  9:53             ` Jaroslav Kysela
  2003-01-11 18:48               ` Troy Benjegerdes
  2003-01-11 20:10             ` Troy Benjegerdes
  1 sibling, 1 reply; 16+ messages in thread
From: Jaroslav Kysela @ 2003-01-11  9:53 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: alsa-devel@lists.sourceforge.net

On Fri, 10 Jan 2003, Troy Benjegerdes wrote:

> > > 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?

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	8 Jan 2003 11:30:04 -0000	1.4
+++ ac3spdif.c	11 Jan 2003 09:52:32 -0000
@@ -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 <perex@suse.cz>
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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-11  9:53             ` Jaroslav Kysela
@ 2003-01-11 18:48               ` Troy Benjegerdes
  0 siblings, 0 replies; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-11 18:48 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel@lists.sourceforge.net

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!

On Sat, Jan 11, 2003 at 10:53:51AM +0100, Jaroslav Kysela wrote:
> On Fri, 10 Jan 2003, Troy Benjegerdes wrote:
> 
> > > > 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?
> 
> 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	8 Jan 2003 11:30:04 -0000	1.4
> +++ ac3spdif.c	11 Jan 2003 09:52:32 -0000
> @@ -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 <perex@suse.cz>
> Linux Kernel Sound Maintainer
> ALSA Project, SuSE Labs
> 

-- 
--------------------------------------------------------------------------
Troy Benjegerdes                'da hozer'                hozer@drgw.net   

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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-11  1:48           ` Troy Benjegerdes
  2003-01-11  9:53             ` Jaroslav Kysela
@ 2003-01-11 20:10             ` Troy Benjegerdes
  2003-01-12  9:46               ` Jaroslav Kysela
  1 sibling, 1 reply; 16+ messages in thread
From: Troy Benjegerdes @ 2003-01-11 20:10 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jaroslav Kysela, alsa-devel@lists.sourceforge.net

On Fri, Jan 10, 2003 at 07:48:48PM -0600, Troy Benjegerdes wrote:
> > > 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?

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

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

* Re: ymfpci, big-endian, and spdif out
  2003-01-11 20:10             ` Troy Benjegerdes
@ 2003-01-12  9:46               ` Jaroslav Kysela
  0 siblings, 0 replies; 16+ messages in thread
From: Jaroslav Kysela @ 2003-01-12  9:46 UTC (permalink / raw)
  To: Troy Benjegerdes; +Cc: Takashi Iwai, alsa-devel@lists.sourceforge.net

On Sat, 11 Jan 2003, Troy Benjegerdes wrote:

> On Fri, Jan 10, 2003 at 07:48:48PM -0600, Troy Benjegerdes wrote:
> > > > 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?
> 
> 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 <perex@suse.cz>
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

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

end of thread, other threads:[~2003-01-12  9:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03  4:22 ymfpci, big-endian, and spdif out Troy Benjegerdes
2003-01-03  9:54 ` Jaroslav Kysela
2003-01-04 18:44   ` Troy Benjegerdes
2003-01-05 14:31     ` Jaroslav Kysela
2003-01-04 23:58   ` Troy Benjegerdes
2003-01-05 14:30     ` Jaroslav Kysela
2003-01-07 16:02 ` Takashi Iwai
2003-01-08  5:37   ` Troy Benjegerdes
2003-01-08 11:30     ` Jaroslav Kysela
2003-01-10  6:55       ` Troy Benjegerdes
2003-01-10 11:57         ` Takashi Iwai
2003-01-11  1:48           ` Troy Benjegerdes
2003-01-11  9:53             ` Jaroslav Kysela
2003-01-11 18:48               ` Troy Benjegerdes
2003-01-11 20:10             ` Troy Benjegerdes
2003-01-12  9:46               ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.