Subject: Re: debugging help: nas enabled mpg123 sounds slow and scratchy?
To: None <jon@radscan.com>
From: Scott Presnell <srp@tworoads.net>
List: netbsd-help
Date: 02/28/2003 13:47:55
Jon Trulson wrote:>
>>Greg A. Woods wrote:
>>
>>>[ On Friday, February 28, 2003 at 10:45:23 (-0800), Scott Presnell wrote: ]
>>>
>>>
>>>>Subject: debugging help: nas enabled mpg123 sounds slow and scratchy?
>>>>
>>
>>I just now checked from host A, and with a different audio card,
>>I have the same audio quality issues running mpg123-nas from a remote
>>host, to my workstation where nasd is running, and the same if I reverse
>>the client and server hosts.
>>
>>And now, unfortunately, to add to the story...
>>With some .wav files from host A to my workstation, auplay also shows
>>the same poor audio quality issues...
>>
> 
> 
> 	To get this straight... You are getting these dropouts and
> samplerate problems with nasd no matter which machine it's on, and no
> matter what data you send to it? 

 > Is it only ssamplerate problems, or
> are you getting dropouts as well?  Can you use auplay to send a 16b stereo
> wav to the nasd server?  Is that messed up as well (local or remote)?

No, not quite: .wav's on the same machine seem OK,

some .wavs across machine, and all .mp3 (at 128kb/44100 Hz) (intra and
inter host) are poor quality

> 
>>So now I'm thinking it's nasd... am I outside the expected performance
>>parameters of nasd?
> 
> 
> 	No - it should work just fine.  What sound card are you using?
> Sometimes tuning the parameters in /etc/nas/nasd.conf can help (fragsize,
> numfrags, etc).  On some audio hardware (an ISA soundblaster) I had to
> reduce the output samplerate to 22Khz to get acceptable performance (no
> dropouts).  No problem with the PCI variants though - runs at full
> 44.1Khz, 16b stereo...
> 

So here is what I have tried.

I played withg nasd.conf parameters to no avail.

I added a great deal of optimization to the compilation of nasd ("-O4 
-mpentium -mieee-fp -fbuiltin -fomit-frame-pointer  -funroll-all-loops 
-ffast-math", instead of just "-O2"). but that didn't make a difference,

...8/16 bit didn't change things...

so I moved on to playing with sample rates, and found that I must use 
less than 44100Hz, 42000Hz seems to be about the threshold intrahost, 
about 38000 interhost. This is for a PCI audio card:

eap0 at pci2 dev 12 function 0: Ensoniq CT5880 CT5880C (rev. 0x02)
eap0: interrupting at irq 10
eap0: SigmaTel STAC9708 codec; 18 bit DAC, 18 bit ADC, Rockwell 3D

and for Frederick: the output of audioctl -a is below.

I played with blocksize and hi/lowat while a 44100 sample was playing
intrahost, but I could only make it worse :-(

	Thanks for your comments.

	- Scott

name=Ensoniq AudioPCI
version=
config=eap
encodings=ulinear:8,mulaw:8*,alaw:8*,slinear:8*,slinear_le:16,ulinear_le:16*,slinear_be:16*,ulinear_be:16*
properties=full_duplex,mmap,independent
full_duplex=0
fullduplex=0
blocksize=2048
hiwat=3
lowat=1
monitor_gain=0
mode=
play.rate=44100
play.channels=2
play.precision=16
play.encoding=slinear_le
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=0
play.active=0
play.buffer_size=65536
record.rate=44100
record.channels=2
record.precision=16
record.encoding=slinear_le
record.gain=191
record.balance=32
record.port=0x2
record.avail_ports=0x7
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