impl Handler {
    async fn capture_video_rpc(
        &self,
        req: Request<MonitorRequest>,
    ) -> Result<Response<VideoStream>, Status> {
        self.capture_video_reply(req.into_inner()).await
    }

    /// Keeps `capture_audio` explicit because it sits on relay RPC orchestration, where hardware failures must surface without stopping the server.
    /// Inputs are the typed parameters; output is the return value or side effect.
    async fn capture_audio_rpc(
        &self,
        req: Request<MonitorRequest>,
    ) -> Result<Response<AudioStream>, Status> {
        let rpc_id = runtime_support::next_stream_id();
        // Only one speaker stream for now; both 0/1 → same ALSA dev.
        let _id = req.into_inner().id;
        // Allow override (`LESAVKA_ALSA_DEV=hw:2,0` for debugging).
        let dev = std::env::var("LESAVKA_ALSA_DEV").unwrap_or_else(|_| "hw:UAC2Gadget,0".into());
        info!(rpc_id, %dev, "🔊 capture_audio opened");

        let s = runtime_support::open_ear_with_retry(&dev, 0)
            .await
            .map_err(|e| remote_audio_status(format!("{e:#}")))?;

        Ok(Response::new(Box::pin(s)))
    }

    async fn paste_text_rpc(&self, req: Request<PasteRequest>) -> Result<Response<PasteReply>, Status> {
        self.paste_text_reply(req).await
    }

    async fn recover_usb_rpc(&self, _req: Request<Empty>) -> ResetReply { self.recover_usb_reply().await }
    async fn recover_uac_rpc(&self, _req: Request<Empty>) -> ResetReply { self.recover_uac_reply().await }
    async fn recover_uvc_rpc(&self, _req: Request<Empty>) -> ResetReply { self.recover_uvc_reply().await }
    async fn reset_usb_rpc(&self, _req: Request<Empty>) -> ResetReply { self.reset_usb_reply().await }

    async fn get_capture_power_rpc(
        &self,
        _req: Request<Empty>,
    ) -> Result<Response<CapturePowerState>, Status> {
        self.get_capture_power_reply().await
    }

    async fn set_capture_power_rpc(
        &self,
        req: Request<SetCapturePowerRequest>,
    ) -> Result<Response<CapturePowerState>, Status> {
        self.set_capture_power_reply(req).await
    }

    async fn get_calibration_rpc(
        &self,
        _req: Request<Empty>,
    ) -> Result<Response<CalibrationState>, Status> {
        self.get_calibration_reply().await
    }

    async fn calibrate_rpc(
        &self,
        req: Request<CalibrationRequest>,
    ) -> Result<Response<CalibrationState>, Status> {
        self.calibrate_reply(req).await
    }

    async fn get_upstream_sync_rpc(
        &self,
        _req: Request<Empty>,
    ) -> Result<Response<UpstreamSyncState>, Status> {
        self.get_upstream_sync_reply().await
    }
}
