Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2012 00:32:46 +0100
From:      =?ISO-8859-1?Q?Micka=EBl_Maillot?= <mickael.maillot@gmail.com>
To:        Alexander Motin <mav@freebsd.org>
Cc:        freebsd-multimedia@freebsd.org, FreeBSD current <freebsd-current@freebsd.org>
Subject:   Re: [RFT] Major snd_hda rewrite
Message-ID:  <CAKT0JB7KfOepO9C6dBx7TRoR4qDRQ3V=V69zz=9BFtWOwqhpMQ@mail.gmail.com>
In-Reply-To: <4F1F34DB.9040405@FreeBSD.org>
References:  <4F0DE3FD.2020203@FreeBSD.org> <20120112121853.GC1429@procyon.xvoid.org> <4F0ED8D0.8080403@FreeBSD.org> <CAKT0JB5xP__9KacknmkT8_QrC1hsq8Gj5quRY_FvgmB=sJGmSQ@mail.gmail.com> <4F171D7A.4080003@FreeBSD.org> <CAKT0JB6u-b1CTcYVphLnEf-rHCmuSLJJFrYOiiqChJKDYtRHtQ@mail.gmail.com> <4F177979.5010106@FreeBSD.org> <CAKT0JB7k0V42w0WGN1mq4sKgQxqbnf_NoDRZAxPrMGebuvUH2g@mail.gmail.com> <CAKT0JB5zOjmy1R13W%2BbY453VySOkYcShpnHwk8kbT=-yAUC2vQ@mail.gmail.com> <CAKT0JB5xHJ7=UFHDhumsiMqfYGEPV6QyNz2YbHb%2BojOUgw23WA@mail.gmail.com> <4F1ACBA8.6000203@FreeBSD.org> <CAKT0JB7Z=pwv9oryCcu2OV7kHnkXjPj-cYY_=0c6PMbNF1BLTw@mail.gmail.com> <4F1EB305.9000105@FreeBSD.org> <4F1EDD3D.6070800@FreeBSD.org> <CAKT0JB5jAr6VP5Q9sBVG6hFrnn%2BWafEDWT43yKhdXJuWv4U8pw@mail.gmail.com> <4F1F31CA.5000507@FreeBSD.org> <4F1F34DB.9040405@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2012/1/24 Alexander Motin <mav@freebsd.org>

> On 01/25/12 00:33, Alexander Motin wrote:
>
>> On 01/25/12 00:13, Micka=EBl Maillot wrote:
>>
>>> 2012/1/24 Alexander Motin <mav@freebsd.org <mailto:mav@freebsd.org>>
>>> Here is it: http://people.freebsd.org/~__**mav/hda.HBR.patch<http://peo=
ple.freebsd.org/~__mav/hda.HBR.patch>
>>> <http://people.freebsd.org/~**mav/hda.HBR.patch<http://people.freebsd.o=
rg/~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 =3D=3D 8))" can=
't be
>>> true.
>>> i checked my /v/l/messages and saw PCMDIR_PLAY ....chan_count=3D0x01.
>>>
>>
>> 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
>>
>>
ok so set 8 channels is just to allow more bandwidth.
i just looked at alsa hdmi code (because i never find oss code that can
play hd audio),
they set 192k and 8 channels for every DTS HD / TRUEHD / E-AC3 file, so i
was thinking to do the same.


> What I've forgot is to allow 8ch format. :) Add the patch below. Hope
>> sound(4) has no other limitations for it.
>>
>
> Hmm. Looks like there is some limitation. You may grep kernel for
> AFMT_PASSTHROUGH and find two "XXX force ..." comments and code, includin=
g
> forcing 2 channels for AC3. Luckily for not part for frequency is comment=
ed
> out. Further we may try to comment or modify part about number of channel=
s.
>
>
spotted and commented


>
>  --- hdaa.c (revision 230511)
>> +++ hdaa.c (working copy)
>> @@ -4979,6 +4979,8 @@
>> }
>> if (HDA_PARAM_SUPP_STREAM_**FORMATS_AC3(fmtcap)) {
>> ch->fmtlist[i++] =3D SND_FORMAT(AFMT_AC3, 2, 0);
>> + if (channels >=3D 8)
>> + ch->fmtlist[i++] =3D SND_FORMAT(AFMT_AC3, 8, 0);
>> }
>> ch->fmtlist[i] =3D 0;
>> i =3D 0;
>>
>> But in your case I think it should be enough to just increase sample
>> rate to 96 or 192KHz.
>>
>
>
so if my problem persist after settings 8 channels, i'll blame xbmc oss
part.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKT0JB7KfOepO9C6dBx7TRoR4qDRQ3V=V69zz=9BFtWOwqhpMQ>