Skip to content

pause on background instead of disconnecting#66

Open
SandiyosDev wants to merge 11 commits into
hugeBlack:mainfrom
SandiyosDev:pr/background-pause
Open

pause on background instead of disconnecting#66
SandiyosDev wants to merge 11 commits into
hugeBlack:mainfrom
SandiyosDev:pr/background-pause

Conversation

@SandiyosDev

@SandiyosDev SandiyosDev commented May 9, 2026

Copy link
Copy Markdown
Contributor

app kills the parsec connection when you switch apps or lock screen , this pr uses ParsecClientPause to pause and resume video/audio streams

some issues would appear where keys remain pressed even after disconnect, this pr would release all pressed keys on background so key presses doesn't get stuck on the host; gl render loop is also paused so it doesnt crash the app on sleep disconnects

pip controller is now only created when the setting is on (builds on #62), I added a toggle in settings for PiP, I also added toggles for status (top bar) and fixed mute to stop host audio streams instead of muting locally

@SandiyosDev SandiyosDev marked this pull request as draft May 9, 2026 03:02
@SandiyosDev SandiyosDev marked this pull request as ready for review May 9, 2026 03:09
@hugeBlack

Copy link
Copy Markdown
Owner

idk if you have noticed but the root cause of disconnecting in background is not OpenParsec actively disconnecting from host, but VideoToolBox failed to decode the frame in the background for some reason. And the error code we get from ParsecSDK is -14 (DECODE_ERR_DECODE).

<<<< FigApplicationStateMonitor >>>> signalled err=-19431 at <>:474
[D] decoder       = vt
[D] codec         = h265
<< FigOSEventLink >> signalled err=-19424 at <>:817
<<<< DecompressionSessionRemote >>>> signalled err=-12903 at <>:1867
[I] * vt_decode_frame/VTDecompressionSessionDecodeFrame[335] = -12903
<<<< DecompressionSessionRemote >>>> signalled err=-12903 at <>:2849

Even with this pr I still get this error with the video stream frozen.
So I guess it's either an issue within the ParsecSDK or iOS itself does not allow decoding frames if the app enters background.

@SandiyosDev SandiyosDev force-pushed the pr/background-pause branch 2 times, most recently from c3593d1 to d986188 Compare June 22, 2026 20:05
@SandiyosDev

Copy link
Copy Markdown
Contributor Author

idk if you have noticed but the root cause of disconnecting in background is not OpenParsec actively disconnecting from host, but VideoToolBox failed to decode the frame in the background for some reason. And the error code we get from ParsecSDK is -14 (DECODE_ERR_DECODE).


<<<< FigApplicationStateMonitor >>>> signalled err=-19431 at <>:474

[D] decoder       = vt

[D] codec         = h265

<< FigOSEventLink >> signalled err=-19424 at <>:817

<<<< DecompressionSessionRemote >>>> signalled err=-12903 at <>:1867

[I] * vt_decode_frame/VTDecompressionSessionDecodeFrame[335] = -12903

<<<< DecompressionSessionRemote >>>> signalled err=-12903 at <>:2849

Even with this pr I still get this error with the video stream frozen.

So I guess it's either an issue within the ParsecSDK or iOS itself does not allow decoding frames if the app enters background.

Yes, -14 is videotoolbox failing to decode on backgrounding

the ver you tested wasnt gating the render loop in the pip codepath, so it was still decoding, I paused the gl render loop on background so the sdk don't decode frames while backgrounded

Should mention that on longer backgrounds, the connection times out on the sdk side (bg timeout -12007)

I have a separate pr for auto reconnect I’ll make pretty soon, otherwise this pr is rebased to current main and -14 videotoolbox is fixed

@SandiyosDev

Copy link
Copy Markdown
Contributor Author

@hugeBlack Let me know if you need any other revision

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