Re: [RFT] Major snd_hda rewrite

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Wed, 25 Jan 2012 00:33:46 +0200
On 01/25/12 00:13, Mickaël Maillot wrote:
> 2012/1/24 Alexander Motin <mav_at_freebsd.org <mailto:mav_at_freebsd.org>>
>     Here is it: http://people.freebsd.org/~__mav/hda.HBR.patch
>     <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)
_at__at_ -4979,6 +4979,8 _at__at_
                 }
                 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
Received on Tue Jan 24 2012 - 21:33:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:23 UTC