+ probe = devc->channel_entry->data;
+
+ if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN%d",
+ probe->index + 1) != SR_OK)
+ return SR_ERR;
+ /* Check that the number of samples will be accepted */
+ if (sr_scpi_send(sdi->conn, ":WAV:POIN %d;*OPC", devc->analog_frame_size) != SR_OK)
+ return SR_ERR;
+ if (get_cfg_int(sdi, "*ESR?", &tmp) != SR_OK)
+ return SR_ERR;
+ /*
+ * If we get an "Execution error" the scope went from "Single" to
+ * "Stop" without actually triggering. There is no waveform
+ * displayed and trying to download one will fail - the scope thinks
+ * it has 1400 samples (like display memory) and the driver thinks
+ * it has a different number of samples.
+ *
+ * In that case just try to capture something again. Might still
+ * fail in interesting ways.
+ *
+ * Ain't firmware fun?
+ */
+ if (tmp & 0x10) {
+ sr_warn("Single shot acquisition failed, retrying...");
+ /* Sleep a bit, otherwise the single shot will often fail */
+ g_usleep(500000);
+ sr_scpi_send(sdi->conn, ":SING");
+ rigol_ds_set_wait_event(devc, WAIT_STOP);
+ return SR_ERR;
+ }
+
+ return SR_OK;
+}