Skip to content

fix: improve legacy Cast receiver compatibility - #6

Open
tomasmark79 wants to merge 6 commits into
omid:hardware-encodingfrom
tomasmark79:fix/legacy-cast-streaming
Open

tomasmark79 wants to merge 6 commits into
omid:hardware-encodingfrom
tomasmark79:fix/legacy-cast-streaming

Conversation

@tomasmark79

@tomasmark79 tomasmark79 commented Sep 2, 2026 •

Copy link
Copy Markdown

Summary

  • send RTCP sender reports correctly from unconnected RTP sockets
  • accept legacy Cast device certificates while still verifying the expected device identity
  • pace RTP packets in bounded 10 ms bursts to avoid overrunning receiver buffers
  • add an Automatic/VP8/VP9/H.264/AV1 codec preference, allowing incompatible receivers to be pinned to VP8 without device-specific code
  • add flake.lock so Nix builds use a reproducible dependency set

Validation

  • cargo test (96 passed)
  • cargo clippy --all-targets -- -D warnings
  • Prettier and ESLint
  • strict GSettings schema validation
  • translation extraction, merge, and compilation
  • nix flake check --no-build
  • Nix production build
  • live 1080p30 mirroring with the new VP8 preference for over 100 seconds on an LG OLED55C21LA; the receiver accepted only VP8 and kept returning RTCP feedback

Nix dependency lock

The lock file pins nixpkgs to 34ab99075ac4f7e40cf037eef32cb1c360bb85e9 (nixos-unstable). It makes the Rust, GStreamer, and other build inputs reproducible; it does not contain receiver-specific configuration.

Notes

The five commits are kept separate by concern. Automatic codec selection preserves the existing behaviour. A forced codec is an explicit compatibility escape hatch; per-device profiles can build on this preference later.

@omid
omid changed the base branch from main to hardware-encoding September 2, 2026 18:15
@omid
omid force-pushed the hardware-encoding branch from d4d6992 to 3b2c4a0 Compare September 2, 2026 18:39
Comment thread daemon/src/discovery.rs Outdated
/// decoder stops consuming the stream shortly after a large 1080p frame.
/// Keep this deliberately narrow until the quirk is confirmed elsewhere.
pub fn requires_vp8_mirroring(&self) -> bool {
matches!(self.model.as_str(), "OLED55C21LA")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer an option in the settings/preferences instead of this.

I know it's not the best case, specially if you have multiple devices, but in that case, in the future we can create profiles in the settings, so users can define preset profiles per device id/name.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I removed the model-specific quirk and replaced it with a Video codec preference (Automatic, VP8, VP9, H.264, AV1). Automatic preserves the existing negotiation; users with an incompatible receiver can force VP8. The preference is wired through GSettings and D-Bus into the OFFER, documented, translated, tested, and live-tested at 1080p30 on the affected LG. I also rebased the branch onto the current hardware-encoding head.

@tomasmark79
tomasmark79 force-pushed the fix/legacy-cast-streaming branch from b2bfc40 to c2fd6d3 Compare September 2, 2026 19:23
</choices>
<default>'auto'</default>
<summary>Video codec</summary>
<description>Which codec to offer for Cast Streaming. "auto" offers every codec available on this computer and lets the receiver choose. Force VP8 when a receiver freezes or displays a broken picture with another codec.</description>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text here is too much and can be wrong technically: Force VP8 when a receiver freezes or displays a broken picture with another codec.. Please ask your AI to not develop just specifically for your case.


#: extension/gnome-shell-cast@oxygenws.com/prefs.js:170
msgid "Choose VP8 if the receiver freezes or displays a broken picture"
msgstr ""

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good that it's missing... but anyway... it's missing :D

"Which codec to offer for Cast Streaming. \"auto\" offers every codec "
"available on this computer and lets the receiver choose. Force VP8 when a "
"receiver freezes or displays a broken picture with another codec."
msgstr ""

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also missing.
There is a skill to update translations, prefer that over manually touching translations

Comment thread README.md Outdated
@omid

omid commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Thanks.
I'll review/test it more carefully later.
There is at least one branch on its way to be merged.

@tomasmark79

Copy link
Copy Markdown
Author

Ok. I'll go through the requirements. I'm still working on the issue with the delayed audio channel, so I'll push it all at once after that.

@tomasmark79
tomasmark79 requested a review from omid September 4, 2026 17:11
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