[alsa-devel] [PATCH] ALSA: hda: Disable 4/6 channels on some NVIDIA GPUs.

Anssi Hannula anssi.hannula at iki.fi
Wed Jan 12 18:11:40 CET 2011


On 12.01.2011 18:42, Stephen Warren wrote:
> Anssi Hannula wrote:
>>
>> On 11.01.2011 19:41, Stephen Warren wrote:
>>> Anssi Hannula wrote:
>>>> On 10.01.2011 18:19, Nitin Daga wrote:
>>>>> Added hardware constraint in patch_hdmi.c to disable
>>>>> channels 4/6 which are not supported by some older
>>>>> NVIDIA GPUs.
>>>>
>>>> And 3/5/7, which do not seem to work either with my 0x0007.
>>>
>>> Are 3/5/7 channels supported by any vendor?
>> ...
>>
>> Actually, I just tested and just transmitting 3-channel data with extra
>> 4th dummy channel while setting the Audio InfoFrame fields to indicate a
>> 3 channel stream makes it work.
>>
>> So it would seem (to me) like the best approach would be:
>> 1. Add a hw_constraint to prevent odd channel counts (easy)
> 
> That seems enough to me. I'm not sure that 3/5/7 channels are a format
> that there is much use-case for?

Usage of those formats is indeed somewhat limited.

This is true especially with ALSA, since if you open a device with 3
channels, it generally means left+right+rearleft instead of the likely
intended left+right+lfe or left+right+center.

And yes, (1) is enough, the below (2) was meant to be an additional
future development.

>> 2. Provide some way for alsa plug (and the user application) to indicate
>>    the "actual/original" channel count/layout without dummy channels,
>>    so that the infoframe can be set correctly.
>>    This is harder, and I guess should probably be implemented so that
>>    the channel remapping issue on older nvidia hw will be fixed as well.
> 
> Hmm. That sounds kinda complex. If constraints prevent the application
> from using e.g. 3-channel, then implementing (2) means the plugin would
> have to also modify the constraints to re-allow 3-channel, so the
> application could actually use it, no?

No, alsa-lib would insert a dummy channel, so it gets through the
hw_constraint as it is now a 4 channel stream. This is what already
happens when the constrains are added (and the alsa device is used via
'plug', e.g. "plug:'hdmi:CARD=NVidia,DEV=3'").

What (2) would mean is that alsa-lib also informs the kernel of the
actual layout (including 4th channel being a dummy one) so that
patch_hdmi can set the infoframe correctly.

(and in case of 7x hardware, libalsa would notice that the kernel driver
has a channel map different from alsa and do some channel remapping).

-- 
Anssi Hannula


More information about the Alsa-devel mailing list