Postet this before, but accidently only to Bert. So here is a repost to 
the list:

Am 12.09.2012 23:35, schrieb Bert Vermeulen:
> On 09/12/2012 04:42 PM, Markus Engel wrote:
>> Hello,
>>
>> today we got hands on the Asix Sigma2. We especially ordered it because
>> of the support of sigrok.
>> While I fully understand that open source software, supporting a wide
>> range of different hardware types, can be incomplete at some points, I'm
>> a bit disappointed that even the "Usage Example" in the wiki does not
>> work at all (and maybe did never).
>>
>> Here is a list of what I've come across with and how I worked around
>> problems:
>>
>> 1) after doing anything with sigrok-cli (e.g. scanning devices) I get a
>> double free.
>> This is because of asix-sigma.c:427 where ftdi_free is called instead of
>> ftdi_deinit
>
> Ok, I think that one is mine. I made some changes in that driver, but don't
> have a sigma to test with. I'll see about getting this fixed/tested.
>
>> 2) I always get a "sigrok-cli only supports one device for capturing."
>> even if I specify exactly one device using the "-d" option.
>> This is because run_session tries to find all devices (which will return
>> the demo dummy device and the sigma in my case) and checks whether this
>> device list is greater than one, ignoring the "-d" option.
>> My workaround here was to recompile libsigrok without the demo driver
>> leaving only one device in the list.
>
> Sounds like a bug indeed, it should ignore demo unless specified directly.
> However, be advised that you're using sigrok out of git, and the docs may
> not always be up to date. In this case, you need to call sigrok-cli with
> "--driver=asix-sigma". That's the new syntax, but hasn't made it into a
> release yet.

I think it should ignore everything else if I specify "-d N", shouldn't 
it? I had just a quick look over the code but it seems to me that 
run_session doesn't do its work if more than one device is found.
Even if I specify "--driver=asix-sigma", consider what happens if you 
have two Sigmas connected. So in my opinion "-d" should pick exactly one 
device -- what else is the primary use of this option?

>
>> 3) The example uses the "--samples 5000000" option but the hwcaps of
>> your driver does not enlist SR_HWCAP_LIMIT_SAMPLES, so all you get is
>> "Failed to configure sample limit.".
>
> Hmm, indeed this is something every LA driver should have. As a workaround
> for now, you could figure out the number of samples at your samplerate, and
> specify it with --time. But you figured that out.
>
>> 4) Finally I tried "sigrok-cli -d 0:samplerate=10m --time 1000 -O bits
>> -p 1-4"
>> but the effect was more or less equivalent to "sleep 1". When I give an
>> "-o outfile" option I'm left with an empty file.
>> Here is the output of loglevel 5:
>> --BEGIN---
>> sr: libsigrok loglevel set to 5.
>> srd: libsigrokdecode loglevel set to 5.
>> sr: Found ASIX SIGMA - Serial: A6021022
>> sr: sigma: Uploading firmware asix-sigma-50.fw
>> sr: sigma: Firmware uploaded
>> sr: session: starting
>> sr: bus: received SR_DF_HEADER
>> cli: Received SR_DF_HEADER
>> sr: bus: received SR_DF_META_LOGIC
>> cli: Received SR_DF_META_LOGIC
>> sr: session: running
>> --END-----
>>
>> I'm missing some log messages saying that samples are actually transferred.
>
> It looks to me like it just didn't fire a trigger in that one second, and it
> interrupted because time was up.

Well, I didn't specify a trigger condition, so I thought sigrok would 
record all the specified probes for the given duration.

I also tried "--trigger 1=1" and triggered some edges on probe 1 but it 
didn't change anything, except that
* without the option the LED was yellow
* with the option the LED was red. It didn't change after I triggered 
the edge but it changed after pressing the button. But in either case, 
no data were transferred.
I cannot rule out I could have made a mistake here. After all these 
failed tests it was more some random testing. I will repeat this in a 
more controlled way.

>
>> All problems were observed using the current git head. I also tried the
>> newest tarballs of sourceforge, but the --samples thing was the same and
>> --time didn't exist.
>>
>> So my questions are: Have I done anything wrong? Is there maybe ANY
>> revision I should check which at least captures some samples?
>
> I'm curious, are you seeing that double free in the latest release as well?
No, I'm just saying that the "--time" option didn't exist in the release 
and the "--samples" option didn't work either. Thus a friend encouraged 
me to use the git version and THEN there was the double free issue.

Regards,
markus

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to