-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ALSA channel mapping API #4868
Conversation
Changes:
|
Add support for the ALSA channel mapping API. This functionality requires alsa-lib v1.0.27. This allows 1) selection of a best-matching channel layout when multiple layouts are available, and 2) reporting the actual layout back to AE, instead of the ALSA default legacy layout which is sometimes incorrect. In practice, this means: 1) Devices that do not use the standard ALSA layout will now have correct channel mapping without ALSA configuration tricks. Such devices include at least: - 1st gen NVIDIA ION - some 2.1 laptop speakers - many embedded audio devices 2) HDMI output is now possible at "proper" 2.1, 5.0 PCM layouts (and any of the more unusual ones, such as 4.1, 3f, 2f+1r) without resorting to adding empty channels as such layouts are handled currently. This means that the A/V receiver will now see the correct format, instead of the "virtual" 5.1/7.1. 3) HDMI output is now configured to use the exact layout given from AE, when possible, so that AE does not need to do any remapping if it does not want to (the audio hardware will perform that instead). 4) Layouts containing the more unusual channel positions such as AE_CH_TFL, AE_CH_TC, etc, are now supported by the ALSA sink. However, currently CActiveAE::ApplySettingsToFormat() always force-resolves the stream layout to a standard layout, preventing the playback of such channels for now. 2,3,4 above require this post-v1.0.27.2 alsa-lib fix in most cases: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=042223c4ee9b17ba8a24bcfc4019f24b69b8310b Some Linux kernels between 3.7 and 3.12 contain bugs in the HDA HDMI driver causing incorrect multichannel mapping in some cases. The most severe issues that affected common channel layouts were fixed in November 2013 in versions 3.10.20, 3.11.9, 3.12.1, the rest in 3.12.15 and 3.13. To avoid any regressions, blacklist channel mapping API on kernel versions older than 3.12.15.
jenkins build this please |
I intend to merge this in during this merge window. Unless anyone has some suggestions on how to make it cleaner or something, of course... I have to admit I myself feel like the complexity/benefit ratio is a bit high as a whole in this PR. |
go ahead. I have already reused ReplaceChannel and BestMatch in #4938 |
jenkins build this please |
Add support for ALSA channel mapping API
@anssih could you have a look at this case: http://forum.xbmc.org/showthread.php?tid=203120 User reports ALSA is broken after June 28th. Look at the log: Channel layout looks weird and format: S24NE4 seems wrong because it is not listed in enumeration.
|
@rhocheck Thanks for the notice, I'll take a look today when I get home. |
thx, I was logged in with wrong account. |
Looks like the reported issue is not related to this pull, opened PR #5297 with a likely fix. |
@anssih seems we have an issue related to this:
in turn we get only 2 channels. |
@FernetMenta That failure (caused by old alsa-lib with a newish kernel) just means that no channel map will be selected (legacy mode), it does not affect channel count. From the log looks like the EDID says stereo only (see enumeration), which causes the driver to restrict us to 2 channels. I'll have more time later today to actually read the thread. |
Yes. That user tunes 5 things at once without telling. Currently he forces Sorry for the noise.
|
@fritsch Yeah, I just took a second look a bit ago and noticed he had forced EDID and you had already asked him to produce a log without that :) . I'll keep an eye on the thread. |
@fritsch, @FernetMenta - opinions and suggestions welcome.