From 853b63e543bbc72081c59d7e10d7c968178ce0ae Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 2 Nov 2026 13:02:11 +0100 Subject: audio: http streaming, opus/mkv support and stream recovery - read http(s) urls through a MediaSourceStream instead of failing - register the libopus decoder and enable mkv/aac/isomp4 in symphonia - resample to the device rate with linear interpolation - rebuild the output stream when the backend dies instead of leaving playback silent while the daemon still reports "Playing" A dead pcm makes cpal call the error callback hundreds of thousands of times per second, so errors are only counted there and reported once when the stream is dropped. The first failure of a healthy stream is retried immediately, consecutive failures back off, and a stream that played long enough clears the failure budget. --- Cargo.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index 9c69f54..7a4524a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,6 +22,7 @@ dependencies = [ "serde", "serde_json", "symphonia", + "symphonia-adapter-libopus", "toml", "zbus", ] @@ -1653,6 +1654,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "opusic-sys" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d1ecdf206421bc74343ab3bb2f30ad2abbfee41fa341f7181fecbaf957769a" +dependencies = [ + "cmake", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -2325,13 +2335,27 @@ dependencies = [ "lazy_static", "symphonia-bundle-flac", "symphonia-bundle-mp3", + "symphonia-codec-aac", "symphonia-codec-vorbis", "symphonia-core", + "symphonia-format-isomp4", + "symphonia-format-mkv", "symphonia-format-ogg", "symphonia-format-riff", "symphonia-metadata", ] +[[package]] +name = "symphonia-adapter-libopus" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6febe6f88f9a9483db7e5b72a2dad916d8f8eb588d18905a39c861319fc7fa1" +dependencies = [ + "log", + "opusic-sys", + "symphonia-core", +] + [[package]] name = "symphonia-bundle-flac" version = "0.6.0" @@ -2355,6 +2379,18 @@ dependencies = [ "symphonia-core", ] +[[package]] +name = "symphonia-codec-aac" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1979c515a76371b186aad2feff5f23e21cbec775bf95de08bf1e3af92a2ad76" +dependencies = [ + "lazy_static", + "log", + "symphonia-common", + "symphonia-core", +] + [[package]] name = "symphonia-codec-vorbis" version = "0.6.0" @@ -2391,6 +2427,30 @@ dependencies = [ "smallvec", ] +[[package]] +name = "symphonia-format-isomp4" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d179a01305b3505940135a9f0180d6ef4b487912748fe97554756f120fbd05e" +dependencies = [ + "log", + "symphonia-common", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-format-mkv" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb17713e134f5ad316c2690fa3104590ccc85842cdbcf82c3cd1a845cb08aa74" +dependencies = [ + "lazy_static", + "log", + "symphonia-common", + "symphonia-core", +] + [[package]] name = "symphonia-format-ogg" version = "0.6.0" -- cgit v1.2.3