From owner-freebsd-multimedia@FreeBSD.ORG Wed Dec 17 00:13:14 2008 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9FE1065670 for ; Wed, 17 Dec 2008 00:13:14 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 97C298FC29 for ; Wed, 17 Dec 2008 00:13:13 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: (qmail invoked by alias); 16 Dec 2008 23:46:31 -0000 Received: from 85-127-248-201.dynamic.xdsl-line.inode.at (EHLO taxman.pepperland) [85.127.248.201] by mail.gmx.net (mp031) with SMTP; 17 Dec 2008 00:46:31 +0100 X-Authenticated: #16703784 X-Provags-ID: V01U2FsdGVkX198+k4e4sR8NhnjTUa052R0IH1tByWp3dTiO3Dm05 Yn5o6VVJ5Xn9cu From: Stefan Ehmann To: freebsd-multimedia@freebsd.org Date: Wed, 17 Dec 2008 00:46:31 +0100 User-Agent: KMail/1.10.3 (FreeBSD/7.1-RC1; KDE/4.1.3; i386; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812170046.32702.shoesoft@gmx.net> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.61 Cc: Scott Spare Subject: Re: Multiple simultaneous sound channels (sources) with X.org and Envy24 (M-Audio Audiophile 2496) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 00:13:14 -0000 On Tuesday 16 December 2008 22:43:47 Scott Spare wrote: > Multimedia gurus, > > I am looking for advice about the best way to handle the following > situation: > Playing sound with any two apps at the same time causes errors, sound > stuttering and / or hangups. > > So far, I've tested and confirmed this problem under the following > conditions: > -Amarok is playing music and Pidgin tries to make noise to tell me > someone's online. > -XMMS is playing music and Pidgin tries to make noise. > -XMMS and Amarok are both playing music at the same time. > -Shell-FM is playing music and Pidgin tries to make noise. > > Expected behavior: > Simultaneous sounds play simultaneously. > > Errors received: > pcm0: play: dsp0.p0 play interrupt timeout, channel dead > pcm0: play: dsp0.p1 play interrupt timeout, channel dead > > What I have tried so far: > -I've enabled autovchans in sysctls: hw.snd.maxautovchans: 4. This did not > help. > -Reading more, I became a bit confused about a message regarding the driver > (or at least the hardware) supporting multiplexing natively It doesn't happen with all applications. Playing two files with mplayer simultaneously works for instance. Don't think it has anything to do with xorg but haven't found out under what exact circumstances it fails. The hardware mixing seems to be buggy in some cases. But it seems to be used even if vchans is enabled. So there's no easy way to workaround that. Maybe someone could come up with a simple patch to disable the hardware mixing feature. I've tried some time ago but failed. > -So I installed OSS, thinking that maybe it could solve my multiple audio > source problems, but got the same problem - stuttering sound when playing > multiple sources, followed by instability. I later learned that OSS hadn't > loaded correctly, and didn't support multiple sound channels on FreeBSD > anyway, and I am trying to avoid running a heavy sound server if > possible... so without any luck with OSS, I've now uninstalled it. I'm > open to suggestions. Does anyone know how PC-BSD handles sound? Maybe > they've got it right for the desktop? There's ALSA, ESD, ARTS, OSS FreeBSD > version via ports, OSS 4Front version, vchans, hardware multiplexing and > more. Pretty confusing. It's been some time since I used the 4Front driver. There's something called virtual channel mixer or something similar. IIRC it provides several dsp devices; but you need to explicitly specify which device to use. So it's not as comfortable as the shipped driver. Also some applications have troubles with the driver, e.g. you need to patch libao. But maybe that's already been fixed. -- Stefan