Commit Graph

333 Commits

Author SHA1 Message Date
ns6089
b494d06f89 Adjust capture rate to better match display 2023-08-27 13:13:43 -05:00
ns6089
6683ea2ac1 Rework capture sleeps for better frame stability 2023-08-27 13:13:43 -05:00
ns6089
42a77b247e Release duplication frame after snapshot 2023-08-27 13:13:43 -05:00
ns6089
730fce4b1c Move client frame interval to local variable 2023-08-27 13:13:43 -05:00
ns6089
d2a634ee09 Don't check AccumulatedFrames
AMF doesn't do it and MSDN is unclear about it.
2023-08-27 13:13:43 -05:00
ns6089
d81e2cecaa Add high_precision_sleep() method 2023-08-27 13:13:43 -05:00
ns6089
8dc51a21df Remove DwmFlush() 2023-08-27 13:13:43 -05:00
Cameron Gutman
ebb6a7c9a9
Specify the source address for outbound audio and video traffic (#1569) 2023-08-26 16:37:04 -05:00
Cameron Gutman
24e7bd20fd Allow displays to avoid probing HEVC or AV1 codecs even when H.264 is supported
This is the case for AMF which requires certain versions for HEVC Main10 and AV1 support.
2023-08-26 12:38:24 -05:00
Cameron Gutman
728a9cc66f Treat codec modes as soft requirements 2023-08-26 12:38:24 -05:00
Cameron Gutman
ef2279d627 Allow the display to reject unsupported codecs 2023-08-26 12:38:24 -05:00
Cameron Gutman
f9a00f3ed4 Fix FFmpeg logging going to stdout rather than our log file 2023-08-24 18:24:24 -05:00
Cameron Gutman
9d79018e9d Fix AMF debug logging to be conditional based on configured log level 2023-08-24 18:24:24 -05:00
ns6089
cea9f152d8 Add log message for audio capture buffer oveflow 2023-08-22 23:27:14 -05:00
ns6089
2c44c4dbd2 Add log message for audio buffer discontinuity 2023-08-22 23:27:14 -05:00
ns6089
3ceee008f3 Use MMCSS task in audio capture thread 2023-08-22 23:27:14 -05:00
ns6089
4d94bcc3b0
nvenc: improve rfi logic (#1542) 2023-08-22 22:24:47 -05:00
Cameron Gutman
4f748c5343 Disable libsvtav1 due to showstopping bugs 2023-08-19 18:36:48 -05:00
Cameron Gutman
625214776e Print an error if the encoder doesn't produce an IDR frame on demand 2023-08-19 18:36:48 -05:00
Cameron Gutman
d4d62b7b23 Remove nonsense operator combo 2023-08-19 18:36:48 -05:00
Cameron Gutman
190c9b4216 Move AMF version check into display_vram_t to avoid blocking software encoding 2023-08-19 18:36:48 -05:00
Cameron Gutman
8b05674290 Turn off AMF filler data to match other encoders 2023-08-19 18:36:48 -05:00
Cameron Gutman
69e720b44b Implement AV1 support 2023-08-19 18:36:48 -05:00
Cameron Gutman
67c1fa6da7 Populate the last payload length field in the video header 2023-08-19 18:36:48 -05:00
Elia Zammuto
a84dea3862
Windows Manifest improvements (#1557)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2023-08-19 14:06:35 -04:00
Cameron Gutman
22ab9948fa Pass the environment as a const reference so nobody else is tempted to modify it 2023-08-16 21:48:16 -05:00
Cameron Gutman
774f13aecb Fix race condition inserting new process into our job object
Before this fix, it could spawn a child that would escape our tracking if it ran before we added it to our job object.
2023-08-16 21:48:16 -05:00
Chase Payne
06a6d94e87 removing debug code left from another commit 2023-08-15 18:37:24 -05:00
Chase Payne
2c953a3ce7 bugfix: fixed a bug that caused SUNSHINE_CLIENT_HDR to always be false 2023-08-15 18:37:24 -05:00
Chase Payne
980e396c4f
Command Resource Exhaustion bug fix (#1531)
Co-authored-by: kirksaunders <kirksaunders12@gmail.com>
2023-08-14 19:50:23 -04:00
ns6089
def9b2d76f Add missing software device creation override 2023-08-13 15:15:32 -05:00
ns6089
f2f63cdfff nvenc: properly apply minqp to I-frames 2023-08-13 15:15:32 -05:00
ns6089
6c5fa8a08d Mark nvapi_QueryInterface as cdecl
Shouldn't matter on x64 since everything is fastcall here, but cdecl is
the correct declaration.
2023-08-13 07:01:09 -05:00
ns6089
68fa43a61c Add standalone NVENC encoder 2023-08-13 07:01:09 -05:00
ns6089
b5816be104 Remove extra namespace typo 2023-08-13 07:01:09 -05:00
Cameron Gutman
166924427e Use existing H.264 SPS as a template rather than building it from scratch 2023-08-13 05:37:16 -05:00
Cameron Gutman
e465014433 Fix stack exhaustion in make_sps_hevc() 2023-08-13 05:37:16 -05:00
Cameron Gutman
cadd3da9a7 Use UTF-8 conversion for log output and C standard library functions 2023-08-11 20:15:14 -05:00
Cameron Gutman
4186d83027 Disable HDR encoding for AMF versions below 1.4.23 2023-08-11 18:27:39 -05:00
Cameron Gutman
eafb018516 Fix clamping mouse position to aspect ratio adjusted viewport
Fixes #1512
2023-08-08 23:42:29 -05:00
Cameron Gutman
21dbde9467 Fix touch input on UAC secure desktop and login screen 2023-08-03 23:04:13 -05:00
Cameron Gutman
d7c76cfd2b Update gamepad touch support with latest protocol changes 2023-08-03 19:16:09 -05:00
Cameron Gutman
bd68aebe4c Implement pen and touch support for Windows 2023-08-03 19:16:09 -05:00
Django
43463a9d1e
Add default_value parameter to get_env for use in make_launch_session (#1490) 2023-08-01 23:08:45 -04:00
Cameron Gutman
f3a257b150 Fix QoS code build with new MinGW headers 2023-07-30 16:35:24 -04:00
Cameron Gutman
d07f5dbd1b Fix audio code build with new MinGW headers 2023-07-30 16:35:24 -04:00
Elia Zammuto
3b2a098640
Expose Connection environment variables to the app start (#1430)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2023-07-29 14:21:58 -04:00
ns6089
f245f777f7 Modify and restore NVIDIA control panel settings
Namely:
- Power profile for sunshine.exe
- Global OpenGL/Vulkan DXGI swapchain
2023-07-19 01:14:08 -05:00
Cameron Gutman
50f353d183 Fix handling of gamepad feedback with multiple clients connected
We need to use the client-relative index rather than the global index
when sending feedback to the client.
2023-07-10 21:45:37 -05:00
Cameron Gutman
65b2e19b07 Rework active gamepad mask handling to be multi-channel-safe
We may get activeGamepadMask changes out of order between different
controller channels, so only check the bit of the mask corresponding to the
controller number specified in the event itself.

This also fixes the "ControllerNumber not allocated" warning each time a
gamepad is removed.
2023-07-10 21:45:37 -05:00
Cameron Gutman
3acc7ef557 Remove unused variable 2023-07-10 21:45:37 -05:00
Cameron Gutman
2ed2dd5e0e Implement touch, motion, and battery for DS4 2023-07-10 21:45:37 -05:00
Cameron Gutman
309fcc4142 Convert rumble_queue into a generic feedback_queue for gamepad messages 2023-07-10 21:45:37 -05:00
Cameron Gutman
fd77230964 Stub controller battery, touch, and motion packets 2023-07-10 21:45:37 -05:00
Cameron Gutman
1ef8cb1111 Send feature flags in RTSP DESCRIBE response 2023-07-10 21:45:37 -05:00
ns6089
6dfe56518c Decrease gpu scheduling priority for NVIDIA
Fixes #1031
2023-07-09 18:50:10 -05:00
Cameron Gutman
c5bf78176e Remove GetAsyncKeyState() check before sending mouse button events
It's unnecessary and breaks in cases where event processing is slow

Fixes #1433
2023-07-08 22:58:12 -05:00
jcj83429
d075424225 Add support for Applications (context menu) key in the Windows platform
I will add corresponding support in moonlight-qt.
2023-07-08 21:21:18 -05:00
Casey Korver
881af5b566 Correct typos in logging 2023-07-08 19:56:56 -05:00
Casey Korver
b1ffa8a6c5 Correct typos in comments 2023-07-08 18:56:27 -05:00
Cameron Gutman
70dc582f38 Refactor gamepad emulation code to use the DS4 extended report format
This has the side-effect of fixing #1407 due to the incorrect assumption that
it's safe to cast our gamepad_state_t to a XUSB_REPORT.
2023-07-08 11:34:16 -05:00
aetheryx
c972fa880f fix: consider link-local addresses as LAN 2023-07-06 22:53:38 -05:00
Cameron Gutman
810945f5bf Allow use of multiple ENet channels 2023-07-04 15:48:31 -05:00
Cameron Gutman
11aedf56a2 Implement controller arrival metadata support 2023-06-30 20:47:29 -05:00
Cameron Gutman
12e6774035 Fix max gamepad count to match protocol limitation 2023-06-27 21:11:19 -05:00
Cameron Gutman
feedede6f9 Implement extended controller button support 2023-06-27 21:11:19 -05:00
Cameron Gutman
737be029ec Move input packet debug prints off the control stream thread
The control stream thread is extremely performance-sensitive.
2023-06-27 18:53:01 -05:00
Cameron Gutman
62606a62f9 Implement input batching for reduced latency 2023-06-27 18:53:01 -05:00
Era Dorta
ed74492e4e
fix(deps): replace libboost chrono and thread with standard chrono and thread (#1364)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2023-06-26 11:50:10 -04:00
Conn O'Griofa
72d63aae68
windows: fix header conflict for msys2-w32api-headers 11.0.1+ (#1332) 2023-05-29 20:00:52 -04:00
Cameron Gutman
8090fb496b Fix software encoding defaulting to HEVC instead of H.264
Regression introduced by d973e5bbc7
2023-05-28 19:29:07 -05:00
Cameron Gutman
f734d6684f Reset the default audio device on startup if Steam Streaming Speakers are selected
Fixes lack of audio device restoration if Sunshine crashes while streaming
2023-05-27 14:24:38 -05:00
Cameron Gutman
bca61bfc0d Always change the sink if it differs from the active sink
Fixes audio sink field not changing devices properly
2023-05-27 14:24:38 -05:00
Cameron Gutman
9a65c91671 Rename SunshineSvc to SunshineService
This avoids a MalwareBytes false positive.

Fixes #1126
2023-05-26 17:54:38 -05:00
Cameron Gutman
8da919f411 Rename Back Button Timeout and disable it by default
Users don't expect long presses of the back button to not work out of the box.
2023-05-25 20:03:53 -05:00
Cameron Gutman
b3f57cf90d Fix emulated Home/Guide presses being missed
Fixes #1048
2023-05-25 20:03:53 -05:00
Cameron Gutman
2f4cc9ace0 Add option to always send scancodes
Default is enabled to match v0.19.1 behavior

Fixes #1233
2023-05-25 19:31:39 -05:00
Cameron Gutman
0f1dc1bb05 Print a warning if GameStream is using conflicting ports 2023-05-25 19:07:13 -05:00
Cameron Gutman
fbb77aa7cd Prefer virtual sink over audio sink if host playback is disabled
Fixes "Play audio on host PC" option not working when audio sink is manually set
2023-05-24 20:34:13 -05:00
Cameron Gutman
5a4fd95765 Rewrite UPnP support
- Fixes port mappings expiring after a day
- Fixes support for IGDv1 gateways
- Fixes handling of gateway reboots/resets
2023-05-22 22:53:36 -05:00
Cameron Gutman
25e0244705 Stop reporting ExternalIP field to clients
At best, it doesn't help compared to Moonlight's STUN logic.

At worst, it makes things worse by providing an incorrect WAN address that overrides STUN.
2023-05-22 22:53:36 -05:00
Cameron Gutman
85af19150c Fix leak of AVPackets 2023-05-22 19:44:04 -05:00
Cameron Gutman
5b24148cfa Fix leak of VA driver resources on each encoder init 2023-05-22 19:44:04 -05:00
Cameron Gutman
8a9eed2f6f Fix leak of X509 on each HTTPS request 2023-05-22 19:44:04 -05:00
Cameron Gutman
32ca9d41de Fix crash on exit if a process is currently running 2023-05-15 19:11:51 -06:00
Cameron Gutman
33dafbc801 Add warning when Desktop Duplication API masks protected content from capture 2023-05-14 14:28:03 -05:00
Cameron Gutman
17124deb22 Fix const-correctness bugs in round_robin.h 2023-05-11 20:52:44 -05:00
Cameron Gutman
fabadaad2a Fix const-correctness bugs in uniq_ptr and code that uses it 2023-05-11 20:52:44 -05:00
Cameron Gutman
0fa406dbb7 Remove unnecessary moves in return statements 2023-05-11 20:52:44 -05:00
Cameron Gutman
ff046bb707 Fix and enable -Wmissing-braces 2023-05-11 20:52:44 -05:00
Cameron Gutman
390dc1c245 Fix unused-but-set-variable warnings on Mac and Linux 2023-05-11 20:52:44 -05:00
Cameron Gutman
2571682886 Fix pessimizing move warnings on Clang 2023-05-11 20:52:44 -05:00
Cameron Gutman
8db0ad0cc6 Fix and enable -Wmaybe-uninitialized 2023-05-11 20:52:44 -05:00
Cameron Gutman
f08ba0fd7c Fix missing override specifier on set_frame() 2023-05-11 20:52:44 -05:00
Cameron Gutman
a4f788f853 Replace Win32 UTF-16 conversion with std::wstring_convert
Removes VLA that upsets Clang and MSVC
2023-05-11 20:52:44 -05:00
Cameron Gutman
1c83a44222 Fix const reference and const pointer types in wrap_ptr
They were const refs to a T rather than a ref to a const T.
2023-05-11 20:52:44 -05:00
istori1
9e23b39634 Add NO_RC_BUF_LIMIT vaapi 2023-05-11 18:59:13 -05:00
Cameron Gutman
71dcef8259 Fix systray icon sometimes not appearing after login 2023-05-11 18:32:33 -05:00
Cameron Gutman
53125ffeca
Add support for installing the Steam Streaming Speakers driver (#1262)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2023-05-09 20:02:28 -05:00
Cameron Gutman
4ae412b219 Allow localAudioPlayMode to change on /resume
Newer clients send all /launch parameters to /resume too
2023-05-08 18:57:55 -05:00