From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 24 22:33:52 2012 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 B7C64106566C; Tue, 24 Jan 2012 22:33:52 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5E98FC08; Tue, 24 Jan 2012 22:33:51 +0000 (UTC) Received: by eaai10 with SMTP id i10so1932639eaa.13 for ; Tue, 24 Jan 2012 14:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=no2lUFbPzOMNwwd0DDNuhNb4nFa0FhpCT06LkyLTQlQ=; b=EqE5hiygcxTkEsxVmLqiugiOQM3Kc/iSji6MklddaKpyoa0XjLqvI+BHp0YNR2rAed LdtszkE/aE4JL97f6NeTg4UrvpXAoATCkekt7yv/bktImkFc3U/RGS4dxyq6Hh66OIL9 9lNFnSOqAWLOOlxAJxJbOexgNp135HWC5pARs= Received: by 10.213.15.20 with SMTP id i20mr2169485eba.6.1327444430954; Tue, 24 Jan 2012 14:33:50 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id y12sm73254964eeb.11.2012.01.24.14.33.47 (version=SSLv3 cipher=OTHER); Tue, 24 Jan 2012 14:33:48 -0800 (PST) Sender: Alexander Motin Message-ID: <4F1F31CA.5000507@FreeBSD.org> Date: Wed, 25 Jan 2012 00:33:46 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111227 Thunderbird/9.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Micka=EBl_Maillot?= References: <4F0DE3FD.2020203@FreeBSD.org> <20120112121853.GC1429@procyon.xvoid.org> <4F0ED8D0.8080403@FreeBSD.org> <4F171D7A.4080003@FreeBSD.org> <4F177979.5010106@FreeBSD.org> <4F1ACBA8.6000203@FreeBSD.org> <4F1EB305.9000105@FreeBSD.org> <4F1EDD3D.6070800@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-multimedia@freebsd.org, FreeBSD current Subject: Re: [RFT] Major snd_hda rewrite 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: Tue, 24 Jan 2012 22:33:52 -0000 On 01/25/12 00:13, Mickaël Maillot wrote: > 2012/1/24 Alexander Motin > > Here is it: http://people.freebsd.org/~__mav/hda.HBR.patch > > It should activate HBR mode if you try to play stream with AC3 > format and 8 channels (>6Mbps). > > no change with the patch because when i SNDCTL_DSP_SETFMT to AFMT_AC3, > SNDCTL_DSP_CHANNELS always return 2 channels even if i > set SNDCTL_DSP_SPEED to 192000. > and i think it's why "if ((ch->fmt & AFMT_AC3) && (cchn == 8))" can't be > true. > i checked my /v/l/messages and saw PCMDIR_PLAY ....chan_count=0x01. Number of channels should be set to 8 by application when it expects bit rate above 6Mbps. Sample rate, as I've described, just give more fine control. Increasing sample rate does not automatically increase channels. They are orthogonal: Rate 48 96 192 48 96 192 Channels 2 2 2 8 8 8 ---------------------------------------------------------- Mbps 1.5 3 6 12 24 49 What I've forgot is to allow 8ch format. :) Add the patch below. Hope sound(4) has no other limitations for it. --- hdaa.c (revision 230511) +++ hdaa.c (working copy) @@ -4979,6 +4979,8 @@ } if (HDA_PARAM_SUPP_STREAM_FORMATS_AC3(fmtcap)) { ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 2, 0); + if (channels >= 8) + ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 8, 0); } ch->fmtlist[i] = 0; i = 0; But in your case I think it should be enough to just increase sample rate to 96 or 192KHz. -- Alexander Motin