From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 15 21:23:03 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD7C937B401 for ; Sun, 15 Jun 2003 21:23:03 -0700 (PDT) Received: from claygirl.org (ip68-101-207-85.sd.sd.cox.net [68.101.207.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0D3143FD7 for ; Sun, 15 Jun 2003 21:23:02 -0700 (PDT) (envelope-from yussef@claygirl.org) Received: from marathon.claygirl.org ([192.168.1.2]) by claygirl.org with smtp (Exim 4.14) id 19RlXf-0003oK-0l for freebsd-hackers@freebsd.org; Sun, 15 Jun 2003 21:24:27 -0700 From: yussef To: freebsd-hackers@freebsd.org X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.10; i386-portbld-freebsd4.8) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: Date: Sun, 15 Jun 2003 21:24:27 -0700 Subject: weird sound problem requires odd config tweak X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 04:23:04 -0000 Im running 4.8 on my Laptop, with the following sound hardware: # dmesg |grep pcm pcm0: port 0x3400-0x34ff mem 0x24003000-0x24003fff irq 5 at device 1.4 on pci0 pcm0: 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