Skip to content

[Bug Report] play.py with --livestream 2 establishes WebRTC session without a video track, resulting in blank viewport #5364

Closed

Description

@100milliongold

Describe the bug

When scripts/reinforcement_learning/rsl_rl/play.py is run with --livestream 2, WebRTC signaling completes successfully, ICE reaches connected, and all 5 data-channels open (input_channel_v1, cursor_channel, stats_channel, control_channel, remote_trace_channel). However, no inbound-rtp (kind=video) entry appears in chrome://webrtc-internals — the server never creates a video RTP stream.

In contrast, scripts/demos/quadrupeds.py with the same flags produces an inbound-rtp (kind=video, codec=H264) entry and the viewport renders correctly in the browser.

On the client side, document.querySelector('video') shows videoWidth=0, videoHeight=0, currentTime=0 — no frames ever arrive.

Steps to reproduce

cd IsaacLab

# WORKS — browser shows quadruped robots, video track H264 flowing
./isaaclab.sh -p scripts/demos/quadrupeds.py --livestream 2

# FAILS — WebRTC connected but no video track, blank viewport
./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/play.py \
  --task Isaac-Ant-v0 --num_envs 4 --livestream 2

Open http://<host>/viewer/ (NVIDIA web viewer sample) in Chrome, then open chrome://webrtc-internals in another tab.

chrome://webrtc-internals comparison

quadrupeds.py (works):

Stats graphs for candidate-pair (state=succeeded)
Stats graphs for transport (iceState=connected, dtlsState=connected)
Stats graphs for inbound-rtp (kind=audio)
Stats graphs for inbound-rtp (kind=video, codec=H264 96)   ← PRESENT
Stats graphs for data-channel x 5

play.py (broken):

Stats graphs for candidate-pair (state=succeeded)
Stats graphs for transport (iceState=connected, dtlsState=connected)
Stats graphs for media-playout (kind=audio)
Stats graphs for data-channel x 5
(no inbound-rtp video entry at all)

Client-side check:

const v = document.querySelector('video');
console.log(v.readyState, v.videoWidth+'x'+v.videoHeight, v.currentTime);
// Output: 0  0x0  0     (no frames ever decoded)

Attempts that did NOT help

  • Forcing render_mode="rgb_array" in gym.make (line 116 of play.py)
  • Adding env.unwrapped.sim.render() in the rollout loop after env.step()
  • Setting env_cfg.sim.use_fabric = False to force USD prim materialization
  • Removing --experience to let AppLauncher pick Isaac Lab's default

None of these caused a video track to be negotiated.

Expected behavior

play.py --livestream 2 should produce a WebRTC video stream of the same viewport that demo scripts produce. Users should be able to visualize trained policies running in a browser.

System Info

  • Isaac Lab: 2.1.1
  • Isaac Sim: 6.0.0-rc.22
  • Task: Isaac-Ant-v0, --num_envs 4
  • WebRTC client: Chrome on macOS
  • Streaming library: @nvidia/omniverse-webrtc-streaming-library
  • Deployment: Kubernetes pod (containerd), NVIDIA RTX 6000 Ada

Additional context

ManagerBasedRLEnv appears to be constructed without a viewport/rendering configuration that Kit's livestream extensions can capture. Demo scripts like quadrupeds.py construct a different scene hierarchy (direct USD spawn) that does register with the livestream publisher.

This is likely an integration gap between play.py's env setup and Kit's omni.kit.livestream.webrtc extension — not a networking or ICE issue (those all succeed).

This blocks live visualization of trained RL policies in browser, which is the primary use case for --livestream 2 with play.py.

Activity

  1. 100milliongold commented on Apr 23, 2026

    @100milliongold
    Author

    Update 2026-04-24 — expanded investigation

    Retested on Isaac Lab 3.0.0-beta1 (same Isaac Sim 6.0.0-rc.22 host). Bug reproduces identically. Full attempt matrix for user-side workarounds:

    Attempt Result
    --kit_args with primaryStream.publicIp/signalPort/streamPort signaling only, no video
    Above + every field from isaacsim.exp.full.streaming.kit's [settings.exts."omni.kit.livestream.app"] block (streamType=webrtc, allowDynamicResize, enableEventTracing, enableOpenTelemetry, ...) identical symptom
    Above + --enable omni.services.livestream.session + its quitOnSessionEnded / resumeTimeoutSeconds / waitForSessionReadyEvent settings identical symptom
    Custom experience: copy of isaaclab.python.kit + "omni.kit.livestream.app" = {} and "omni.services.livestream.session" = {} added to [dependencies], loaded via --experience Kit starts fine, still no video track
    Above + "isaacsim.exp.full" = {} also added to [dependencies] reproduces the native-layer deadlock in #5362
    Stand-alone isaac-sim.streaming.sh (→ isaacsim.exp.full.streaming.kit, no Isaac Lab) → open http://<host>/viewer/ in Chrome ✅ video track present, 59.86 FPS, full Kit UI rendered — confirms Kit livestream itself is healthy

    Strongest signal

    isaaclab.python.kit does not declare isaacsim.exp.full in [dependencies] and its [settings.exts."omni.kit.livestream.app"] block is empty. The Kit experience that streams correctly, isaacsim.exp.full.streaming.kit, declares both (dep + populated settings block).

    Adding isaacsim.exp.full into Isaac Lab's own experience is blocked by #5362, so #5364 and #5362 resolution appear coupled — fixing #5364 from the user side requires #5362 to be fixed first, or the Isaac Lab team to ship a pre-integrated streaming-aware experience (e.g. isaaclab.python.streaming.kit).

    System info update

    • Retested versions: Isaac Lab 2.1.1 (initial, 2026-04-23) and 3.0.0-beta1 (current, 2026-04-24). Both reproduce.
    • GPU: line in the body should read: NVIDIA RTX 6000 Ada Generation (48 GB).

    Acceptance criteria (suggested)

    • ./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/play.py --task Isaac-Ant-v0 --num_envs 4 --livestream 2 renders the Ant scene at http://<host>/viewer/
    • chrome://webrtc-internals shows an inbound-rtp (kind=video, codec=H264) entry within a few seconds of connection
    • The session does not self-terminate with SERVER_DISCONNECTED at ~51 s
    • quadrupeds.py and train.py paths remain unaffected
  2. RandomOakForest commented on Apr 24, 2026

    @RandomOakForest
    Collaborator

    Thanks for posting this. We will aim to review this soon.

  3. added
    bug
    on Apr 24, 2026
  4. 100milliongold commented on Apr 25, 2026

    @100milliongold
    Author

    Update 2026-04-25 — single-env isolation + working TaskAdapter workaround

    Continued investigation, two new data points.

    Single-env isolation

    play.py --task Isaac-Ant-Direct-v0 --num_envs 1 --livestream 2 reproduces. With one robot the stage has 38 USD prims under /World/envs/env_*, the active viewport binds, omni.kit.viewport.utility.get_active_viewport() returns a non-null ViewportAPI, env.unwrapped.sim.render() is callable in-loop, and the inbound-rtp video track still never appears. The bug isn't about replication, fabric clones, or scene size — it's in the gym.make → env _setup_scene path itself.

    Config-knob attempts that all failed

    Attempt Result
    env_cfg.scene.clone_in_fabric = False 2432 USD prims confirmed in stage; simulation thrashes (~960% CPU), NVST keepalive timeout
    env_cfg.scene.replicate_physics = False Thrashes
    --/rtx/hydra/readTransformsFromFabricInRenderDelegate=false Thrashes
    Forced env.unwrapped.sim.render() per loop step Black
    omni.kit.viewport.utility.capture_viewport_to_file() after warmup No PNG produced — capture pipeline doesn't see frames either

    The Kit boot warning [rtx.hydra] readTransformsFromFabricInRenderDelegate and geometry streaming are enabled together but this can cause issues with dynamic objects not streaming correctly points at the right area but isn't reachable from user-facing config.

    TaskAdapter workaround that works

    Generalization of quadrupeds.py:

    • AppLauncher(args_cli) boots Kit (no special experience).
    • SimulationContext(SimulationCfg(dt=…)) directly — no gym.make.
    • prim_utils.create_prim(f"/World/envs/env_{i}", "Xform", …) per env.
    • Articulation(cfg.replace(prim_path="/World/envs/env_.*/Robot")).
    • Step loop: sim.step(); robot.update(dt). Per decimation tick: compute the task's obs, run actor MLP, set joint target.

    Per-task code is ~150 LOC isolated to obs_dim, action_dim, network arch, action layout, and a compute_obs mirroring _get_observations. Adapters for Isaac-Ant-Direct-v0 and Isaac-Velocity-Flat-Anymal-D-v0. NVST publishes a 1080p H264 video track on this path — same Kit, same kit_args, same livestream port, same pod.

    A wrapper takes the same CLI as play.py (--task X --num_envs N --checkpoint … --livestream 2) so existing tutorial commands work with one path change.

    Implication for upstream fix

    Structural difference is in scene construction, not rendering. Anything that uses InteractiveScene.clone_environments(copy_from_source=False) produces stage geometry RTX can see but doesn't get routed to NVST's capture target. Hooking Kit's viewport binding to the same render product the wrapper's direct SimulationContext reaches — or routing fabric-clone transforms back through the USD path RTX reads — would lift this for any task going through Manager- or Direct-RL env.

  5. 100milliongold commented on Apr 25, 2026

    @100milliongold
    Author

    Reproducible commands (this pod, K8s, Isaac Lab 3.0.0-beta1, Isaac Sim 6.0.0-rc.22)

    Standard tutorial flow that fails (play.py — black screen):

    ./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/play.py \
        --task Isaac-Ant-Direct-v0 \
        --num_envs 64 \
        --checkpoint /workspace/isaaclab/logs/rsl_rl/ant_direct/<run>/model_999.pt \
        --livestream 2 \
        --kit_args "--/exts/omni.kit.livestream.app/primaryStream/publicIp=$ISAACSIM_HOST --/exts/omni.kit.livestream.app/primaryStream/streamPort=$ISAACSIM_STREAM_PORT --/exts/omni.kit.livestream.app/primaryStream/signalPort=$ISAACSIM_SIGNAL_PORT"

    → WebRTC connects, Stream Ready, but chrome://webrtc-internals shows no inbound-rtp(kind=video) entry. Browser viewer stays black.

    Wrapper that works (same CLI shape):

    ./isaaclab.sh -p /workspace/data/replay/play_livestream.py \
        --task Isaac-Ant-Direct-v0 \
        --num_envs 64 \
        --checkpoint /workspace/isaaclab/logs/rsl_rl/ant_direct/<run>/model_999.pt \
        --livestream 2 \
        --kit_args "--/exts/omni.kit.livestream.app/primaryStream/publicIp=$ISAACSIM_HOST --/exts/omni.kit.livestream.app/primaryStream/streamPort=$ISAACSIM_STREAM_PORT --/exts/omni.kit.livestream.app/primaryStream/signalPort=$ISAACSIM_SIGNAL_PORT"

    → Identical Kit boot. inbound-rtp(kind=video, codec=H264) appears within ~5 s. 64 ants stream in browser.

    Single-env isolation (the path that proves it's not replication):

    ./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/play.py \
        --task Isaac-Ant-Direct-v0 \
        --num_envs 1 \
        --livestream 2 \
        --kit_args "..."
    # 38 USD prims under /World/envs/env_*; viewport active; sim.render() callable; black screen.

    The wrapper source (play_livestream.py + replay_common.py + per-task replay_*.py) is ~700 LOC total.

  6. 100milliongold commented on Apr 26, 2026

    @100milliongold
    Author

    🎯 ROOT CAUSE IDENTIFIED — single-line fix

    After progressive isolation (each variable added to a known-working baseline until the screen turned black), the trigger is:

    parser.set_defaults(visualizer=["kit"]) is missing from play.py.

    add_app_launcher_args(parser) registers the --visualizer argparse option but doesn't set a default. So args_cli.visualizer is None, and launch_simulation's _compute_visualizer_intent(env_cfg) resolves to a non-Kit path that doesn't bind RTX/Hydra's render product to NVST's capture target → no inbound-rtp video frames.

    The fix (1 line)

    In scripts/reinforcement_learning/rsl_rl/play.py, immediately before:

    args_cli, hydra_args = parser.parse_known_args()

    add:

    parser.set_defaults(visualizer=["kit"])

    That's it. With nothing else changed, play.py --livestream 2 produces an inbound-rtp(kind=video, codec=H264) track and the viewport renders correctly.

    Verification matrix (this pod, Isaac Lab 3.0.0-beta1, Isaac Sim 6.0.0-rc.22)

    Each row = stock play.py with one independent variable changed:

    Variable Result
    runner.export_policy_to_jit/onnx BYPASSED ✗ black
    with launch_simulation(...) BYPASSED (direct AppLauncher) ✗ black
    cli_args.update_rsl_rl_cfg(agent_cfg, args_cli) BYPASSED ✗ black
    Hydra-built env_cfg/agent_cfg replaced with parse_env_cfg + load_cfg_from_registry ✗ black
    parser.set_defaults(visualizer=["kit"]) ADDED (only this) ✓ visible ★

    Why the previous TaskAdapter workaround worked

    The earlier replay_*.py wrappers from this thread happened to call parser.set_defaults(visualizer=["kit"]) explicitly during their own argparse setup. That wasn't load-bearing for the SimulationContext path (since SimulationContext bypasses launch_simulation entirely) — it just happened to be there. The actual structural/scene-graph hypothesis (clone_in_fabric, replicate_physics, fabric→Hydra transforms) was wrong: the entire env/scene/runner/policy chain works fine through gym.make. Only the visualizer argparse default was missing.

    Suggested upstream fix scope

    Either:

    • Apply the line to play.py directly (and train.py etc. by audit), or
    • Set the default inside AppLauncher.add_app_launcher_args so all consumers get it without each script remembering.

    The latter is probably better — affects every RL script at once and matches the implicit assumption that --livestream users want the Kit visualizer.

    System info

    • Isaac Lab: 3.0.0-beta1
    • Isaac Sim: 6.0.0-rc.22
    • Task: Isaac-Ant-Direct-v0, --num_envs 64, --livestream 2
    • GPU: NVIDIA RTX 6000 Ada Generation (48 GB)
    • Deployment: Kubernetes pod (containerd)
  7. Exokern commented on May 5, 2026

    @Exokern

    I checked the current develop sources against the root-cause note above. The missing default still appears present in scripts/reinforcement_learning/rsl_rl/play.py: the script calls add_launcher_args(parser) and then parses immediately, without setting visualizer=["kit"] first.

    The relevant launcher path also seems consistent with the reported failure mode: _get_visualizer_types() returns an empty set when args_cli.visualizer is unset, so launch_simulation() has no explicit Kit visualizer request to propagate for this script path.

    A minimal patch would be:

    add_launcher_args(parser)
    parser.set_defaults(visualizer=["kit"])
    args_cli, remaining_args = parser.parse_known_args()

    I have not run the Isaac Sim livestream path locally, so I am not claiming runtime validation here; this is just a source-level confirmation that the one-line candidate fix still matches current develop.

  8. AntoineRichard commented on Aug 27, 2026

    @AntoineRichard
    Collaborator

    @100milliongold, thanks for the report and for the root-cause analysis in the thread. That cause is now fixed generically: launch_simulation() calls _ensure_livestream_kit_visualizer() in source/isaaclab/isaaclab/app/sim_launcher.py, which forces the kit visualizer whenever --livestream is non-zero (and errors clearly if you passed --viz none), so the RTX render product is bound and a video track is produced. Landed in #5977.

    Closing as fixed — please reopen with your launch command if a current release still gives a blank viewport.


    🤖 This issue was reviewed as part of an AI-assisted triage of the Isaac Lab backlog, with automated verification against the current codebase. If we got this wrong, please reopen — we'd rather hear about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions