libsigrok/hardware
Alexandru Gagniuc 729850c9e7 alsa: Fix sample acquisition and send normalized values
The alsa driver requested signed 16-bit integers from ALSA, but casted them to
to an unsigned 16bit before finally casting them to a float. The end result was
that half of the wave would be clipped off.
We also requested data in little endian format. ALSA can be instructed to send
data with the correct endianness for the platform, without needing to worry
about what that is.

This patch attempts three points, which, together, fix the acquisition:
1) Request data from ALSA without specifying endianness; ALSA will handle the
endianness.
2) Simplify the int16_t to float loop by using straightforward indexes.
3) Normalize every value before sending it on the session bus.

NOTE: If testing with PulseView, it will appear as if sigrok is sending all
zeroes. sigrok is sending correct data, but since the data is normalized,
PulseView will incorrectly plot it as a straight line.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-01-01 00:37:17 +01:00
..
agilent-dmm Fix limit_samples check in various drivers. 2012-12-26 02:11:00 +01:00
alsa alsa: Fix sample acquisition and send normalized values 2013-01-01 00:37:17 +01:00
asix-sigma asix-sigma: Fix two compiler warnings. 2012-12-31 21:21:39 +01:00
chronovu-la8 Shorten probe_names[] arrays everywhere. 2012-12-26 00:16:07 +01:00
colead-slm hw_init(): Save struct sr_context * parameter in struct drv_context 2012-12-03 12:07:40 +01:00
common rs9lcd: Add missing 'break;' 2012-12-31 22:26:43 +01:00
demo Fix limit_samples check in various drivers. 2012-12-26 02:11:00 +01:00
fluke-dmm fluke-dmm: Properly handle continuous mode 2012-12-24 20:27:45 +01:00
fx2lafw Shorten probe_names[] arrays everywhere. 2012-12-26 00:16:07 +01:00
hantek-dso Shorten probe_names[] arrays everywhere. 2012-12-26 00:16:07 +01:00
lascar-el-usb Shorten probe_names[] arrays everywhere. 2012-12-26 00:16:07 +01:00
link-mso19 Shorten probe_names[] arrays everywhere. 2012-12-26 00:16:07 +01:00
nexus-osciprime nexus-osciprime: Fix compiler warning. 2012-12-31 21:02:14 +01:00
openbench-logic-sniffer ols: Add missing 'extern'. 2012-12-28 17:13:20 +01:00
serial-dmm serial-dmm: Rename VOLTCRAFT_VC820 to VOLTCRAFT_VC820_SER. 2012-12-26 02:11:00 +01:00
tondaj-sl-814 tondaj-sl-814: remove unneeded debugging 2012-12-29 11:19:19 +01:00
uni-t-dmm uni-t-dmm: Fix compiler warning. 2012-12-31 21:01:53 +01:00
victor-dmm victor-dmm: Fix compiler warning. 2012-12-31 21:03:45 +01:00
zeroplus-logic-cube Shorten probe_names[] arrays everywhere. 2012-12-26 00:16:07 +01:00
Makefile.am nexus-osciprime: Initial driver skeleton. 2012-12-24 20:55:23 +01:00