Skip to contentSkip to conversation

OSS/Free /dev/audio full duplex sound format.

DISCUSSION Dave Mielke 4 participants 6 messages May 22, 2000 – May 24, 2000 Sound

lore
Share & tools
lore
#0 lore raw

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?

Signature · 3 lines
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: [email protected] | Canada  K2B 6G3   | if you're concerned about Hell.
#1 lore raw

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

Quoted 10 lines · Dave Mielke

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?

Signature · 3 lines
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: [email protected] | Canada  K2B 6G3   | if you're concerned about Hell.
#2 lore raw
In reply to Dave Mielke

[quoted lines by [email protected] on May 22, 2000, at 15:29]

Quoted 1 line

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?

Signature · 3 lines
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: [email protected] | Canada  K2B 6G3   | if you're concerned about Hell.
#3 lore raw
In reply to Dave Mielke
Quoted 16 lines

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

Quoted 2 lines

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

#4 lore raw
In reply to Dave Mielke
Quoted 5 lines · Dave Mielke

[quoted lines by [email protected] on May 22, 2000, at 15:29]

Quoted 1 line

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

Quoted 7 lines

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

Signature · 3 lines
Jeff Garzik              | Liberty is always dangerous, but
Building 1024            | it is the safest thing we have.
MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick
#5 lore raw
In reply to Dave Mielke

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

Quoted 1 line

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

Not an option. :-)

Quoted 1 line

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.

Quoted 2 lines

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

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

Signature · 3 lines
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: [email protected] | Canada  K2B 6G3   | if you're concerned about Hell.