DsoundScope
DsoundScope.dll is a backend library for miniscope v4 making use of sound card (via a DirectSound interface) as a data source for PC oscilloscope.
Sound card as oscilloscope has some positives:
- virtually no cost,
- nice vertical resolution (useful 12 bits or more depending on sound card quality),
- two channels (although microphone input may be mono and laptops don't have line in),
- rich selection of PC software, i.e. Zelscope, xoscope, Osqoop,
- common features specific to PC oscilloscopes like data recording, exporting,
... and severe drawbacks:
- limited bandwidth; upper limit is pretty obvious and it cuts useful measured signal frequency range to few kHz,
- blocking DC component makes it useless also with slow changing signals like car
lambda sensor output; any slow changing signal would be severely distorted, this is how
17 Hz and 50 Hz square waves captured by sound card look like:
Some nice illustrations of sound card oscilloscope limitations (both upper and lower frequency limit) were posted at AVR Freaks Forum. There are some claims that DC component can be regenerated by software-based integrator, but in my opinions that is highly dubious and may lead to even more misleading results. - sound card and possibly other PC parts can be damaged when applying incidentally too high voltage; voltages higher than 2-3V shouldn't be applied directly to sound card input,
- there is a chance that sound card input is not referenced to ground - I've spotted this problem when trying to power microphone amplifier directly from PC power supply, microphone input GND was not connected with PC power supply GND,
- there is only one sensitivity range; sensitivity and input impedance varies between sound card models, thus calibration is required to get useful voltage reading.
If you feel comfortable with soldering iron chances are you can modify your sound card to allow DC component measuring - see description how to modify SC-5500P USB sound card from Trust. Another modification suggestion can be found at http://www.qsl.net/om3cph/sb/dcwithsb.htm page.
Popular cheap USB sound card (probably poor choice for a oscilloscope): C-Media.
Another USB sound card variation (same chip probably but looks like better choice) C-Media 2.
And now for something completely different: dsoundscope.dll source code + binary:
- 2011.09.08 Initial release. Dll interface version is v12, compatible with miniscope 4.0.6
and possibly newer.
dsoundscope_dll_1_0.7z - 2012.05.05 dsoundscope_dll_20120505.zip
- 2015.10.31 Version 1.1
dsoundscope.dll + miniscope v4 (binaries) - preconfigured for C-Media USB card
dsoundscope.dll (source) - 2015.11.05 Version 1.2
dsoundscope.dll + miniscope v4 (binaries)
dsoundscope.dll (source)- quick fix for crash when using sampling buffer size that is not multiple of 1/10th of sampling speed (1/10th of sampling speed is buffer size supplied to DirectSound); it is causing continuity loss (visible when recording) so using buffer sizes matching sampling grid is recommended at the moment (e.g. 4410 for 44100 sampling)
- device settings: "Enable extra logging" (enabled by default - relatively heavy logging showing timing for data flow)
- 2015.11.06 Version 1.3
dsoundscope.dll + miniscope v4 (binaries)
dsoundscope.dll (source)- fixed data loss on frame boundary when buffer size was not multiple of 1/10th of base sampling speed; simpler and more flexible (sampling buffer vs DS buffer) DirectSoundScope::DataRcvCb() function
- updated GUI to miniscope 4.00.17