1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! Oscilloscope XY mode backend via audio output.
//!
//! This module provides an audio output backend that maps laser points
//! to stereo audio channels:
//! - `LaserPoint.x` → Left channel
//! - `LaserPoint.y` → Right channel
//!
//! This enables oscilloscope XY visualization via a DC-coupled audio interface.
//!
//! # Requirements
//!
//! - **DC-coupled audio interface** is required for accurate DC representation.
//! AC-coupled interfaces will high-pass filter the signal, causing drift.
//! - Common sample rates: 44100, 48000, 96000 Hz
//!
//! # Example
//!
//! ```no_run
//! use laser_dac::{list_devices, open_device, DacType, StreamConfig};
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Find oscilloscope device
//! let devices = list_devices()?;
//! let osc_device = devices.iter()
//! .find(|d| d.kind == DacType::Oscilloscope)
//! .expect("No oscilloscope device found");
//!
//! let device = open_device(&osc_device.id)?;
//! let (mut stream, _) = device.start_stream(StreamConfig::new(30_000))?;
//! Ok(())
//! }
//! ```
pub use OscilloscopeBackend;
pub use ;
use crate;
/// Configuration for oscilloscope backend.
/// Returns capabilities for an oscilloscope device at the given sample rate.
///
/// PPS is unconstrained because the backend resamples from the user's PPS
/// to the audio device sample rate, just like the AVB backend.
///
/// `max_points_per_chunk` is set to the ring-buffer capacity (~100ms of
/// audio) so the scheduler can submit up to a full buffer's worth at once.
/// Unlike laser DACs there is no hardware packet/frame limit — the ring
/// buffer is the only constraint.
/// Ring buffer capacity: ~100ms of audio at the given sample rate (min 4096).