All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with supported PCM formats in ice1712 driver
@ 2004-01-17  2:15 Torrey Hoffman
  2004-01-17 12:08 ` Ronny V. Vindenes
  0 siblings, 1 reply; 3+ messages in thread
From: Torrey Hoffman @ 2004-01-17  2:15 UTC (permalink / raw)
  To: ALSA Development

I've got an M-Audio Audiophile 2496 and am running linux 2.6.1-mm3
(which includes ALSA 1.0.1).

I'm trying to get all my sound applications working using only ALSA
interfaces.   I'm having problems with the ice 1712 driver.

(I have lots of C programming experience but am new to the ALSA driver
subsystem.)  I've compiled my own copy of xmms with the ALSA output
plugin.  It fails at startup with these messages: (I have enabled alsa
debug in my xmms config file) 

--
Message: alsa_setup_mixer
Message: alsa_setup_mixer: end
Message: Opening device
Message: alsa_setup
Message: output format: 7, rate: 44100, channels: 2
Message: Opening device: hw:0,0
Opened ALSA card 0, Device 0, Subdevice 0
Message: Configuring device: hw:0,0
Message: Attempting to set hardware format S16_LE
Message: Attempting to set next hardware format S16_LE
Message: Attempting to set next hardware format S16_BE
Message: Attempting to set next hardware format U8
** WARNING **: alsa_setup(): Sample format not available for playback:
Invalid argument
Message: Closing device
Message: Device closed
--

I decided to try debugging this myself, so I'm writing a little test app
that iterates over all the possible PCM formats and tries to set them.  

(The plan is to evolve this into a full ALSA test program which iterates
over all cards, devices and subdevices in the system, prints out all
their possible configurations, and tests them...)

Anyway, the relevant snippet of C code is:

for (pcm_format = 0; pcm_format <= SND_PCM_FORMAT_LAST; pcm_format++)
{
	test = snd_pcm_hw_params_test_format(pcm_handle, hw_params, pcm_format);
	info_printf("PCM format %d: %s (%s)\n", pcm_format, (test ? "FAILED" : "OK"), 
			snd_pcm_format_t_to_string(pcm_format));
}

This outputs:
PCM format 0: FAILED (Signed 8 bit )
PCM format 1: FAILED (Unsigned 8 bit)
PCM format 2: FAILED (Signed 16 bit Little Endian)
PCM format 3: FAILED (Signed 16 bit Big Endian)
PCM format 4: FAILED (Unsigned 16 bit Little Endian)
PCM format 5: FAILED (Unsigned 16 bit Big Endian)
PCM format 6: FAILED (Signed 24 bit Little Endian)
PCM format 7: FAILED (Signed 24 bit Big Endian)
PCM format 8: FAILED (Unsigned 24 bit Little Endian)
PCM format 9: FAILED (Unsigned 24 bit Big Endian)
PCM format 10: OK (Signed 32 bit Little Endian)
PCM format 11: FAILED (Signed 32 bit Big Endian)
PCM format 12: FAILED (Unsigned 32 bit Little Endian)
PCM format 13: FAILED (Unsigned 32 bit Big Endian)
PCM format 14: FAILED (Float 32 bit Little Endian, Range -1.0 to 1.0)

(... etc. ... all other formats other than 10 are also FAILED.)

This seems to explain why the XMMS Alsa plugin fails... apparently only
"Signed 32 bit Little Endian" is supported by this driver???

But the strange thing is, I've looked at the source code for the ice1712
driver and found this: 

static snd_pcm_hardware_t snd_ice1712_playback =
{
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
                                 SNDRV_PCM_INFO_MMAP_VALID |
                                 SNDRV_PCM_INFO_PAUSE),
        .formats =              SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
        .rates =                SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
        .rate_min =             4000,

...

So it looks like the driver should support unsigned 8bit, and signed
16bit little endian.  And, those are the formats which the XMMS plugin
tries to set, and fails.

What's going on there?

Now, just as a sanity check... my motherboard also has an onboard ICH5
sound chip.  If I load that driver instead, it works as expected... The
XMMS ALSA plugin works, and my test app prints:

PCM format 0: FAILED (Signed 8 bit )
PCM format 1: FAILED (Unsigned 8 bit)
PCM format 2: OK (Signed 16 bit Little Endian)
PCM format 3: FAILED (Signed 16 bit Big Endian)

(... the rest fail ... )

With both the drivers loaded, my /proc/asound/cards looks like this:

0 [ICH5           ]: ICH - Intel ICH5
                     Intel ICH5 at 0xfc102000, irq 17
1 [M2496          ]: ICE1712 - M Audio Audiophile 24/96
                     M Audio Audiophile 24/96 at 0x6000, irq 20

/proc/asound/version is:

Advanced Linux Sound Architecture Driver Version 1.0.1 (Tue Dec 30
10:04:14 2003 UTC).
Compiled on Jan 14 2004 for kernel 2.6.1-mm3 (SMP).

Any help would be deeply appreciated!

-- 
Torrey Hoffman <thoffman@arnor.net>



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

* Re: Problem with supported PCM formats in ice1712 driver
  2004-01-17  2:15 Problem with supported PCM formats in ice1712 driver Torrey Hoffman
@ 2004-01-17 12:08 ` Ronny V. Vindenes
  2004-01-19 18:42   ` Torrey Hoffman
  0 siblings, 1 reply; 3+ messages in thread
From: Ronny V. Vindenes @ 2004-01-17 12:08 UTC (permalink / raw)
  To: Torrey Hoffman; +Cc: ALSA Development

On Sat, 2004-01-17 at 03:15, Torrey Hoffman wrote:
> I've got an M-Audio Audiophile 2496 and am running linux 2.6.1-mm3
> (which includes ALSA 1.0.1).
> 
> I'm trying to get all my sound applications working using only ALSA
> interfaces.   I'm having problems with the ice 1712 driver.
> 

> 
> --
> Message: alsa_setup_mixer
> Message: alsa_setup_mixer: end
> Message: Opening device
> Message: alsa_setup
> Message: output format: 7, rate: 44100, channels: 2
> Message: Opening device: hw:0,0
> Opened ALSA card 0, Device 0, Subdevice 0
> Message: Configuring device: hw:0,0
> Message: Attempting to set hardware format S16_LE
> Message: Attempting to set next hardware format S16_LE
> Message: Attempting to set next hardware format S16_BE
> Message: Attempting to set next hardware format U8
> ** WARNING **: alsa_setup(): Sample format not available for playback:
> Invalid argument
> Message: Closing device
> Message: Device closed
> --

> This seems to explain why the XMMS Alsa plugin fails... apparently only
> "Signed 32 bit Little Endian" is supported by this driver???
> 

The Envy24 hardware only supports 24bit in 32bit little-endian format,
if you want other formats you have to use the plughw: device.

-- 
Ronny V. Vindenes <s864@ii.uib.no>



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

* Re: Problem with supported PCM formats in ice1712 driver
  2004-01-17 12:08 ` Ronny V. Vindenes
@ 2004-01-19 18:42   ` Torrey Hoffman
  0 siblings, 0 replies; 3+ messages in thread
From: Torrey Hoffman @ 2004-01-19 18:42 UTC (permalink / raw)
  To: Ronny V. Vindenes; +Cc: ALSA Development

On Sat, 2004-01-17 at 04:08, Ronny V. Vindenes wrote:
> On Sat, 2004-01-17 at 03:15, Torrey Hoffman wrote:
> > I've got an M-Audio Audiophile 2496 and am running linux 2.6.1-mm3
> > (which includes ALSA 1.0.1).
...
 
> > Message: alsa_setup_mixer
> > Message: alsa_setup_mixer: end
> > Message: Opening device
> > Message: alsa_setup
> > Message: output format: 7, rate: 44100, channels: 2
> > Message: Opening device: hw:0,0
> > Opened ALSA card 0, Device 0, Subdevice 0
> > Message: Configuring device: hw:0,0
> > Message: Attempting to set hardware format S16_LE
> > Message: Attempting to set next hardware format S16_LE
> > Message: Attempting to set next hardware format S16_BE
> > Message: Attempting to set next hardware format U8
> > ** WARNING **: alsa_setup(): Sample format not available for playback:
> > Invalid argument
> > Message: Closing device
> > Message: Device closed
> > --
> 
> > This seems to explain why the XMMS Alsa plugin fails... apparently only
> > "Signed 32 bit Little Endian" is supported by this driver???
> > 
> 
> The Envy24 hardware only supports 24bit in 32bit little-endian format,
> if you want other formats you have to use the plughw: device.

Thanks for the information.  I tried specifying "plughw:1,0" as the
playback device in the XMMS ALSA plugin, and now I do get sound from my
Audiophile 2496... but it's just noise.  Specifically, when I start XMMS
playing, I get a repetitive burst of noise which repeats without
changing until I stop playback.

Here are the messages from XMMS while this happens:
Message: alsa_setup_mixer: end
Message: Opening device
Message: alsa_setup
Message: output format: 7, rate: 44100, channels: 2
Message: Opening device: plughw:1,0
 
Opened ALSA card 1, Device 0, Subdevice 0
Message: Configuring device: plughw:1,0
 
Message: Attempting to set hardware format S16_LE
 
start_mode: DATA
xrun_mode: STOP
tstamp_mode: NONE
period_step: 1
sleep_min: 0
avail_min: 2205
xfer_align: 2205
silence_threshold: 0
silence_size: 0
boundary: 1717829632
Plug PCM: Route conversion PCM (sformat=S32_LE)
Transformation table:
0 <- 0
1 <- 1
2 <- none
3 <- none
4 <- none
5 <- none
6 <- none
7 <- none
8 <- none
9 <- none
Its setup is:
stream       : PLAYBACK
access       : MMAP_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 6553
period_size  : 2205
period_time  : 50000
tick_time    : 1000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 2205
xfer_align   : 2205
start_threshold  : 1
stop_threshold   : 6553
silence_threshold: 0
silence_size : 0
boundary     : 1717829632
Slave: Hardware PCM card 1 'M Audio Audiophile 24/96' device 0 subdevice
0
 
Its setup is:
stream       : PLAYBACK
access       : MMAP_INTERLEAVED
format       : S32_LE
subformat    : STD
channels     : 10
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 24
buffer_size  : 6553
period_size  : 2205
period_time  : 50000
tick_time    : 1000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 2205
xfer_align   : 2205
start_threshold  : 1
stop_threshold   : 6553
silence_threshold: 0
silence_size : 0
boundary     : 1717829632
Message: Device setup: buffer time: 148594, size: 26212 frames.
Message: bits per sample: 16; frame size: 4; Bps: 176
Message: alsa_setup_mixer
Message: alsa_setup_mixer: end
Message: Stream started
 
Message: Closing device
Message: Device closed

	
-- 
Torrey Hoffman <thoffman@arnor.net>



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

end of thread, other threads:[~2004-01-19 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-17  2:15 Problem with supported PCM formats in ice1712 driver Torrey Hoffman
2004-01-17 12:08 ` Ronny V. Vindenes
2004-01-19 18:42   ` Torrey Hoffman

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.