Skip to content

Audio: send the FLAC sample rate to the TV in kHz - #1032

Closed
tiper wants to merge 2 commits into
GLinnik21:mainfrom
tiper:fix/pcm-khz
Closed

tiper wants to merge 2 commits into
GLinnik21:mainfrom
tiper:fix/pcm-khz

Conversation

@tiper

@tiper tiper commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

On my LG C1 (webOS 6.5.3), 32 and 22.05 kHz FLAC sounded like a trembling fan, and 48 kHz played slightly slow. The TV was playing everything at 44.1 kHz.

The FLAC PCM info sends the sample rate in Hz (48000), but the TV matches it against a list in kHz (48, 44.1, 32…), so every rate fell back to 44.1. The playback speed code already sends kHz; this does the same for FLAC.

With the fix, 48, 32 and 22.05 kHz all play at their real rate on the C1. A beep that repeats every 10 s in the file now comes every 10 s, where it was 10.8 s at 48 kHz.

tiper and others added 2 commits October 24, 2026 22:49
libpf matches pcmInfo.sampleRate as a number of kilohertz (48, 44.1, 32, ...) and a value
that matches nothing falls back to 44.1 kHz. The app-decoded FLAC node declared hertz
(48000), so every PCM Load ran at 44.1 kHz: on an LG C1 (webOS 6.5.3) the GStreamer caps
read rate=44100 for both a 32 and a 48 kHz file, a 48 kHz file ran 9% slow and 32 and
22.05 kHz stuttered. The playback-speed decoder's node already states kilohertz.

with_pcm_info now spells the rate in kilohertz (devcaps::pcm_rate_khz), and the prose that
said these rates play at their own speed is corrected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tiago Pereira <1698241+tiper@users.noreply.github.com>
Brings in the Russian catalogue fix (GLinnik21#1029) so CI builds on a green base.

Signed-off-by: Tiago Pereira <1698241+tiper@users.noreply.github.com>
@tiper tiper mentioned this pull request Oct 25, 2026
5 tasks done
@paulorichards

Copy link
Copy Markdown
Contributor

Confirmed on an OLED55B8 (webOS 4.4.3): same cause, and the same fix works there. I measured a 1 kHz test tone recorded from the room. With the rate in Hz: 918.8 Hz from a 48 kHz FLAC, 1377.9 Hz from 32 kHz and about 2006 Hz from 22.05 kHz. With it in kHz: all four rates (48, 44.1, 32, 22.05) come back at 1000 Hz, and the pipeline's audio-info callback reports 48.000000, 44.099998, 32.000000 and 22.049999. As a control, a 48 kHz file relabelled as 44.1 came back at 918.74 Hz.

I also checked above 48 kHz with a test build that admitted 88.2, 96, 176.4 and 192 kHz and declared them in kHz. All four still played at 44.1, so the 48 kHz ceiling in PCM_SAMPLE_RATES is right.

I opened #1036 with the same fix without seeing this one, so I'm closing it in favour of yours.

paulorichards added a commit to paulorichards/plx-native that referenced this pull request Oct 25, 2026
…innik21#1032)

The rate doc, the track gate and the planner's refusal said the PCM input
plays some rates "at their own speed". What decides it is whether
pcmInfo.sampleRate names a rate in libpf's kilohertz table, so they say
that now, and the comments carry the C1 (webOS 6.5.3) results next to
the B8 ones.

Co-authored-by: Tiago Pereira <1698241+tiper@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BNxR112kqmb5uZjUzXgND1
Signed-off-by: Paulo Richards <paulo.richards@gmail.com>
@tiper

tiper commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #1036

@tiper tiper closed this Oct 25, 2026
@tiper
tiper deleted the fix/pcm-khz branch October 26, 2026 21:08
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.

2 participants