Linux Sound subsystem development
 help / color / mirror / Atom feed
* OSS/Free /dev/audio full duplex sound format.
@ 2000-05-22 21:39 Dave Mielke
  2000-05-22 22:29 ` paco
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dave Mielke @ 2000-05-22 21:39 UTC (permalink / raw)
  To: linux-sound

When /dev/audio is opened, it's supposed to start with the sound format set to
mulaw (Sun .snd format). When I open it for read/write (O_RDWR), however, it
appears that it switches to unsigned 8-bit linear. Does anyone know what the
cause of this switch in format is, and how, if at all, it can be worked around?

-- 
Dave Mielke           | 856 Grenon Avenue | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: dave@mielke.cc | Canada  K2B 6G3   | if you're concerned about Hell.

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

* Re: OSS/Free /dev/audio full duplex sound format.
  2000-05-22 21:39 OSS/Free /dev/audio full duplex sound format Dave Mielke
@ 2000-05-22 22:29 ` paco
  2000-05-23 12:03 ` Dave Mielke
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paco @ 2000-05-22 22:29 UTC (permalink / raw)
  To: linux-sound

Well, this isn't really a "work-around", but...

All you should have to do is make ioctl calls to change the sample format.
It's all documented in the OSS programmers guide.

As for why it switched on you in the first place... I have no idea.

--Paco


On Mon, 22 May 2000, Dave Mielke wrote:

> When /dev/audio is opened, it's supposed to start with the sound format set to
> mulaw (Sun .snd format). When I open it for read/write (O_RDWR), however, it
> appears that it switches to unsigned 8-bit linear. Does anyone know what the
> cause of this switch in format is, and how, if at all, it can be worked around?
> 
> -- 
> Dave Mielke           | 856 Grenon Avenue | I believe that the Bible is the
> Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
> EMail: dave@mielke.cc | Canada  K2B 6G3   | if you're concerned about Hell.
> 

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

* Re: OSS/Free /dev/audio full duplex sound format.
  2000-05-22 21:39 OSS/Free /dev/audio full duplex sound format Dave Mielke
  2000-05-22 22:29 ` paco
@ 2000-05-23 12:03 ` Dave Mielke
  2000-05-23 12:37 ` Gianmaria Collazuol
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dave Mielke @ 2000-05-23 12:03 UTC (permalink / raw)
  To: linux-sound

[quoted lines by paco@hydrofunk.org on May 22, 2000, at 15:29]

>As for why it switched on you in the first place... I have no idea.

I'm using the 2.2.12-20 kernel, as suplied by RedHat6.1, and the OSS/Free
drivers which it contains. If I open /dev/audio just for input (O_RDONLY), then
it delivers sound in mu_law format. If I open it just for output (O_WRONLY),
then it interprets sound in mu_law format. If I open it for both input and
output (O_RDWR), then it delivers sound in mu_law format, but, and this is my
problem, it interprets sound in unsigned 8-bit format (as though it were
/dev/dsp). My /etc/conf.modules contains the following:

   alias sound sb
   alias midi awe_wave
   options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330
   pre-install sound insmod sound dmabuf=1
   pre-install awe_wave modprobe opl3
   options opl3 io=0x388
   post-install awe_wave /bin/sfxload /etc/midi/GU11-ROM.SF2


Have I done anything wrong? Is it probably a bug in the sound driver, or might
the dmabuf=1 option to the sound module have something to do with it?

-- 
Dave Mielke           | 856 Grenon Avenue | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: dave@mielke.cc | Canada  K2B 6G3   | if you're concerned about Hell.

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

* Re: OSS/Free /dev/audio full duplex sound format.
  2000-05-22 21:39 OSS/Free /dev/audio full duplex sound format Dave Mielke
  2000-05-22 22:29 ` paco
  2000-05-23 12:03 ` Dave Mielke
@ 2000-05-23 12:37 ` Gianmaria Collazuol
  2000-05-23 18:09 ` Jeff Garzik
  2000-05-24 12:33 ` Dave Mielke
  4 siblings, 0 replies; 6+ messages in thread
From: Gianmaria Collazuol @ 2000-05-23 12:37 UTC (permalink / raw)
  To: linux-sound

>I'm using the 2.2.12-20 kernel, as suplied by RedHat6.1, and the OSS/Free
>drivers which it contains. If I open /dev/audio just for input (O_RDONLY), then
>it delivers sound in mu_law format. If I open it just for output (O_WRONLY),
>then it interprets sound in mu_law format. If I open it for both input and
>output (O_RDWR), then it delivers sound in mu_law format, but, and this is my
>problem, it interprets sound in unsigned 8-bit format (as though it were
>/dev/dsp). My /etc/conf.modules contains the following:
>
>   alias sound sb
>   alias midi awe_wave
>   options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330
>   pre-install sound insmod sound dmabuf=1
>   pre-install awe_wave modprobe opl3
>   options opl3 io=0x388
>   post-install awe_wave /bin/sfxload /etc/midi/GU11-ROM.SF2
>
>Have I done anything wrong? Is it probably a bug in the sound driver, or might
>the dmabuf=1 option to the sound module have something to do with it?

i've exactly the same problem, kernel and /etc/conf.modules.
consider that even with (all the) different dma, dma16 
channel combinations the problem still remains.
(so as to dmabuf=1: even worse results with a static driver 
built in kernel and not as a module.)  
regards,
  g.collazuol 

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

* Re: OSS/Free /dev/audio full duplex sound format.
  2000-05-22 21:39 OSS/Free /dev/audio full duplex sound format Dave Mielke
                   ` (2 preceding siblings ...)
  2000-05-23 12:37 ` Gianmaria Collazuol
@ 2000-05-23 18:09 ` Jeff Garzik
  2000-05-24 12:33 ` Dave Mielke
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2000-05-23 18:09 UTC (permalink / raw)
  To: linux-sound

Dave Mielke wrote:
> 
> [quoted lines by paco@hydrofunk.org on May 22, 2000, at 15:29]
> 
> >As for why it switched on you in the first place... I have no idea.
> 
> I'm using the 2.2.12-20 kernel, as suplied by RedHat6.1, and the OSS/Free
> drivers which it contains. If I open /dev/audio just for input (O_RDONLY), then
> it delivers sound in mu_law format. If I open it just for output (O_WRONLY),
> then it interprets sound in mu_law format. If I open it for both input and
> output (O_RDWR), then it delivers sound in mu_law format, but, and this is my
> problem, it interprets sound in unsigned 8-bit format (as though it were
> /dev/dsp).

An easy answer might then be "don't do that".  :)

Are you checking DSP_CAP_DUPLEX?

And what makes you say "as though it were /dev/dsp"?  /dev/audio is
supposed to default to 8-bit, /dev/dsp is supposed to default to 16-bit.

Are you following the OSS guide at
http://www.opensound.com/pguide/oss.pdf ?  It doesn't contain a few
2.3.x features, but it should be fairly close to the 2.2.x API.

	Jeff



-- 
Jeff Garzik              | Liberty is always dangerous, but
Building 1024            | it is the safest thing we have.
MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick

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

* Re: OSS/Free /dev/audio full duplex sound format.
  2000-05-22 21:39 OSS/Free /dev/audio full duplex sound format Dave Mielke
                   ` (3 preceding siblings ...)
  2000-05-23 18:09 ` Jeff Garzik
@ 2000-05-24 12:33 ` Dave Mielke
  4 siblings, 0 replies; 6+ messages in thread
From: Dave Mielke @ 2000-05-24 12:33 UTC (permalink / raw)
  To: linux-sound

[quoted lines by Jeff Garzik on May 23, 2000, at 14:09]

>An easy answer might then be "don't do that".  :)

Not an option. :-)

>Are you checking DSP_CAP_DUPLEX?

SNDCTL_DSP_GETCAPS returns 00003101. Since DSP_CAP_DUPLEX is 0X100, this
capability would appear to be available. I even called ioctl with
SNDCTL_DSP_SETDUPLEX first, and that did not return an error.

>Are you following the OSS guide at
>http://www.opensound.com/pguide/oss.pdf ?  

As you can see from the above, yes I have.

-- 
Dave Mielke           | 856 Grenon Avenue | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: dave@mielke.cc | Canada  K2B 6G3   | if you're concerned about Hell.

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

end of thread, other threads:[~2000-05-24 12:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-22 21:39 OSS/Free /dev/audio full duplex sound format Dave Mielke
2000-05-22 22:29 ` paco
2000-05-23 12:03 ` Dave Mielke
2000-05-23 12:37 ` Gianmaria Collazuol
2000-05-23 18:09 ` Jeff Garzik
2000-05-24 12:33 ` Dave Mielke

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