LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
15.41k stars 743 forks source link

how can I run sunshine as a regular user? #2776

Closed huryuion closed 2 days ago

huryuion commented 3 days ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the latest beta/pre-release?

None

Describe the Bug

I tried to run Sunshine as a non-root user, but something unexpected happened. terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ptree_bad_path>' what(): No such node (root.devices) When I use sudo, it works but I get a "Couldn't connect to pulseaudio: Access denied" issue. I've tried changing the permissions of the relevant device files (e.g., /dev/dri/renderD128) and adding my user to the video group, but Sunshine still requires sudo to run properly.

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

debian12

Architecture

64 bit

Sunshine commit or version

v0.23.1

Package

Linux - deb

GPU Type

AMD

GPU Model

780m

GPU Driver/Mesa Version

Mesa 22.3.6

Capture Method

X11 (Linux)

Config

[encoder] -- [vaapi]
[capture] -- [kms]
[locale] -- [zh]
[adapter_name] -- [/dev/dri/renderD128]

Apps

No response

Relevant log output

user@localhost:~$ sunshine
[encoder] -- [vaapi]
[capture] -- [kms]
[locale] -- [zh]
[adapter_name] -- [/dev/dri/renderD128]
[2024:06:30:16:41:15]: Info: Sunshine version: v0.23.1
[2024:06:30:16:41:15]: Info: /dev/dri/card0 -> amdgpu
[2024:06:30:16:41:15]: Error: Environment variable WAYLAND_DISPLAY has not been defined
[2024:06:30:16:41:15]: Info: Trying encoder [vaapi]
[2024:06:30:16:41:15]: Info: Screencasting with KMS
[2024:06:30:16:41:15]: Info: /dev/dri/card0 -> amdgpu
[2024:06:30:16:41:15]: Info: Found monitor for DRM screencasting
[2024:06:30:16:41:15]: Info: Found connector ID [89]
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
[2024:06:30:16:41:15]: Info: Found cursor plane [65]
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Info: System tray created
[2024:06:30:16:41:15]: Info: SDR color coding [Rec. 601]
[2024:06:30:16:41:15]: Info: Color depth: 8-bit
[2024:06:30:16:41:15]: Info: Color range: [JPEG]
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [h264_vaapi @ 0x55657aeec240] No usable encoding entrypoint found for profile VAProfileH264High (7).
[2024:06:30:16:41:15]: Info: Retrying with fallback configuration options for [h264_vaapi] after error: Function not implemented
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Warning: [h264_vaapi @ 0x55657af80140] Driver does not support some wanted packed headers (wanted 0xd, found 0).
[2024:06:30:16:41:15]: Info: SDR color coding [Rec. 601]
[2024:06:30:16:41:15]: Info: Color depth: 8-bit
[2024:06:30:16:41:15]: Info: Color range: [JPEG]
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [hevc_vaapi @ 0x55657af88280] No usable encoding entrypoint found for profile VAProfileHEVCMain (17).
[2024:06:30:16:41:15]: Info: Retrying with fallback configuration options for [hevc_vaapi] after error: Function not implemented
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Warning: [hevc_vaapi @ 0x55657b896000] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
libva info: VA-API version 1.17.0
[2024:06:30:16:41:15]: Info: SDR color coding [Rec. 601]
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
[2024:06:30:16:41:15]: Info: Color depth: 8-bit
[2024:06:30:16:41:15]: Info: Color range: [JPEG]
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [av1_vaapi @ 0x55657b02c680] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:06:30:16:41:15]: Info: Retrying with fallback configuration options for [av1_vaapi] after error: Function not implemented
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [av1_vaapi @ 0x55657b04eb40] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:06:30:16:41:15]: Error: Could not open codec [av1_vaapi]: Function not implemented
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
[2024:06:30:16:41:15]: Info: SDR color coding [Rec. 601]
libva info: Found init function __vaDriverInit_1_17
[2024:06:30:16:41:15]: Info: Color depth: 8-bit
[2024:06:30:16:41:15]: Info: Color range: [JPEG]
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [av1_vaapi @ 0x55657b9e29c0] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:06:30:16:41:15]: Info: Retrying with fallback configuration options for [av1_vaapi] after error: Function not implemented
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [av1_vaapi @ 0x55657b9e3180] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:06:30:16:41:15]: Error: Could not open codec [av1_vaapi]: Function not implemented
[2024:06:30:16:41:15]: Info: Screencasting with KMS
[2024:06:30:16:41:15]: Info: /dev/dri/card0 -> amdgpu
[2024:06:30:16:41:15]: Info: Found monitor for DRM screencasting
[2024:06:30:16:41:15]: Info: Found connector ID [89]
[2024:06:30:16:41:15]: Info: Found cursor plane [65]
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Info: SDR color coding [Rec. 709]
[2024:06:30:16:41:15]: Info: Color depth: 10-bit
[2024:06:30:16:41:15]: Info: Color range: [JPEG]
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Error: [hevc_vaapi @ 0x55657adac300] No usable encoding entrypoint found for profile VAProfileHEVCMain10 (18).
[2024:06:30:16:41:15]: Info: Retrying with fallback configuration options for [hevc_vaapi] after error: Function not implemented
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[2024:06:30:16:41:15]: Warning: [hevc_vaapi @ 0x55657af4b200] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[2024:06:30:16:41:15]: Warning: vaapi: hevc missing sps->vui parameters
[2024:06:30:16:41:15]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:06:30:16:41:15]: Info: 
[2024:06:30:16:41:15]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:06:30:16:41:15]: Info: 
[2024:06:30:16:41:15]: Info: Found H.264 encoder: h264_vaapi [vaapi]
[2024:06:30:16:41:15]: Info: Found HEVC encoder: hevc_vaapi [vaapi]
terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ptree_bad_path>'
  what():  No such node (root.devices)
Aborted