      lr = LogReader(f"cd:/{route.replace('|', '/')}/{sidx}/rlog")
      fr = FrameReader(f"cd:/{route.replace('|', '/')}/{sidx}/fcamera.hevc")
    rpath = regen_segment(lr, {'roadCameraState': fr})
  
    lr = LogReader(os.path.join(rpath, 'rlog2'))
    controls_state_active = [m.controlsState.active for m in lr if m.which() == 'controlsState']
    assert any(controls_state_active), "Segment did not engage"
  
    relr = os.path.relpath(rpath)
  
 
</s> remove     lr = LogReader(f"cd:/{route.replace('|', '/')}/{sidx}/rlog")
 </s> add     lr = LogReader(f"cd:/{route.replace('|', '/')}/{sidx}/rlog.bz2") </s> remove     ensure_running(managed_processes.values(), started=True, not_run=ignore)
 </s> add     ensure_running(managed_processes.values(), started=True, params=Params(), CP=car.CarParams(), not_run=ignore)
  # compress raw rlog before uploading
  with open(os.path.join(rpath, "rlog"), "rb") as f:
    data = bz2.compress(f.read())
  with open(os.path.join(rpath, "rlog.bz2"), "wb") as f:
    f.write(data)
  os.remove(os.path.join(rpath, "rlog"))

  lr = LogReader(os.path.join(rpath, 'rlog.bz2'))
      lr = LogReader(f"cd:/{route.replace('|', '/')}/{sidx}/rlog")
      fr = FrameReader(f"cd:/{route.replace('|', '/')}/{sidx}/fcamera.hevc")
    rpath = regen_segment(lr, {'roadCameraState': fr})
  
  # compress raw rlog before uploading
  with open(os.path.join(rpath, "rlog"), "rb") as f:
    data = bz2.compress(f.read())
  with open(os.path.join(rpath, "rlog.bz2"), "wb") as f:
    f.write(data)
  os.remove(os.path.join(rpath, "rlog"))

  lr = LogReader(os.path.join(rpath, 'rlog.bz2'))
    controls_state_active = [m.controlsState.active for m in lr if m.which() == 'controlsState']
    assert any(controls_state_active), "Segment did not engage"
  
    relr = os.path.relpath(rpath)
  
keep keep keep keep replace keep keep keep keep keep
 Fix process replay regen (#24517)

* fix regen issues

* compress like uploader 
selfdrive/test/process_replay/regen.py