Subject: Getting sound to work on i386/NetBSD_4_A2/Gateway Laptop
To: None <netbsd-users@netbsd.org>
From: None <yancm@sdf.lonestar.org>
List: netbsd-users
Date: 12/23/2006 11:36:35
Hi All,

As indicated by several other posts of mine over the last 6-8 weeks,
I've been configuring an old laptop (P2-266/192M/10G) to run with
some rudimentry networking and desktop functionality.
It's my first laptop w/NetBSD and the first time I've
played with X in over 10 years.

AND I am trying to keep it light (no kde/gnome).

I tried xfce...which sounded promising, but it just wasn't
being user friendly to install/configure...

Current functional S/W:
icewm
FileRunner - gui file browser
mount_smbfs - part of base install, but worth mentioning that
              it allows me to mount WinXP drives so I can share
              data on other machines on my home network then browse
              them with FR.
FireFox2
vncviewer

Now I'm trying to get sound working both in the shell and in X.

I installed xine. The gui and visualization seem to work, but
no sound and it plays way too fast????

What follows is what I know and have observed, I read the Guide
section 10 on Sound, that helped a little.

Of course I'm looking for "the" answer...but just next steps would
be quite helpful as I am stuck.


dmesg output relevant to sound
------------------------------
[note the error : "can't share type 3 with 2"]
sb0 at isa0 port 0x220-0x237 irq 5 drq 1: dsp v3.01
audio0 at sb0: half duplex, mmap, independent
midi0 at sb0: SB MIDI UART (CPU-intensive output)
opl0 at sb0: model OPL3
midi1 at opl0: SB Yamaha OPL3 (CPU-intensive output)
wss0 at isa0 port 0x530-0x537 irq 10 drq 0,1
 intr_establish: pic pic0 pin 10: can't share type 3 with 2
: CS4231
audio1 at wss0: full duplex, mmap

So to me this says I have 2 audio devices:
 1 - at /dev/audio0 [sb driver]
 1 - at /dev/audio1 [wss driver - but error on load?]

Sure enough:
-----------
# audioctl -a
name=SoundBlaster
version=3.01
config=SB_Pro
encodings=ulinear:8,mulaw:8*,alaw:8*,slinear:8*
properties=mmap,independent
full_duplex=0
fullduplex=0
blocksize=400
hiwat=163
lowat=1
monitor_gain=0
mode=
play.rate=8000
play.channels=1
play.precision=8
play.encoding=mulaw
play.gain=128
play.balance=32
play.port=0x0
play.avail_ports=0x0
play.seek=0
play.samples=0
play.eof=0
play.pause=0
play.error=0
play.waiting=0
play.open=0
play.active=0
play.buffer_size=65536

  and

# audioctl -d /dev/audio1 -a
name=wss,ad1848
version=
config=WSS
encodings=mulaw:8,alaw:8,slinear_le:16,ulinear:8,slinear_be:16,slinear:8*,ulinear_le:16*,ulinear_be:16*,adpcm:4
properties=full_duplex,mmap
full_duplex=0
fullduplex=0
blocksize=400
hiwat=163
lowat=122
monitor_gain=0
mode=play
play.rate=8000
play.channels=1
play.precision=8
play.encoding=mulaw
play.gain=127
play.balance=32
play.port=0x0
play.avail_ports=0x0
play.seek=0
play.samples=0
play.eof=0
play.pause=0
play.error=0
play.waiting=0
play.open=1
play.active=0
play.buffer_size=65536

I had access to the windows tada.wav file I tried to use
# audioplay -V -d /dev/sound0 TADA.WAV
TADA.WAV: sample_rate=22050 channels=2 datasize=171008
          precision=16 encoding=slinear_le
audioplay: failed to set audio info: Invalid argument
[sb0 cannot do precision=16 encoding=slinear_le .. maybe others]

# audioplay -V -d /dev/sound1 TADA.WAV
TADA.WAV: sample_rate=22050 channels=2 datasize=171008
          precision=16 encoding=slinear_le
This works, but is almost impossible to hear - way too quiet.

*************************
So what next?
Is my wss working properly despite the error?

I tried changing the xine AUD channel from auto to 0 and 1...
it did not seem to matter.

The default device is sb0, that seems pretty limited, do I need it?
  Can I just suppress the sb? device in the LAPTOP_kernel config?
  Is there some other way to make wss the default device?
  (change the audio/sound/mixer links in /dev?)

Is there something special I need to do in X to make sound work?

Is there some sort of volume control and device selector
I need to install?

Thanks,
gene