3 Commits

Author SHA1 Message Date
Kristian Ollikainen
6304ad37cd Merge 9576327863 into 32341574dc 2025-11-07 15:50:52 +02:00
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/"
## MangoHud Config ##
RUN mkdir -p "${NESTRI_HOME}/.config/MangoHud"
COPY packages/configs/MangoHud/MangoHud.conf "${NESTRI_HOME}/.config/MangoHud/"
### Artifacts from Builder ###
COPY --from=builder /artifacts/bin/nestri-server /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 {
iceHolder.push(cand);
}
} else {
iceHolder.push(cand);
}
});
@@ -143,6 +141,14 @@ export class WebRTCStream {
sdp: data.sdp.sdp,
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
const answer = await this._pc!.createAnswer();
// Force stereo in Chromium browsers

View File

@@ -271,12 +271,16 @@ func (sp *StreamProtocol) handleStreamRequest(stream network.Stream) {
}
candInit := candidate.ToJSON()
biggified := uint32(*candInit.SDPMLineIndex)
var sdpMLineIndex *uint32
if candInit.SDPMLineIndex != nil {
idx := uint32(*candInit.SDPMLineIndex)
sdpMLineIndex = &idx
}
iceMsg, err := common.CreateMessage(
&gen.ProtoICE{
Candidate: &gen.RTCIceCandidateInit{
Candidate: candInit.Candidate,
SdpMLineIndex: &biggified,
SdpMLineIndex: sdpMLineIndex,
SdpMid: candInit.SDPMid,
},
},
@@ -338,13 +342,15 @@ func (sp *StreamProtocol) handleStreamRequest(stream network.Stream) {
case "ice-candidate":
iceMsg := msgWrapper.GetIce()
if iceMsg != nil {
smollified := uint16(*iceMsg.Candidate.SdpMLineIndex)
cand := webrtc.ICECandidateInit{
Candidate: iceMsg.Candidate.Candidate,
SDPMid: iceMsg.Candidate.SdpMid,
SDPMLineIndex: &smollified,
UsernameFragment: iceMsg.Candidate.UsernameFragment,
}
if iceMsg.Candidate.SdpMLineIndex != nil {
smollified := uint16(*iceMsg.Candidate.SdpMLineIndex)
cand.SDPMLineIndex = &smollified
}
iceHelper.AddCandidate(cand)
} else {
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)
if room != nil {
room.Close()
sp.incomingConns.Set(room.Name, nil)
sp.incomingConns.Delete(room.Name)
}
return
}
@@ -405,7 +411,7 @@ func (sp *StreamProtocol) handleStreamPush(stream network.Stream) {
_ = stream.Reset()
if room != nil {
room.Close()
sp.incomingConns.Set(room.Name, nil)
sp.incomingConns.Delete(room.Name)
}
return
}

View File

@@ -63,13 +63,13 @@ func (p *Participant) SetTrack(trackType webrtc.RTPCodecType, track *webrtc.Trac
p.AudioTrack = track
_, err := p.PeerConnection.AddTrack(track)
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:
p.VideoTrack = track
_, err := p.PeerConnection.AddTrack(track)
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:
slog.Warn("Unknown track type", "participant", p.ID, "trackType", trackType)
@@ -84,14 +84,14 @@ func (p *Participant) Close() {
if p.DataChannel != nil {
err := p.DataChannel.Close()
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
}
if p.PeerConnection != nil {
err := p.PeerConnection.Close()
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
}

View File

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