Skip to content
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

ASoC: hdmi-codec: Fix broken channel map reporting #5597

Closed
wants to merge 2 commits into from

Conversation

popcornmix
Copy link
Collaborator

Commit 5fe680b23327 ("ASoC: hdmi-codec: fix channel info for compressed formats") accidentally changed hcp->chmap_idx from ca_id, the CEA channel allocation ID, to idx, the index to the table of channel mappings ordered by preference.

This resulted in wrong channel maps being reported to userspace, eg for 5.1 "FL,FR,LFE,FC" was reported instead of the expected "FL,FR,LFE,FC,RL,RR":

~ # speaker-test -c 6 -t sine
...
0 - Front Left
3 - Front Center
1 - Front Right
2 - LFE
4 - Unknown
5 - Unknown

~ # amixer cget iface=PCM,name='Playback Channel Map' | grep ': values'
: values=3,4,8,7,0,0,0,0

Revert this incorrect change so that channel maps are properly reported again.

Fixes: 5fe680b23327 ("ASoC: hdmi-codec: fix channel info for compressed formats")
Cc: [email protected]

Commit 5fe680b23327 ("ASoC: hdmi-codec: fix channel info for
compressed formats") accidentally changed hcp->chmap_idx from
ca_id, the CEA channel allocation ID, to idx, the index to
the table of channel mappings ordered by preference.

This resulted in wrong channel maps being reported to userspace,
eg for 5.1 "FL,FR,LFE,FC" was reported instead of the expected
"FL,FR,LFE,FC,RL,RR":

~ # speaker-test -c 6 -t sine
...
 0 - Front Left
 3 - Front Center
 1 - Front Right
 2 - LFE
 4 - Unknown
 5 - Unknown

~ # amixer cget iface=PCM,name='Playback Channel Map' | grep ': values'
  : values=3,4,8,7,0,0,0,0

Revert this incorrect change so that channel maps are properly
reported again.

Fixes: 5fe680b23327 ("ASoC: hdmi-codec: fix channel info for compressed formats")
Cc: [email protected]
Signed-off-by: Matthias Reichl <[email protected]>
@popcornmix
Copy link
Collaborator Author

From @HiassofT here: LibreELEC/LibreELEC.tv#8122

@6by9
Copy link
Contributor

6by9 commented Sep 8, 2023

Commit hash of the fixes looks dubious.

On rpi-6.1.y it's 3f38871, but that has "commit 4e08713 upstream" in the commit text for the backport, and that would appear to be the commit in mainline (torvalds/linux@4e08713)

@HiassofT
Copy link
Contributor

HiassofT commented Sep 8, 2023

There was a bit of a mix-up as both broonie and tiwai applied the patch to their trees - seems the other commit hash survived when it was finally merged into mainline
https://patchwork.kernel.org/project/alsa-devel/patch/[email protected]/#25403695

@HiassofT
Copy link
Contributor

HiassofT commented Sep 8, 2023

Ah, sorry, my fault, 4e08713 is indeed the right githash - the hash in the commit message is wrong (glad you noticed that before I sent it upstream)

@HiassofT
Copy link
Contributor

HiassofT commented Sep 9, 2023

I've sent the fix upstream now, with corrected hashes in the commit message. Best if you pick that one instead
https://patchwork.kernel.org/project/alsa-devel/patch/[email protected]/

@pelwell
Copy link
Contributor

pelwell commented Sep 11, 2023

The version of the patch sent upstream as been applied and pushed offline.

@pelwell pelwell closed this Sep 11, 2023
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Sep 14, 2023
kernel: ASoC: hdmi-codec: Fix broken channel map reporting
See: raspberrypi/linux#5597

kernel: Backport fix for f2fs NULL pointer dereference in f2fs_issue_flush()
See: raspberrypi/linux#5599
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Sep 14, 2023
kernel: ASoC: hdmi-codec: Fix broken channel map reporting
See: raspberrypi/linux#5597

kernel: Backport fix for f2fs NULL pointer dereference in f2fs_issue_flush()
See: raspberrypi/linux#5599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants