How godarklight/dream works
Project Type and Purpose
• Dream is a cross-platform, real-time C++ software receiver/transceiver for the Digital Radio Mondiale (DRM) standard.
• It combines a Qt-based GUI (and CLI) with a layered signal-processing pipeline, hardware-abstraction for audio/IQ I/O, and modules for modulation/demodulation, error-correction, multiplexing, and data decoding.
Top-Level Architecture from File Structure
• src/GUI-QT & util-QT: the front-end (MVC pattern) for user interaction, parameter dialogs, plots.
• src/main-Qt & src/main.cpp: application entry points (GUI vs. console).
• src/sound & platform-specific dirs (linux/, windows/, android/): audio and SDR I/O abstraction (PortAudio, ALSA, PulseAudio, SoapySDR, Windows API).
• Core signal pipeline modules (under src/):
– Tuner & Resampler: tuner.cpp, InputResample, UpsampleFilter
– Synchronization: sync/ (FreqSyncAcq, TimeSync)
– OFDM Demodulation / Cell Mapping: OFDM.cpp, ofdmcellmapping/
– Error-Correction / Multiplexing: MLC (mlc/), MSCMultiplexer, interleaver/, tables/
– Service Data / Channel Decoding: MDI (MDI/), SDC (SDC/), ServiceInformation, Scheduler
– Data Decoding: datadecoding/ (DABMOT, Journaline, EPG, MOT slideshows)
– Audio Decoding / Playback: sourcedecoders/, AudioCodec, Opus/AAC codecs
• Simulation & Transmit: DrmSimulation, DrmTransmitter, ChannelSimulation
• Build & Packaging: Qt .pro files, debian/, windows/ scripts, macx deploy.sh
Key Architectural Patterns & Design Principles
• Layered, pipeline architecture for the signal chain
• Abstraction layers for platform-specific I/O (factory pattern in soundinterfacefactory)
• MVC for GUI (Qt widgets, dialogs in GUI-QT)
• Modular separation of concerns: synchronization, decoding, multiplexing, UI
Components & Relationships
a. User Interface Layer
– Qt GUI and/or CLI entry point
– Dialogs & Plotting (QWT)
b. Input Abstraction Layer
– Soundcard/SDR factory → platform/util modules
c. Signal Processing Pipeline
1. Tuner → Resampler
2. Frequency & Time Synchronization
3. OFDM Demodulator → Cell Mapping
4. Error Correction & Multiplexing (MLC, MSC, Interleaver)
5. MDI/SDC Packet Decoding
6. Service Data Extraction & Scheduler
7. Data Decoding (Journaline, EPG, MOT, Audio frames)
d. Output Abstraction Layer
– Audio sink via same soundinterfacefactory
– File output (if configured)
e. Simulation & Transmit (optional branch)
– DrmTransmitter → ChannelSimulation → loop-back into Input pipeline