Subject: problems with pkgsrc/audio/nas vs. SPARCstation-1 vs. libossaudio
To: NetBSD/sparc Discussion List <port-sparc@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: port-sparc
Date: 01/20/2002 03:51:32
Well I finally got one of my SS1+ workstations running a much closer to
-current NetBSD (2001/06/24).

I tested the audioamd driver and I could finally play AU files, both
with audioplay and by simply writing them to /dev/audio.

Unfortunately it doesn't seem to want to record anything, neither from
my official Sun microphone, nor from the microphone on my headset.  I
think both mics are OK, but I've no easy way to test them at the moment.

So I built audio/nas and tried it anyway.  Unfortunately all that
resulted was an excruciating and heavily distorted noise that was only
barely recognisable as possibly being vaguely related to the almost
pleasing sound that audioplay creates when playing the same file.  (the
NAS 'auplay' client plays the same file equally nicely on my NCD HMX
terminal)

After some fiddling around, upgrading to NAS-1.5, (and a failed attempt
to get the Sun audio server to build), I noticed that in the debug
output of nasd it was complaining that it didn't get the requested, or
indeed even a valid looking, wordsize.

The code does:

    if (NasConfig.DoVerbose)
      osLogMsg("+++ requesting wordsize of %d, ", sndStatPtr->wordSize);
    if (ioctl(sndStatPtr->fd, SNDCTL_DSP_SAMPLESIZE, &sndStatPtr->wordSize)
        || sndStatPtr->wordSize != 16) {
      sndStatPtr->wordSize = 8;
      ioctl(sndStatPtr->fd, SNDCTL_DSP_SAMPLESIZE, &sndStatPtr->wordSize);
    } 
    if (NasConfig.DoVerbose)
      osLogMsg("got %d\n", sndStatPtr->wordSize);
  
I added a debug output inside the second 'if' body, and the following
after the above segment:

    if (sndStatPtr->wordSize < 8) {
      sndStatPtr->wordSize = 8;
      if (NasConfig.DoVerbose)
        osLogMsg("adjusted internal wordsize back to %d\n", sndStatPtr->wordSize);
    }


# nasd :0 -d 999 -v -aa  
AuInitPhysicalDevices();
Init: will close device when finished with stream.
Init: will initialize mixer device options.
openDevice OUT /dev/audio mode 2
openDevice(1) IN /dev/audio mode 0
setupSoundcard(...);
++ Setting up Output device
+++ requesting wordsize of 16, SNDCTL_DSP_SAMPLESIZE failed, hammering wordsize back to 8 from 1
got 1
adjusted internal wordsize back to 8
+++ requesting 2 channel(s), got 1 channel(s)
+++ Requesting minimum sample rate of 5000, got 8000
+++ Requesting maximum sample rate of 44100, got 8000
setTimer(rate = 0);
createServerComponents(...);
closeDevice: out
closeDevice OUT /dev/audio mode 2
closeDevice: mixer



I'm thinking this apparent problem with libossaudio might be part of the
problem, but I'm at a loss to where to go from here....


$ audioctl -a
name=am7930
version=x
config=audioamd
encodings=mulaw:8
properties=full_duplex
full_duplex=0
fullduplex=0
blocksize=2048
hiwat=3
lowat=1
monitor_gain=128
mode=
play.rate=8000
play.channels=1
play.precision=8
play.encoding=mulaw
play.gain=128
play.balance=32
play.port=0x2
play.avail_ports=0x3
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
record.rate=8000
record.channels=1
record.precision=8
record.encoding=mulaw
record.gain=128
record.balance=32
record.port=0x1
record.avail_ports=0x1
record.seek=0
record.samples=0
record.eof=0
record.pause=0
record.error=0
record.waiting=0
record.open=0
record.active=0
record.buffer_size=65536
record.errors=0
$ mixerctl -av      
outputs.speaker=128 volume
outputs.headphones=128 volume
monitor.monitor=128 volume
monitor.output=headphones  [ speaker headphones ]
inputs.mic=128 volume
inputs.mic.mute=off  [ off on ]
record.source=mic  [ mic ]

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>