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

avcodec/audiotoolboxenc: fix 7.1 channel mapping and sample rate #485

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented Oct 21, 2024

Changes

Both AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK and AV_CHANNEL_LAYOUT_7POINT1
should be mapped to kAudioChannelLayoutTag_AAC_7_1_B, otherwise neither
the back surround channel nor the side surround channel has sound.

aac_at has stricter sample rate than other encoders which should be
spcified to enable auto resampling.

alac with sample rate higher than 38400 will not play on Apple devices,
although higher sample rates are accepted by the encoder

All encoders provided by AudioToolbox can handle 32bit integer samples,
enable that for all encoders.

This patch is probably upstream-able, will submit later.

Issues

This includes #484 to avoid conflicts. Marks as draft until that one is merged.

@gnattu gnattu requested a review from a team October 21, 2024 08:14
@gnattu gnattu force-pushed the fix-atenc-layout-samplerate branch 2 times, most recently from 7e7f6fb to 5a806cb Compare October 21, 2024 08:17
@gnattu
Copy link
Member Author

gnattu commented Oct 21, 2024

Upstreaming requires a bit more work to use a modernized api get_supported_config instead.

@gnattu gnattu force-pushed the fix-atenc-layout-samplerate branch from 5a806cb to f6a7308 Compare October 22, 2024 10:24
Both AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK and AV_CHANNEL_LAYOUT_7POINT1
should be mapped to kAudioChannelLayoutTag_AAC_7_1_B, otherwise neither
the back surround channel nor the side surround channel has sound.

aac_at has stricter sample rate than other encoders which should be
spcified to enable auto resampling.

alac with sample rate higher than 38400 will not play on Apple devices,
although higher sample rates are accepted by the encoder

All encoders provided by AudioToolbox can handle 32bit integer samples,
enable that for all encoders.
@gnattu gnattu force-pushed the fix-atenc-layout-samplerate branch from f6a7308 to 142e51b Compare October 22, 2024 18:11
@gnattu gnattu marked this pull request as ready for review October 22, 2024 18:12
@gnattu gnattu merged commit 982e2b8 into jellyfin Oct 23, 2024
27 checks passed
@gnattu gnattu deleted the fix-atenc-layout-samplerate branch October 23, 2024 03:05
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