Thanks, I really, really do appreciate the answers.
It seems the streaming design of sigrok eliminates a lot of file formats.
Namely, most file formats with a size field that precedes a large variable
amount of data can not be supported in sigrok. This includes file formats that
are 99% stream-oriented. For example, MIDI files are 99% compatible with
sigrok's stream design other than a single 32-bit size field in the track
chunk. For the MIDI protocol, there are not good alternatives to saving data
other than in a MIDI file. It is unfortunate that such files currently can not
be supported by sigrok.
That said, I get that sigrok's primary goal is support for logic analysis and
oscilloscope. Being able to extract and save data to a file format is
secondary.
Do people think addressing this issue is worth fixing or is time better spent
on other issues and features?
-Chris
________________________________
From: Bert Vermeulen <b...@biot.com>
Sent: Monday, October 10, 2016 2:50 AM
To: sigrok-devel@lists.sourceforge.net
Subject: Re: [sigrok-devel] Outputting files from Protocol Decoders
On 10/10/2016 01:22 AM, Chris Dreher wrote:
> Here is a brief summary of the original questions and their status here
> (TL;DR).
>
>
> 1. Once put() is called for OUTPUT_BINARY, is there anyway to go back
> and change those bytes?
No. It is a continuous stream, and the producer of that stream has no
knowledge of what receives that stream, by design.
> 2. Is it acceptable to buffer most of the file data and then just output
> the entire file at the end?
No. That violates the principle that everything in sigrok (libsigrok and
libsigrokdecode) is a continuous stream.
I realize that is not so easy to do with e.g. file formats that simply don't
permit this, but in such cases it's perhaps worth thinking whether that file
format is a good match for sigrok processing to begin with. It has not been
a big problem so far.
> 3. Is there a way to know that the end of the sample input stream has
> been reached?
No. The interface from a frontend to a PD is srd_session_send(), which takes
a raw buffer of logic data.
If this were to be changed to be more like libsigrok, which sends packets
with corresponding packet type, this would be more flexible. For example a
packet type similar to libsigrok's SR_DF_END could be used to help here.
Another way to do this, though not as elegant as the above solution, would
be to add a meta packet type to signal the end of the stream.
> 4. (new question) Can put()'s parameters of startsample and endsample be
> used to insert data earlier into the file output or are these parameters
> ignored because the order of calls to put() determine the order bytes are
> output?
No. You can not expect any listener to that stream to be able to handle
this, nor should you.
Don't mean to sound negative, but hey, straight answers :-)
--
Bert Vermeulen
b...@biot.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel
sigrok-devel Info Page -
SourceForge<https://lists.sourceforge.net/lists/listinfo/sigrok-devel>
lists.sourceforge.net
To see the collection of prior postings to the list, visit the sigrok-devel
Archives. Using sigrok-devel: To post a message to all the list members ...
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel