RTL2832 Source rtl2832_source Sources import baz baz.rtl_source_c(defer_creation=True, output_size=$type.size) self.$(id).set_verbose($verbose) self.$(id).set_vid($usb_vid) self.$(id).set_pid($usb_pid) self.$(id).set_tuner_name($tuner_name) self.$(id).set_default_timeout($xfer_timeout) self.$(id).set_use_buffer($use_buffer) self.$(id).set_fir_coefficients($fir_coeffs) ##if $read_length() > 0 self.$(id).set_read_length($read_length) ##end if #if $buf_mul() > 0 self.$(id).set_buffer_multiplier($buf_mul) #end if #if $buf_level() > 0 self.$(id).set_buffer_level(float($buf_level) / 100.0) #end if #if $xtal_freq() > 0 self.$(id).set_crystal_frequency($xtal_freq) #end if if self.$(id).create() == False: raise Exception("Failed to create RTL2832 Source: $(id)") #if $bandwidth() > 0 self.$(id).set_bandwidth($bandwidth) #end if self.$(id).set_sample_rate($sample_rate) self.$(id).set_frequency($frequency) #if $gain_mode() != '' self.$(id).set_gain_mode($gain_mode) #end if #if $status_out() self.$(id).set_status_msgq($(id)_msgq_out) #end if self.$(id).set_auto_gain_mode($auto_gain_mode) self.$(id).set_relative_gain($relative_gain) self.$(id).set_gain($gain) set_sample_rate($sample_rate) set_frequency($frequency) set_gain($gain) set_bandwidth($bandwidth) set_gain_mode($gain_mode) set_auto_gain_mode($auto_gain_mode) set_relative_gain($relative_gain) Verbose output verbose True bool #if str($verbose) == 'False' then 'part' else 'none'# Output Type type complex enum #if str($type) == 'complex' then 'part' else 'none'# Sample rate sample_rate samp_rate real Frequency (Hz) frequency real Bandwidth (Hz) bandwidth 0 real #if $bandwidth() == 0 then 'part' else 'none'# Relative gain relative_gain True bool Gain gain 0 real Gain mode gain_mode string #if $gain_mode() == '' then 'part' else 'none'# Auto gain mode auto_gain_mode False bool #if str($auto_gain_mode) == 'False' then 'part' else 'none'# Custom USB VID usb_vid 0x0 int #if $usb_vid() == 0 then 'part' else 'none'# Custom USB PID usb_pid 0x0 int #if $usb_pid() == 0 then 'part' else 'none'# Custom Tuner tuner_name string #if $tuner_name() == '' then 'part' else 'none'# Xfer read length (bytes) read_length 0 int #if $read_length() == 0 then 'part' else 'none'# Xfer timeout (ms) xfer_timeout 0 int #if $xfer_timeout() == 0 then 'part' else 'none'# Use buffer use_buffer True bool #if str($use_buffer) == 'True' then 'part' else 'none'# Buffer multiplier buf_mul 0 int #if $buf_mul() == 0 then 'part' else 'none'# Buffer level buf_level 0 int #if $buf_level() == 0 then 'part' else 'none'# FIR coefficients [20] fir_coeffs [] int_vector #if len($fir_coeffs()) == 0 then 'part' else 'none'# Crystal frequency (Hz) xtal_freq 0 int #if $xtal_freq() == 0 then 'part' else 'none'# Output status status_out False bool #if str($status_out) == 'False' then 'part' else 'none'# out $type status msg 1 RTL2832U-compatible USB receiver A default value of 0 above indicates that the default value should be assumed when creating the device (except for gain). * Verbose output: additional information to stderr * Relative gain: Gain will accept values [0,1] and map to tuner's internal range * Gain mode: tuner-specific string (e.g. (e.g. nominal/sensitive/linear) * Auto gain mode (if supported by tuner): automatically select appropriate gain mode when setting gain value * Custom VID/PID: override if your adapter isn't recognised automatically (can set one or both if device is in known table, but must be both for an unknown device) * Custom tuner: override auto-probed tuner * Xfer read length: size of one USB bulk read (suggested value = 512 * (2^n), where n >= 0; a larger value increases delay until new settings appear realised in output signal) * Xfer timeout: USB bulk read timeout * Use buffer: use internally buffering (should improve streaming performance) * Buffer multiplier: total buffer size = (Buffer multiplier * Xfer Read length) * Buffer level: % of buffer to fill before beginning streaming * FIR coefficients: 20 coefficients for demodulator (leave empty for defaults) * Crystal frequency: override crystal oscillator frequency