From owner-freebsd-multimedia@FreeBSD.ORG Thu Dec 18 20:58:19 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 75DCF1065673 for ; Thu, 18 Dec 2008 20:58:19 +0000 (UTC) (envelope-from scuppers@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id 1256D8FC17 for ; Thu, 18 Dec 2008 20:58:18 +0000 (UTC) (envelope-from scuppers@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so850646yxb.13 for ; Thu, 18 Dec 2008 12:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=YCPbpLwINIPkAvXSo2shl3WZ5ICAYtvRRFjA7qx/DFM=; b=HSHOf4kQrJ5/I/ahLfGFOzIESkVZZ6NcVyyQL4WwiuyFJ3xKvSpiI4Iedws1yJOJjO Z3WKcuf3USwudTP+k6K3J18voydQA6YkOCXkJW5o2ufuhyQMrhEgycE2b7vddv7yyNTw ulDU9rvApqyY8UeL+rSjh00bvCw+12MZsf8yc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=wtSlqlDZ0MNMBXai3Gq4Ig50m+Q5+/OaxcISOrxpzziCCMDY2hu9mLMksGSJrTICXg Hw8CInTuuaPzFr4RGAYVOe1ImVVo903qNLOon53PbPRePMTCvpkD6Wh21y0jdEeVkaVP 8Y8YSIfjnPsN50gY1LxTmsPnN9TeYasPldS+c= Received: by 10.90.74.7 with SMTP id w7mr1399129aga.92.1229633898080; Thu, 18 Dec 2008 12:58:18 -0800 (PST) Received: by 10.90.33.16 with HTTP; Thu, 18 Dec 2008 12:58:18 -0800 (PST) Message-ID: Date: Thu, 18 Dec 2008 15:58:18 -0500 From: "Scott Spare" To: "Stefan Ehmann" In-Reply-To: <200812170046.32702.shoesoft@gmx.net> MIME-Version: 1.0 References: <200812170046.32702.shoesoft@gmx.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-multimedia@freebsd.org 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: Thu, 18 Dec 2008 20:58:19 -0000 Stefan, Thank you for your detailed message. I am more than willing to test any new driver code for Envy24 that supports multiplexing if anyone creates it. I looked at the code for the driver yesterday, but realized after about half an hour of reading code that driver debugging is way beyond my C ability. I was unable to figure out what that high-quality hardware mixing is called in the driver, or whether it's just automatically enabled, and so would be something that would have to be disabled explicitly by sending a signal to the chip to tell it not to use it. I would be very glad to use the hardware mixer if it was working. Also I'm not really clear on what portion of all this is handled by the driver itself, and what's handled by the kernel modules. I looked around for datasheets for the VIA Envy24 chip itself, and couldn't find those. I personally thank Konstantin and whoever else authored these drivers in the first place. How they did so without datasheets, I will never know. FWIW, there's a web page on the chip itself at http://www.via.com.tw/en/products/audio/controllers/envy24/. The digital mixer is shown on that page in a block diagram, but the quality of the diagram is not so good. There's a zip file for an "image kit" on that page, but that's just logos. Next steps: I think I'm going to try OSS again and see if I can get that virtual channel mixing thing working. I might also look at the source of their envy24 support to see if that answers anything. I kind of doubt it, but it's worth a shot. I'd really prefer to use some kind of low-level solution like the hardware mixing or FreeBSDs vchans. I think the driver may be disabling the vchans, but not sure. The driver itself has been working great with libao besides the multiplexing issue. I use it every day to play music on Amarok. What a great card. Thanks once again. Scott On Tue, Dec 16, 2008 at 6:46 PM, Stefan Ehmann wrote: > 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 >