Skip to content

window capture, audio lag fix, reasonable volume, remove mouse cursor#7

Open
jayv wants to merge 1 commit into
omarroth:mainfrom
jayv:jayv/windowed_audiolag_dontblowmyspeakers
Open

window capture, audio lag fix, reasonable volume, remove mouse cursor#7
jayv wants to merge 1 commit into
omarroth:mainfrom
jayv:jayv/windowed_audiolag_dontblowmyspeakers

Conversation

@jayv

@jayv jayv commented Jun 19, 2026

Copy link
Copy Markdown

Here are a number of changes I made on my Linux/AMDGPU system to make streaming to a Samsung TV (Airplay compatible) as well as an AppleTV4K+HomePod bearable.

  • Removes code that adds a synthetic 0.5s audio delay, which made watching sports/talk unbearable
2026/06/19 13:59:28 [SETUP] raising session latency to receiver playout floor: 500ms
2026/06/19 13:59:30 [AUDIO] audio latency: 22050 samples
  • feature: explicit window capture instead of full screen (e.g. use xdotool selectwindow you can get the ID to pass in so you can capture a background window while working on something else)

  • sets volume to "20", the existing code maxed out the volume on either my TV or my AppleTV/HomePod almost blowing the speakers on stream launch, that's an extremely careless default choice. 20 was about 30% volume which seems far more reasonable.

  • removes the "fake" mouse cursor X11 adds, when broadcasting a background window it's very weird to see the cursor move around when you're working on something else in the foreground

@omarroth

Copy link
Copy Markdown
Owner

Thanks for the contribution!

I'm finding there's quite a bit more variance between third-party receivers than I would have expected (see #4 and e.g., jqssun/android-display-mirror#10 that uses this project). If you can provide the specific model of the device you're using I would like to start compiling a list of "supported" third-party receivers that I can either purchase separately or ask contributors to test.

I'll still trying to understand the behavior of the actual iOS client and what it does to avoid these issues. This PR unfortunately breaks audio on the device I'm testing on (Roku Streaming Stick 4K, the AppleTV4K is fine). Streaming to a Apple TV with a homepod as the audio output I've also noticed has a noticeable delay that I'm working in another branch.

Happy to accept the x11 stuff in a standalone PR, since that doesn't appear to cause breakage. Surprised there isn't a display portal equivalent on X11 at this point.

I'll double check the volume: 0 with some of the wireshark captures I have but I believe that's the default behavior of the iOS client. Does not appear to cause breakage so I'm happy to accept that as a standalone PR if it fixes an issue for you.

Also, as a heads up this project is licensed under the LGPL version 3.0 or later as of 02d0045 so please make sure you're comfortable providing any code under the new license.

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