weird sound problem requires odd config tweak

yussef yussef at claygirl.org
Sun Jun 15 21:23:04 PDT 2003


Im running 4.8 on my Laptop, with the following sound hardware:

# dmesg |grep pcm
pcm0: <SiS 7018> port 0x3400-0x34ff mem 0x24003000-0x24003fff irq 5 at
device 1.4 on pci0 pcm0: <Asahi Kasei AK4543 ac97 codec>

I have 'device pcm' compiled into the kernel and thats all ive done to
enable sound.
The first time i went to play an mp3 [with xmms] it started playing
fine...for the first 11 seconds. Then it just stopped. For a while i was
not able to get sound working, for more than 11 seconds. And after it
plays that initial 11 seconds, i cannot get it to play at all again, but
if i were to reboot, it would again play for 11 seconds, only on the
first try. [initially it always seemed to play for exactly 11 seconds.
this doesnt seem to be the case anymore, but it does generally seem to
be the most predictable value, and it never has played over the 11
seconds].

Eventually i did figure out some ways to get audio playing. Ive narrowed
it down to a relatively quick and simple few steps to get audio working
quite reliably. Worth noting is that video [such as playing a dvd of a
vid from my hard drive] seemed to suffer from this same issue. But when
i configure the audio to work, the video then also plays fine.
the steps i take to get audio working are as follow:

1)start xmms [in theory this could probably be another audio app, but
ive stuck with using xmms in this process]
2)play an audio file until it stop [<=11 seconds]
3)once the audio has stopped close xmms [click on 'x' to close] i close
xmms directly. ive found that stopping it first can either yield this
prodecure useless and/or force xmms to freeze, requiring a killall xmms
to get rid of the process.
4)now i set a couple sysctl's:
#hw.snd.maxautovchans=4
hw.snd.maxautovchans: 0 -> 4
#hw.snd.pcm0.vchans=4
hw.snd.pcm0.vchans: 1 -> 4
ive also used 5 for the above values, and it seems to work equally well.
so i assume the actual value isnt overly important.
5) fire up xmms. it will complain about audio device not being
available. going into xmms options and changing the sound device to a
new vchan will fix this. and now xmms will play fine[as well as other
a/v apps].

a few other things to note:

# fstat |grep dsp
luser   xmms         386   11 /          1591 crw-rw-rw-  dsp0.3  w
luser   xmms         370   11 /          1590 crw-rw-rw-  dsp0.2  w

it appears that sound requires a zombie process to be running otherwise
it will not work. I tried different steps than the above mentioned ones,
such as setting the sysctl values at bootup, but if that zombie process
doesnt exist it doesnt seem to work.
an alternative to the zombie process is this:
i can open up xmms and play a song. when it stops playing just keep xmms
open. then run mplayer and play a video, and it will play fine. however,
xmms will not be able to play anything. [i can also reverse this
procedure, and use mplayer to get xmms to play].

sound works fine under windows 2000 and linux.

I am not sending this email so much because i want a solution, because
the solution i stated above works well enough. But it seems like an odd
problem, and beyond my level of knowledge to properly debug and attempt
to fix. If this problem is already a known issue, i apologize, and
please just point me in the right direction. Otherwise im more than
willing to do whatever i can to help debug this problem, if it peaks
anyones interest, or they have an idea of whats causing the problem.

thank you for your time
yussef


More information about the freebsd-hackers mailing list