Gerhard Sittig [Fri, 5 May 2017 21:20:43 +0000 (23:20 +0200)]
demo: support up to 128 logic channels, enable the lower 8 by default
Bump the number of supported logic channels from 8 to 128. This is
mostly motivated to test the 64 channels limit which some of the
components/subprojects of the sigrok project might have (input/output
modules, user interfaces).
Only automatically enable the first 8 of the 128 total logic channels,
i.e. default to the previous behaviour. Prepare to only enable part of
the set of analog channels, but stick with their being active by default
as well.
Factor out the choice for the default logic pattern, too. This allows
for easier adjustment of the default configuration, when settings are
concentrated in a single spot.
Gerhard Sittig [Fri, 5 May 2017 20:35:38 +0000 (22:35 +0200)]
demo: add "cable squid" logic waveform (works-with logo, many channels)
Extend the demo driver, add another waveform choice for logic channels.
Create a "cable squid" logo representation which occupies a large number
of channels.
This pattern occupies 128x128 pixels. Unlike the 'sigrok' pattern it
gets repeated when more channels are involved, but is not shifted in the
repetition.
Soeren Apel [Sun, 21 May 2017 15:10:38 +0000 (17:10 +0200)]
Virtual session: Workaround for SR_CONF_CAPTUREFILE (#944)
This is a (hopefully temporary) workaround for the
SR_CONF_CAPTUREFILE mechanism. The value for
vdev->capturefile is set by this, however only once
via stream_session_data().
During stream processing in stream_session_data(),
capturefile may receive new values - e.g. when there
are multiple logic files or if there is analog data.
With that, the initially set capturefile is overwritten.
When re-loading the file, we are then running into
issues because we don't know what the initial value was.
As all .sr files use "logic-1" by default and, we
simulate the behavior of stream_session_data() and
assign this name to capturefile if there are logic
channels present.
With this change, all three kinds of files reload
as expected: logic only, analog only and mixed signal.
For this reason, it's a short-term fix for #944.
Martin Ling [Tue, 16 May 2017 23:04:07 +0000 (00:04 +0100)]
rigol-ds: Handle digital channels correctly for MSO2000A series.
The handling of the digital channels for this series is somewhere
between that of the DS1000D series (PROTOCOL_V2) and the MSO1000Z
(PROTOCOL_V4).
The :LA command set is similar to that of V4, but the LA data has to be
requested with :WAV:SOUR:LA and arrives in interleaved form like V2.
None of these changes should affect other models. They only affect the
case of PROTOCOL_V3 with digital channels, which occurs only for the
MSO2000A series.
Wolfram Sang [Thu, 11 May 2017 11:51:08 +0000 (13:51 +0200)]
output/csv: fix segfault with logic channels
'i' was iterating in steps of unitsize. However, the destination array
was also indexed with it, but it is of u8 type. Let 'i' run bytewise and
only multiply with unitsize when we need it.
Uwe Hermann [Sat, 18 Mar 2017 19:55:20 +0000 (20:55 +0100)]
output/csv: Fix a compiler warning.
src/output/csv.c: In function 'dump_saved_values':
src/output/csv.c:461:6: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
ctx->sample_time, ctx->value);
^
Martin Ling [Tue, 9 May 2017 23:33:58 +0000 (00:33 +0100)]
rigol-ds: Send *OPC? after commands that don't return a value.
Fixes #933.
We'd already had this problem elsewhere and thus have this wrapper function
that does this where necessary. It just wasn't in use on these two call sites,
which was causing timing problems when used over tcp-raw or VXI transports.
openbench-logic-sniffer: fix acquisition restart with trigger enabled
With trigger enabled, and with PulseView, a second (or more) acquisition
starts immediately instead of blocking. It's mandatory to try several times
to have a correct behavior.
According to http://mygizmos.org/ols/Logic-Sniffer-FPGA-Spec.pdf section 2.3.1
p.8, the Openbench Logic Sniffer must be reset before each arm command.
openbench-logic-sniffer: add a function to handle reset command
Openbench Logic Sniffer reset is a little more complex than a simple send.
To avoid code duplication, this patch adds a new function dedicated to
this task.
Karl Palsson [Wed, 1 Mar 2017 21:09:35 +0000 (21:09 +0000)]
contrib/udev: add TAG+="uaccess" for systemd
Instead of replacing the group=plugdev, simply add the TAG as well.
This allows (in most cases) the same file to be used happily on systemd
and older group based systems. Some systems may produce warnings about
non-existant groups, but it remains functional. Approach inspired by
that taken by the OpenOCD project.
Uwe Hermann [Thu, 16 Mar 2017 22:59:58 +0000 (23:59 +0100)]
session_driver.c: Increase chunk size for slightly better performance.
Increasing the chunk size from 512ksamples to 4Msamples leads to
slightly faster session file loading from sigrok session (*.sr) files
in frontends, while not looking too "chunky".
The performance increase is not really massive, but still noticeable.
A further increase to, say, 10 or 100Msamples shows no further
noticeable improvements.
Jan Losinski [Thu, 12 Jan 2017 03:45:08 +0000 (04:45 +0100)]
fx2lafw: Use wide_sampling only if necessary.
This changes the fx2lafw code to only enable the wide_sampling (16bit)
method, if at least one of the higher eight channels is enabled. This
has the benefit, that we can use higher samplerates on 16bit LA
devices if we use only the first eight channels.
The wide sampling is also enabled if we have one or more analog
channels.
Sven Schnelle [Tue, 14 Feb 2017 22:30:13 +0000 (23:30 +0100)]
Fix initial sample value for demo driver
devc->step is not reset on acquistion start, so acquisition
starts with a different value every time. Thats annoying when
using the demo driver to debug sigrok, so lets make sure that
it's reset to 0.
Marcus Comstedt [Wed, 1 Feb 2017 17:50:26 +0000 (18:50 +0100)]
Build: fix #865 yet again
It appears that the symmetry changes of setting CC and CFLAGS correctly
for C code compilation in commit 104f02f broke things for people using
some other version of setuptools which uses those vars instead of
CXX and CXXFLAGS when compiling C++ code. In order to make this work
everywhere, set _both_ sets of variables as required for C++ compilation.
No C code is compiled by the python binding module anyway.
Stefan Brüns [Fri, 13 Jan 2017 22:10:41 +0000 (23:10 +0100)]
scpi: Do not block when reading header of definite length blocks
When using SCPI over serial (over USB), we want the header without waiting
for the terminating newline, as otherwise the transfer may time out.
sr_scpi_get_data() will block until the message is complete.
Stefan Brüns [Sun, 8 Jan 2017 17:32:05 +0000 (18:32 +0100)]
scpi_serial: Get rid of intermediate buffer, do not strip newline
Lowlevel access functions should not alter the data. sr_scpi_get_string(),
which is called by most highlevel access functions, strips newlines
in a central place, and is only fed with data which contains newlines
as a final terminator.
IEEE 488.2 definite length blocks may contain arbitrary data, thus the
payload up to the provided length should be passed unaltered.
Track if the last received character is a newline, which can be used
by sr_scpi_get_string() and its callers to determine if the response
is complete.
Stefan Brüns [Thu, 12 Jan 2017 00:20:17 +0000 (01:20 +0100)]
scpi: Query current time just once, use microseconds for timeout
g_get_monotonic_time() returns current time in microseconds, use the same
granularity for storing the read timeout.
There is also no need to check the timeout if data has just been read.
Stefan Brüns [Sat, 14 Jan 2017 19:56:08 +0000 (20:56 +0100)]
yokogawa-dlm: Mostly fix dumping of current timebase
sr_period_string takes the frequency as its argument, i.e. the reciprocal
of the timebase. Obviously this will not work for frequencies less than
1Hz / timebases greater than 1 second, but at least is correct for all
other available timebases.
Stefan Brüns [Wed, 11 Jan 2017 23:29:03 +0000 (00:29 +0100)]
hameg_hmo: Mostly fix dumping of current timebase
sr_period_string takes the frequency as its argument, i.e. the reciprocal
of the timebase. Obviously this will not work for frequencies less than
1Hz / timebases greater than 1 second, but at least is correct for all
other available timebases.
Stefan Brüns [Sat, 14 Jan 2017 19:48:08 +0000 (20:48 +0100)]
strutil: Fix sr_period_string output
The output was wrong for all frequencies but 1 Hz, 1 kHz, 1 MHz and 1 GHz.
With this changes, the output may still be off due to rounding, but will
be correct as to the shown accuracy.
Gerhard Sittig [Fri, 30 Dec 2016 12:16:04 +0000 (13:16 +0100)]
scpi: Don't process received data of zero length
When nothing was received in a read attempt, we need not adjust the
buffered data's read position nor the glib string object's size. Skip
any processing for empty input, just keep checking for timeouts.
Gerhard Sittig [Sat, 7 Jan 2017 12:08:12 +0000 (13:08 +0100)]
scpi: Rephrase buffer resize for free space during SCPI read, add comments
Routine sr_scpi_get_data() checks for free space in the receive buffer,
and resizes the buffer when free space drops below a threshold. The
previous logic assumed that the resize and the read logic would interact
in some specific way to achieve the desired operation.
Adjust the buffer resize such that more free space is pre-allocated, yet
the payload size of the buffer is not affected. This eliminates the
dependency of the optional resize logic from subsequent activity for
reception of data that is non-optional.
Add comments while we are here, outline the steps taken in the
sr_scpi_get_data() routine.
Gerhard Sittig [Fri, 6 Jan 2017 21:00:28 +0000 (22:00 +0100)]
hameg-hmo: Rephrase the channel constraints check (analog vs digital)
Phrase the logic which checks the use of analog channels and digital
pods in more generic terms. Place a comment about the contraints' being
potentially dependent on the specific HMO model. This implementation
should lend itself better to future adjustment (HMO1002?).
Gerhard Sittig [Fri, 6 Jan 2017 19:53:50 +0000 (20:53 +0100)]
hameg-hmo: Map logic data from second digital pod to channels D8-D15
An internal libsigrok implementation detail prevents partial submission
of logic data for different channel groups in multiple calls. Instead
one logic packet needs to be sent in a single call, which combines data
for all channels.
Introduce a logic data storage which folds samples from several channel
groups that were received at different points in time into a combined
memory layout of larger unitsize. Stick with the former shortcut of
passing on the input bytes directly when only the first digital pod is
used during acquisition.
This change correctly maps data from the second pod to channels D8-D15.
Gerhard Sittig [Fri, 6 Jan 2017 17:56:40 +0000 (18:56 +0100)]
hameg-hmo: Do read from second digital pod during acquisition
The previous implementation only added one of the digital channels to
the list of enabled channels that are involved in the acquisition (the
first one that was found). This means that when the set of used digital
channels spans more than one pod/group, the second pod will never be
read from.
Make sure to enable one digital channel per pod/group, such that
acquisition will retrieve data from all involved input sources.
Add comments while we are here. Mention how the different setup, check,
start, and receive routines which are spread across several files do
interact to achieve acquisition.
Gerhard Sittig [Fri, 6 Jan 2017 17:12:55 +0000 (18:12 +0100)]
hameg-hmo: Send exactly one sigrok frame per scope frame
The previous implementation used to put FRAME_BEGIN and FRAME_END
markers around each received chunk of samples, while those chunks
correspond to a single channel (analog) or a group of eight channels
(digital) each. In other words, the hameg-hmo driver had provided a
multiple of the requested frames, and those frames were incomplete.
Make sure to only send FRAME_BEGIN before the first channel's data,
and FRAME_END after the last channel's data of a frame. Thus make
sigrok frames exactly match the scope's frames.
Add some comments on the frame marker and the acquisition stop logic
while we are here.
Gerhard Sittig [Fri, 30 Dec 2016 22:46:27 +0000 (23:46 +0100)]
hameg-hmo: Use the host's endianess to read analog channel data via SCPI
Configure the scope to the host's native endianess before downloading
acquisition data from analog channels. This unbreaks operation on those
models which default to a representation which differs from the host.
Gerhard Sittig [Sat, 7 Jan 2017 20:16:33 +0000 (21:16 +0100)]
Revert "scpi: Don't process received data of zero length"
Undo the change which skips management activities when no data was
received. This change breaks the current implementation, and needs to
get deferred until a delicate interaction between the resize and the
read logic has been eliminated.