Bug 646

Summary: error dialog presents "generic/unspecified error" when a specific error is available
Product: PulseView Reporter: karlp
Component: AcquisitionAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal CC: bert, soeren
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

Description karlp 2015-09-04 03:14:51 CEST
Using a logic16, try to capture at 25Mhz with all 16 channels enabled.  you get an error about generic/unspecified error.
On the console you clearly see the very much more helpful, "sr: saleae-logic16: Unable to sample at 25000000Hz with this many channels."
Comment 1 Soeren Apel 2015-09-04 03:52:28 CEST
From a UX perspective, I'd say this is a duplicate of http://sigrok.org/bugzilla/show_bug.cgi?id=507 as it would be more intuitive to automatically disallow a sample rate of 25MHz when 16 channels are enabled.

This however requires drivers to report the supported sample rates in the current configuration, which I'm assuming to not be implemented for most drivers. Hence, having some kind of "get_last_error_string()" or such may actually make sense as well.
Comment 2 Bert Vermeulen 2015-09-04 10:05:47 CEST
Indeed this driver doesn't change the published samplerates according to the number of channels selected; the full list is always published.

The following limits apply:

#define MAX_SAMPLE_RATE		SR_MHZ(100)
#define MAX_4CH_SAMPLE_RATE	SR_MHZ(50)
#define MAX_7CH_SAMPLE_RATE	SR_MHZ(40)
#define MAX_8CH_SAMPLE_RATE	SR_MHZ(32)
#define MAX_10CH_SAMPLE_RATE	SR_MHZ(25)
#define MAX_13CH_SAMPLE_RATE	SR_MHZ(16)

Once this is fixed, Pulseview does need to re-list SR_CONF_SAMPLERATE after channel selection changes to get an updated list of samplerates.