fpv-wtf / dji-moonlight-embedded

GNU General Public License v3.0
10 stars 2 forks source link

[Linux] unable to set configuration: (-6) resource busy #4

Closed bfahrenfort closed 1 year ago

bfahrenfort commented 1 year ago

I have the Moonlight shim installed on my rooted Goggles V2 and connected to my PC (on the shim screen), and Sunshine is running. After pairing this fork to Sunshine, running sudo ./moonlight stream -app 'Desktop' -1080 -fps 60 -localaudio -viewonly -packetsize 1000000 errors after establishing a connection. Any thoughts? Thanks!

Full log from moonlight:

No host address specified. Using 127.0.0.1
Connecting to 127.0.0.1...
RTSP port: 48010
Initializing platform...done
Resolving host name...done
Packet size capped at 1KB for remote streaming
Initializing audio stream...done
Starting RTSP handshake...Reference frame invalidation is not supported by this host
Audio port: 48000
Video port: 47998
Control port: 47999
done
Initializing control stream...done
Initializing video stream...done
Initializing input stream...done
Starting control stream...done
Starting video stream...dji_usb: 1920 x 1080 @ 60 FPS
dji_usb: context = (nil)
dji_usb: drFlags = 0x1
unable to set configuration: (-6) Resource busy

Log from Sunshine:

[2023:06:11:12:11:51]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:06:11:12:11:51]: Info: Trying encoder [nvenc]
[2023:06:11:12:11:51]: Info: Screencasting with X11
[2023:06:11:12:11:51]: Info: Configuring selected monitor (4) to stream
[2023:06:11:12:11:51]: Info: Streaming display: HDMI-0 with res 1920x1080 offset by 0x0
[2023:06:11:12:11:51]: Info: SDR color coding [Rec. 601]
[2023:06:11:12:11:51]: Info: Color range: [JPEG]
[2023:06:11:12:11:51]: Error: Failed to create a CUDA device: Operation not supported
[2023:06:11:12:11:51]: Info: Screencasting with X11
[2023:06:11:12:11:51]: Info: Configuring selected monitor (4) to stream
[2023:06:11:12:11:51]: Info: Streaming display: HDMI-0 with res 1920x1080 offset by 0x0
[2023:06:11:12:11:51]: Info: SDR color coding [Rec. 601]
[2023:06:11:12:11:51]: Info: Color range: [JPEG]
[2023:06:11:12:11:51]: Error: Failed to create a CUDA device: Operation not supported
[2023:06:11:12:11:51]: Info: Encoder [nvenc] failed
[2023:06:11:12:11:51]: Info: Trying encoder [vaapi]
[2023:06:11:12:11:51]: Info: Screencasting with X11
[2023:06:11:12:11:51]: Info: Configuring selected monitor (4) to stream
[2023:06:11:12:11:51]: Info: Streaming display: HDMI-0 with res 1920x1080 offset by 0x0
[2023:06:11:12:11:51]: Error: Couldn't initialize EGL display: [00003008]
[2023:06:11:12:11:51]: Info: Screencasting with X11
[2023:06:11:12:11:51]: Info: Configuring selected monitor (4) to stream
[2023:06:11:12:11:51]: Info: Streaming display: HDMI-0 with res 1920x1080 offset by 0x0
[2023:06:11:12:11:51]: Error: Couldn't initialize EGL display: [00003008]
[2023:06:11:12:11:51]: Info: Encoder [vaapi] failed
[2023:06:11:12:11:51]: Info: Trying encoder [software]
[2023:06:11:12:11:51]: Info: Screencasting with X11
[2023:06:11:12:11:51]: Info: Configuring selected monitor (4) to stream
[2023:06:11:12:11:51]: Info: Streaming display: HDMI-0 with res 1920x1080 offset by 0x0
[2023:06:11:12:11:51]: Info: SDR color coding [Rec. 601]
[2023:06:11:12:11:51]: Info: Color range: [JPEG]
[2023:06:11:12:11:51]: Info: 
[2023:06:11:12:11:51]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2023:06:11:12:11:51]: Info: 
[2023:06:11:12:11:51]: Info: Found encoder software: [libx264]
[2023:06:11:12:11:51]: Info: CLIENT CONNECTED
[2023:06:11:12:11:57]: Info: CLIENT DISCONNECTED
[2023:06:11:12:12:01]: Error: Initial Ping Timeout
[2023:06:11:12:12:01]: Error: Initial Ping Timeout
j005u commented 1 year ago

Merge this PR https://github.com/fpv-wtf/dji-moonlight-embedded/pull/1 and it should build successfully.

Poked Knifa on merging it on Discord.

bfahrenfort commented 1 year ago

Appreciated! cloned the fork, switched to the branch, fiddled with some drivers, and it's working perfectly. Posted this with my goggles as the display, desktop app from Sunshine to the moonlight shim.

j005u commented 1 year ago

Closing as the PR has been merged.

Also attaching a flatpak .yml that can also be used to build for Linux in case we don't end up doing anything else with it: wtf.fpv.moonlight-embedded.zip