sf-ui 0.1.4: video sound always decoded (no AC3 passthrough)
All checks were successful
ci / test (push) Successful in 21m47s

When the HDMI sink also offers AC3/E-AC3 passthrough (WirePlumber's
iec958 codecs), pulsesink took the encoded track as it was: a 44.1 kHz
AC3 track failed at once ("Failed to connect stream: No such entity")
and a 48 kHz one went out as a bitstream that stuttered on a Raspberry
Pi 4. The player's audio sink is now audioconvert ! audioresample !
audio/x-raw ! pulsesink, so it always gets PCM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tamas Csikel
2026-11-02 20:27:46 +01:00
parent 629f647728
commit 54905d5f10
3 changed files with 15 additions and 10 deletions

8
Cargo.lock generated
View File

@@ -4810,7 +4810,7 @@ dependencies = [
[[package]] [[package]]
name = "sf-app" name = "sf-app"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"log", "log",
@@ -4820,7 +4820,7 @@ dependencies = [
[[package]] [[package]]
name = "sf-pack" name = "sf-pack"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"ruzstd", "ruzstd",
@@ -4832,7 +4832,7 @@ dependencies = [
[[package]] [[package]]
name = "sf-ui" name = "sf-ui"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"glow 0.16.0", "glow 0.16.0",
@@ -4848,7 +4848,7 @@ dependencies = [
[[package]] [[package]]
name = "sf-ui-gallery" name = "sf-ui-gallery"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"env_logger", "env_logger",

View File

@@ -5,7 +5,7 @@ members = ["sf-app", "sf-ui", "sf-ui/gallery", "sf-pack"]
exclude = ["templates/rust-app"] exclude = ["templates/rust-app"]
[workspace.package] [workspace.package]
version = "0.1.3" version = "0.1.4"
edition = "2024" edition = "2024"
license = "MIT" license = "MIT"
repository = "https://gitea.bluefox.support/fennec/sdk" repository = "https://gitea.bluefox.support/fennec/sdk"

View File

@@ -229,11 +229,16 @@ impl Player {
Err(e) => log::warn!("video: vapostproc: {e}"), Err(e) => log::warn!("video: vapostproc: {e}"),
} }
} }
if let Some(audio) = ["pulsesink", "pipewiresink"] // Always decoded sound (PCM). When the HDMI sink also offers AC3/E-AC3
.iter() // passthrough, pulsesink would take the encoded track as it is: a
.find_map(|n| gst::ElementFactory::make(n).build().ok()) // 44.1 kHz AC3 track then fails ("Failed to connect stream: No such
{ // entity") and a 48 kHz one goes out as a bitstream that stutters on
playbin.set_property("audio-sink", &audio); // the Raspberry Pi.
if let Some(sink) = ["pulsesink", "pipewiresink"].into_iter().find(|n| gst::ElementFactory::find(n).is_some()) {
match gst::parse::bin_from_description(&format!("audioconvert ! audioresample ! audio/x-raw ! {sink}"), true) {
Ok(bin) => playbin.set_property("audio-sink", &bin),
Err(e) => log::warn!("video: audio sink: {e}"),
}
} }
playbin.set_property("subtitle-font-desc", opts.subtitle_font.as_str()); playbin.set_property("subtitle-font-desc", opts.subtitle_font.as_str());
playbin.set_property("av-offset", opts.audio_offset_ms * 1_000_000); playbin.set_property("av-offset", opts.audio_offset_ms * 1_000_000);