Bug 600 - Wrong scale used for sample time
Summary: Wrong scale used for sample time
Status: RESOLVED WORKSFORME
Alias: None
Product: PulseView
Classification: Unclassified
Component: Data display (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: PulseView 0.3.0
Assignee: Soeren Apel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-25 15:27 CEST by Daniel Elstner
Modified: 2015-08-10 20:58 CEST (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Elstner 2015-06-25 15:27:38 CEST
When capturing e.g. 1 million samples at a samplerate of 100 MSps, the time ruler in PulseView goes from 0 s to 1000 ks (!).  1e6 / 100e6 should work out to 10 ms instead.  It appears the samplerate is currently not figured in at all.
Comment 1 Joel Holdsworth 2015-06-28 20:13:20 CEST
What device was this problem manifested with? We need to debug the read-back of the samplerate from the device.
Comment 2 Uwe Hermann 2015-08-02 18:53:58 CEST
I cannot reproduce this with git HEAD (on an LWLA1034, which was probably used by Daniel on the initial test).

Capturing 1Msamples at 100MHz causes PulseView to correctly show samples from 0s..10ms (you may or may not have to zoom or scroll to see them in the middle of the screen, but that's unrelated).


Short log:

sr: sysclk-lwla: Downloading FPGA bitstream at '/home/uwe/sr/share/sigrok-firmware/sysclk-lwla1034-int.rbf'.
sr: sysclk-lwla: FPGA bitstream download of 81464 bytes done.
sr: sysclk-lwla: Received test word 0x12345678 back.
sr: sysclk-lwla: Received test word 0x12345678 back.
sr: sysclk-lwla: Received test word 0x87654321 back.
sr: hwdriver: sr_config_list(): key 30041 (clock_edge) sdi 0x17aff60 cg NULL -> ['r', 'f']
sr: hwdriver: sr_config_list(): key 30007 (triggersource) sdi 0x17aff60 cg NULL -> ['CH', 'TRG']
sr: hwdriver: sr_config_list(): key 30004 (triggerslope) sdi 0x17aff60 cg NULL -> ['r', 'f']
sr: hwdriver: sr_config_get(): key 30041 (clock_edge) sdi 0x17aff60 cg NULL -> 'r'
sr: hwdriver: sr_config_get(): key 30024 (external_clock) sdi 0x17aff60 cg NULL -> false
sr: hwdriver: sr_config_get(): key 30007 (triggersource) sdi 0x17aff60 cg NULL -> 'CH'
sr: hwdriver: sr_config_get(): key 30004 (triggerslope) sdi 0x17aff60 cg NULL -> 'r'
sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 0x17aff60 cg NULL -> uint64 0
sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> {'samplerates': <[uint64 125000000, 100000000, 50000000, 20000000, 10000000, 5000000, 2000000, 1000000, 500000, 200000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100]>}
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 125000000
sr: hwdriver: sr_config_set(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> {'samplerates': <[uint64 125000000, 100000000, 50000000, 20000000, 10000000, 5000000, 2000000, 1000000, 500000, 200000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100]>}
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 0x17aff60 cg NULL -> uint64 0
sr: hwdriver: sr_config_set(): key 50001 (limit_samples) sdi 0x17aff60 cg NULL -> uint64 1000000
sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 0x17aff60 cg NULL -> uint64 1000000
sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> {'samplerates': <[uint64 125000000, 100000000, 50000000, 20000000, 10000000, 5000000, 2000000, 1000000, 500000, 200000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100]>}
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: hwdriver: sr_config_set(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: hwdriver: sr_config_list(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> {'samplerates': <[uint64 125000000, 100000000, 50000000, 20000000, 10000000, 5000000, 2000000, 1000000, 500000, 200000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100]>}
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: hwdriver: sr_config_get(): key 50001 (limit_samples) sdi 0x17aff60 cg NULL -> uint64 1000000
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: session: Starting.
sr: sysclk-lwla: Starting acquisition.
sr: sysclk-lwla: Acquisition sample count limit 1000000.
sr: sysclk-lwla: Internal clock, samplerate 100000000.
sr: sysclk-lwla: Waiting for data.
sr: std: sysclk-lwla: Starting acquisition.
sr: std: sysclk-lwla: Sending SR_DF_HEADER packet.
sr: session: bus: Received SR_DF_HEADER packet.
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: session: Running.
sr: sysclk-lwla: Captured 11 words, 0 ms, flags 0x32.
sr: sysclk-lwla: Capture triggered.
sr: sysclk-lwla: Sampling in progress.
sr: sysclk-lwla: Captured 11 words, 0 ms, flags 0x32.
[...]
sr: sysclk-lwla: Sampling in progress.
sr: sysclk-lwla: Captured 11 words, 11 ms, flags 0x32.
sr: sysclk-lwla: Time limit reached, stopping capture.
sr: sysclk-lwla: 20 words in capture buffer.
sr: session: bus: Received SR_DF_LOGIC packet (50000 bytes, unitsize = 5).
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x17aff60 cg NULL -> uint64 100000000
sr: session: bus: Received SR_DF_LOGIC packet (50000 bytes, unitsize = 5).
sr: session: bus: Received SR_DF_LOGIC packet (50000 bytes, unitsize = 5).
[...]

Please reopen the bug if this (or similar issue) is still reproducible in git HEAD.
Comment 3 Soeren Apel 2015-08-10 20:58:52 CEST
Original issue is that '1000 ks' really means '1 million samples' as a sample rate of 1 sample per second is used when the sample rate is unknown. The user cannot tell the difference, though, as the unit remains 's'.

I'll provide a bug fix that uses 'sa' in such cases instead.