All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fwd: ALSA OSS compatibility]
@ 2003-02-11 13:34 Abramo Bagnara
  2003-02-11 16:02 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Abramo Bagnara @ 2003-02-11 13:34 UTC (permalink / raw)
  To: alsa-devel

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


Someone can confirm this is the OSS conformant behaviour?

-- 
Abramo Bagnara                       mailto:abramo.bagnara@libero.it

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy

[-- Attachment #2: Type: message/rfc822, Size: 3399 bytes --]

From: "Leif Åsbrink" <leif.asbrink@mbox300.swipnet.se>
To: <abramo@alsa-project.org>
Subject: ALSA OSS compatibility
Date: Tue, 11 Feb 2003 14:46:42 +0100
Message-ID: <CFEIKLJOPPJLBFPEJHKOOEGPCOAA.leif.asbrink@mbox300.swipnet.se>

Hi Abramo,

I am working with an SDR (Software Defined Radio) under
Linux which uses soundcards to move part of the radio
spectrum into the PC computer.

I have made this package using OSS but it would of course
be very nice to make it run under ALSA as well.

At the moment ALSA is not compatible to OSS because the
ioctl calls do not behave as specified in the OSS manual.

For example, the following sequence differs between OSS and ALSA:

int speed=100000;
ioctl(dv,SNDCTL_DSP_SPEED,&speed);

After this sequence the variable speed contains 48000
or whatever the maximum speed is for the device while
ALSA does not change the value of speed.

The OSS manual explicitly instructs the application programmer
to check the returned speed value to get the actual speed
that the device will use. The OSS API accepts any value between
1Hz and 2 GHz ( 1 to 2000000000) but the lowest/highest possible
sampling rate will be returned by ioctl and used by the device.

I am not a programmer myself, I have a background in physics, so
I use straightforward C and assembly to do digital signal 
processing. How to modify the ioctl calls and the alsa-oss.c 
program is beyond my skils.

Would you consider updating the alsa-oss.c program to become
truly OSS compatible?

The problems I have are with the functions

SNDCTL_DSP_SPEED
SNDCTL_DSP_CHANNELS

If you want to know a little more about my project, have a look at:
http://ham.te.hik.se/~sm5bsz/linuxdsp/linrad.htm
mirror at
http://nitehawk.com/sm5bsz/linuxdsp/linrad.htm


Kind regards

Leif Åsbrink


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

* Re: [Fwd: ALSA OSS compatibility]
  2003-02-11 13:34 [Fwd: ALSA OSS compatibility] Abramo Bagnara
@ 2003-02-11 16:02 ` Takashi Iwai
  2003-02-11 16:23   ` Abramo Bagnara
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2003-02-11 16:02 UTC (permalink / raw)
  To: Abramo Bagnara; +Cc: alsa-devel, Leif Åsbrink

At Tue, 11 Feb 2003 14:34:36 +0100,
Abramo Bagnara wrote:
> 
> Someone can confirm this is the OSS conformant behaviour?

yes.  but the behavior of ALSA oss-emulation described below is
correct because it really supports that sample rate and channels
through the software conversion as default.

this can be avoided by setting the "direct" mode per proc file (in the
case of kernel oss emulation), as mentioned in
alsa-kernel/Documentation/OSS-Emulation.txt.


ciao,

Takashi

> 
> -- 
> Abramo Bagnara                       mailto:abramo.bagnara@libero.it
> 
> Opera Unica                          Phone: +39.546.656023
> Via Emilia Interna, 140
> 48014 Castel Bolognese (RA) - Italy
> [2  <message/rfc822 (7bit)>]
> To: <abramo@alsa-project.org>
> Subject: ALSA OSS compatibility
> From: Leif Åsbrink <leif.asbrink@mbox300.swipnet.se>
> Delivered-To: abramo@igor.opun.it
> Date: Tue, 11 Feb 2003 14:46:42 +0100
> Message-ID: <CFEIKLJOPPJLBFPEJHKOOEGPCOAA.leif.asbrink@mbox300.swipnet.se>
> MIME-Version: 1.0
> Content-Transfer-Encoding: quoted-printable
> Importance: Normal
> 
> Hi Abramo,
> 
> I am working with an SDR (Software Defined Radio) under
> Linux which uses soundcards to move part of the radio
> spectrum into the PC computer.
> 
> I have made this package using OSS but it would of course
> be very nice to make it run under ALSA as well.
> 
> At the moment ALSA is not compatible to OSS because the
> ioctl calls do not behave as specified in the OSS manual.
> 
> For example, the following sequence differs between OSS and ALSA:
> 
> int speed=100000;
> ioctl(dv,SNDCTL_DSP_SPEED,&speed);
> 
> After this sequence the variable speed contains 48000
> or whatever the maximum speed is for the device while
> ALSA does not change the value of speed.
> 
> The OSS manual explicitly instructs the application programmer
> to check the returned speed value to get the actual speed
> that the device will use. The OSS API accepts any value between
> 1Hz and 2 GHz ( 1 to 2000000000) but the lowest/highest possible
> sampling rate will be returned by ioctl and used by the device.
> 
> I am not a programmer myself, I have a background in physics, so
> I use straightforward C and assembly to do digital signal 
> processing. How to modify the ioctl calls and the alsa-oss.c 
> program is beyond my skils.
> 
> Would you consider updating the alsa-oss.c program to become
> truly OSS compatible?
> 
> The problems I have are with the functions
> 
> SNDCTL_DSP_SPEED
> SNDCTL_DSP_CHANNELS
> 
> If you want to know a little more about my project, have a look at:
> http://ham.te.hik.se/~sm5bsz/linuxdsp/linrad.htm
> mirror at
> http://nitehawk.com/sm5bsz/linuxdsp/linrad.htm
> 
> 
> Kind regards
> 
> Leif Åsbrink
> 


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

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

* Re: [Fwd: ALSA OSS compatibility]
  2003-02-11 16:02 ` Takashi Iwai
@ 2003-02-11 16:23   ` Abramo Bagnara
  0 siblings, 0 replies; 3+ messages in thread
From: Abramo Bagnara @ 2003-02-11 16:23 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Leif Åsbrink

Takashi Iwai wrote:
> 
> At Tue, 11 Feb 2003 14:34:36 +0100,
> Abramo Bagnara wrote:
> >
> > Someone can confirm this is the OSS conformant behaviour?
> 
> yes.  but the behavior of ALSA oss-emulation described below is
> correct because it really supports that sample rate and channels
> through the software conversion as default.
> 
> this can be avoided by setting the "direct" mode per proc file (in the
> case of kernel oss emulation), as mentioned in
> alsa-kernel/Documentation/OSS-Emulation.txt.

Thank you, Takashi, I forgot that.

I'd like also to make Leif to note that the behaviour he's observing for
alsa-oss.c is likely due to the fact that he map dsp0 (or whatever) to a
pcm_plug ALSA device.

Mapping it to a pcm_hw device the alsa-oss behaviour should be exactly
what he want (i.e. alsa-oss choose the maximum speed available on
hardware).

-- 
Abramo Bagnara                       mailto:abramo.bagnara@libero.it

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy


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

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

end of thread, other threads:[~2003-02-11 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-11 13:34 [Fwd: ALSA OSS compatibility] Abramo Bagnara
2003-02-11 16:02 ` Takashi Iwai
2003-02-11 16:23   ` Abramo Bagnara

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.