Repository navigation
fix(libSceOpusDec): decode narrowband SILK packets - #5193
Conversation
|
Linux validation on the exact PR head: GCC 12.2, Release, |
FFmpeg resamples narrowband SILK (TOC configurations 0-3) from 8 kHz and holds back 24 samples of the first narrowband packet after the decoder starts or after a packet of another bandwidth: a 20 ms packet decodes to 936 samples and the next wider packet to 984. sceOpusDecDecode required exactly the packet's duration and threw, so ProsperoRadio aborted on a narrowband Opus station. The decoder now keeps FFmpeg's output in a queue and returns exactly the packet's duration, as libopus does: the first narrowband packet starts with 24 samples of silence and the held-back samples follow in the next calls. The new test decodes three libopus 6 kb/s narrowband packets and a wideband packet after them; it aborts on main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
9aefec7 to
fb41f10
Compare
|
Thanks for the Linux run. I've validated it on Linux too, and I'll do the same for my other PRs. Linux (Ubuntu 24.04 in WSL, GCC 13.3, Release, the CI's configure options, lavapipe):
Windows is in the Tested section: the test aborts on AI-assisted (Claude Code). |
What
sceOpusDecDecodethrows on narrowband SILK packets (TOC configurations 0-3, RFC 6716 §3.1), and the title aborts withOpusDec: unexpected FFmpeg PCM format.The bundled FFmpeg (7.1.1) resamples narrowband SILK from 8 kHz and holds back 24 samples of the first narrowband packet after the decoder starts, or after a packet of another bandwidth (
opus/dec.c):sceOpusDecDecoderequired exactly the packet's duration. libopus always returns exactly the packet's frame size (opus_decoder.c). The PS5 research's direct-Opus ABI returns the PCM bytes produced for one packet, and its general decoder takes SILK and hybrid packets (DECODING.md).The decoder now keeps FFmpeg's output in a per-decoder queue and returns exactly the packet's duration:
This is recorded in
docs/dev/debt/libSceOpusDec.md.ProsperoRadio (PPSA99001) decodes its Opus stations this way (
radio_service.cpp). With #4796 stacked so that curl can connect, a narrowband station aborts the title onmainand plays with this change (#5192).Tested
Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release,
maind071124:guest_opus_decgains a mono decoder fed three libopus 6 kb/s narrowband 20 ms packets, then a wideband packet (FFmpeg's flush case).-application voip -b:a 6k -ac 1 -frame_duration 20).mainthe test aborts withOpusDec: unexpected FFmpeg PCM format; with the change it passes, as do the existing checks.Full ctest: 1077/1077 passed (8 skipped on this machine).
tools/check_conventions.py --base upstream/mainpasses.ProsperoRadio (PPSA99001, catalog 01.000.010), relinked, on
main+ fix(libkernel): report SO_ERROR and the other SOL_SOCKET options like FreeBSD #4796. I used its scripted-test hook with a local catalogue of two stations served from 127.0.0.1 (details in ProsperoRadio (PPSA99001) #5192).main+ fix(libkernel): report SO_ERROR and the other SOL_SOCKET options like FreeBSD #4796OpusDec: unexpected FFmpeg PCM formatplayback=3 rate=48000 channels=1, peak 0.58No other open pull request touches libSceOpusDec (
git merge-treeagainst all 562).Rebased onto
mainffa2a6e without conflicts (head fb41f10), then tested again onmainc496fd5:guest_opus_decpasses. Full ctest: 1088/1088 passed (8 skipped on this machine).guest_opus_decpasses. With only this PR's test file on thatmain, it aborts withOpusDec: unexpected FFmpeg PCM format.guest_math,agc_driver_depth_compare_copyandguest_socket_read_writefail the same way onmainb868383 without any of them in this setup.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code