2 Commits

Author SHA1 Message Date
DatCaptainHorse
9576327863 Rabbit nitpicks 3 and new MangoHud config 2025-11-07 15:50:42 +02:00
DatCaptainHorse
9bee9d4935 Some rabbit nitpick fixes 2 2025-11-07 10:01:22 +02:00
6 changed files with 77 additions and 15 deletions

View File

@@ -72,6 +72,11 @@ RUN mkdir -p "${NESTRI_HOME}/.local/share/Steam/config"
COPY packages/configs/steam/config.vdf "${NESTRI_HOME}/.local/share/Steam/config/" COPY packages/configs/steam/config.vdf "${NESTRI_HOME}/.local/share/Steam/config/"
## MangoHud Config ##
RUN mkdir -p "${NESTRI_HOME}/.config/MangoHud"
COPY packages/configs/MangoHud/MangoHud.conf "${NESTRI_HOME}/.config/MangoHud/"
### Artifacts from Builder ### ### Artifacts from Builder ###
COPY --from=builder /artifacts/bin/nestri-server /usr/bin/ COPY --from=builder /artifacts/bin/nestri-server /usr/bin/
COPY --from=builder /artifacts/bin/bwrap /usr/bin/ COPY --from=builder /artifacts/bin/bwrap /usr/bin/

View File

@@ -0,0 +1,48 @@
legacy_layout=false
# common
horizontal
horizontal_stretch
hud_no_margin
no_small_font
background_alpha=0.66
round_corners=0
background_color=000000
font_size=24
position=top-left
engine_short_names
# colors
text_color=DFDFDF
gpu_color=FF4E00
cpu_color=00AA00
engine_color=00AA00
vram_color=00AA00
ram_color=00AA00
frametime_color=FF4E00
# load colors
cpu_load_color=DFDFDF,DF964D,DF3D3D
gpu_load_color=DFDFDF,DF964D,DF3D3D
# GPU and VRAM
gpu_text=NESTRI
gpu_stats
gpu_load_change
gpu_load_value=70,90
vram
# CPU and RAM
cpu_text=CPU
cpu_stats
cpu_load_change
cpu_load_value=70,90
ram
# FPS and timing
fps
fps_metrics=0.01
frame_timing

View File

@@ -123,8 +123,6 @@ export class WebRTCStream {
} else { } else {
iceHolder.push(cand); iceHolder.push(cand);
} }
} else {
iceHolder.push(cand);
} }
}); });
@@ -143,6 +141,14 @@ export class WebRTCStream {
sdp: data.sdp.sdp, sdp: data.sdp.sdp,
type: data.sdp.type as RTCSdpType, type: data.sdp.type as RTCSdpType,
}); });
// Add held candidates
iceHolder.forEach((candidate) => {
this._pc!.addIceCandidate(candidate).catch((err) => {
console.error("Error adding held ICE candidate:", err);
});
});
iceHolder = [];
// Create our answer // Create our answer
const answer = await this._pc!.createAnswer(); const answer = await this._pc!.createAnswer();
// Force stereo in Chromium browsers // Force stereo in Chromium browsers

View File

@@ -271,12 +271,16 @@ func (sp *StreamProtocol) handleStreamRequest(stream network.Stream) {
} }
candInit := candidate.ToJSON() candInit := candidate.ToJSON()
biggified := uint32(*candInit.SDPMLineIndex) var sdpMLineIndex *uint32
if candInit.SDPMLineIndex != nil {
idx := uint32(*candInit.SDPMLineIndex)
sdpMLineIndex = &idx
}
iceMsg, err := common.CreateMessage( iceMsg, err := common.CreateMessage(
&gen.ProtoICE{ &gen.ProtoICE{
Candidate: &gen.RTCIceCandidateInit{ Candidate: &gen.RTCIceCandidateInit{
Candidate: candInit.Candidate, Candidate: candInit.Candidate,
SdpMLineIndex: &biggified, SdpMLineIndex: sdpMLineIndex,
SdpMid: candInit.SDPMid, SdpMid: candInit.SDPMid,
}, },
}, },
@@ -338,13 +342,15 @@ func (sp *StreamProtocol) handleStreamRequest(stream network.Stream) {
case "ice-candidate": case "ice-candidate":
iceMsg := msgWrapper.GetIce() iceMsg := msgWrapper.GetIce()
if iceMsg != nil { if iceMsg != nil {
smollified := uint16(*iceMsg.Candidate.SdpMLineIndex)
cand := webrtc.ICECandidateInit{ cand := webrtc.ICECandidateInit{
Candidate: iceMsg.Candidate.Candidate, Candidate: iceMsg.Candidate.Candidate,
SDPMid: iceMsg.Candidate.SdpMid, SDPMid: iceMsg.Candidate.SdpMid,
SDPMLineIndex: &smollified,
UsernameFragment: iceMsg.Candidate.UsernameFragment, UsernameFragment: iceMsg.Candidate.UsernameFragment,
} }
if iceMsg.Candidate.SdpMLineIndex != nil {
smollified := uint16(*iceMsg.Candidate.SdpMLineIndex)
cand.SDPMLineIndex = &smollified
}
iceHelper.AddCandidate(cand) iceHelper.AddCandidate(cand)
} else { } else {
slog.Error("Could not GetIce from ice-candidate") slog.Error("Could not GetIce from ice-candidate")
@@ -396,7 +402,7 @@ func (sp *StreamProtocol) handleStreamPush(stream network.Stream) {
slog.Debug("Stream push connection closed by peer", "peer", stream.Conn().RemotePeer(), "error", err) slog.Debug("Stream push connection closed by peer", "peer", stream.Conn().RemotePeer(), "error", err)
if room != nil { if room != nil {
room.Close() room.Close()
sp.incomingConns.Set(room.Name, nil) sp.incomingConns.Delete(room.Name)
} }
return return
} }
@@ -405,7 +411,7 @@ func (sp *StreamProtocol) handleStreamPush(stream network.Stream) {
_ = stream.Reset() _ = stream.Reset()
if room != nil { if room != nil {
room.Close() room.Close()
sp.incomingConns.Set(room.Name, nil) sp.incomingConns.Delete(room.Name)
} }
return return
} }

View File

@@ -63,13 +63,13 @@ func (p *Participant) SetTrack(trackType webrtc.RTPCodecType, track *webrtc.Trac
p.AudioTrack = track p.AudioTrack = track
_, err := p.PeerConnection.AddTrack(track) _, err := p.PeerConnection.AddTrack(track)
if err != nil { if err != nil {
slog.Error("Failed to add Participant audio track", "participant", p.ID, "err", err) slog.Error("Failed to add audio track", "participant", p.ID, "err", err)
} }
case webrtc.RTPCodecTypeVideo: case webrtc.RTPCodecTypeVideo:
p.VideoTrack = track p.VideoTrack = track
_, err := p.PeerConnection.AddTrack(track) _, err := p.PeerConnection.AddTrack(track)
if err != nil { if err != nil {
slog.Error("Failed to add Participant video track", "participant", p.ID, "err", err) slog.Error("Failed to add video track", "participant", p.ID, "err", err)
} }
default: default:
slog.Warn("Unknown track type", "participant", p.ID, "trackType", trackType) slog.Warn("Unknown track type", "participant", p.ID, "trackType", trackType)
@@ -84,14 +84,14 @@ func (p *Participant) Close() {
if p.DataChannel != nil { if p.DataChannel != nil {
err := p.DataChannel.Close() err := p.DataChannel.Close()
if err != nil { if err != nil {
slog.Error("Failed to close Participant DataChannel", err) slog.Error("Failed to close DataChannel", "participant", p.ID, "err", err)
} }
p.DataChannel = nil p.DataChannel = nil
} }
if p.PeerConnection != nil { if p.PeerConnection != nil {
err := p.PeerConnection.Close() err := p.PeerConnection.Close()
if err != nil { if err != nil {
slog.Error("Failed to close Participant PeerConnection", err) slog.Error("Failed to close PeerConnection", "participant", p.ID, "err", err)
} }
p.PeerConnection = nil p.PeerConnection = nil
} }

View File

@@ -10,9 +10,6 @@ export DISPLAY=:0
# Causes some setups to break # Causes some setups to break
export PROTON_NO_FSYNC=1 export PROTON_NO_FSYNC=1
# Sleeker Mangohud preset :)
export MANGOHUD_CONFIG=preset=2
# Make gstreamer GL elements work without display output (NVIDIA issue..) # Make gstreamer GL elements work without display output (NVIDIA issue..)
export GST_GL_API=gles2 export GST_GL_API=gles2
export GST_GL_WINDOW=surfaceless export GST_GL_WINDOW=surfaceless