libSDRForge
Loading...
Searching...
No Matches
sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter Class Reference

Manage a redsea process without coupling it to the WBFM receiver. More...

Public Member Functions

None __init__ (self, *, str executable="redsea", float amplitude=0.2, int samplerate_hz=240_000, int queue_capacity=32)
 Initialize the instance.
bool running (self)
 Return the running.
None start (self)
 Start the component.
bool feed (self, np.ndarray multiplex)
 Queue multiplex samples without blocking the caller.
tuple[RedseaRecord,...] drain (self)
 Drain the component.
None close (self)
 Close the component.
Self __enter__ (self)
 Enter the managed context.
None __exit__ (self, *object _args)
 Exit the managed context.

Public Attributes

int dropped_blocks = 0
 executable = executable
 amplitude = amplitude
 samplerate_hz = samplerate_hz

Protected Member Functions

None _read_output (self, BinaryIO stdout)
None _write_input (self)

Protected Attributes

queue.Queue[bytes|None] _input = queue.Queue(maxsize=queue_capacity)
threading.Thread|None _writer = None
str|None _writer_error = None
subprocess.Popen[bytes]|None _process = None
threading.Thread|None _reader = None
 _lock = threading.Lock()
list _pending = []

Detailed Description

Manage a redsea process without coupling it to the WBFM receiver.

The background reader prevents stdout pipe deadlocks. drain() returns records decoded since the previous drain; a caller can feed complete records into metadata and TMC consumers. Not safe for concurrent writes.

Constructor & Destructor Documentation

◆ __init__()

None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.__init__ ( self,
* ,
str executable = "redsea",
float amplitude = 0.2,
int samplerate_hz = 240_000,
int queue_capacity = 32 )

Initialize the instance.

Parameters
selfThe current instance.
executableThe executable value.
amplitudeThe amplitude value.
samplerate_hzThe samplerate_hz value.
queue_capacityThe queue_capacity value.

Member Function Documentation

◆ __enter__()

Self sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.__enter__ ( self)

Enter the managed context.

Parameters
selfThe current instance.
Returns
The operation result.

◆ __exit__()

None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.__exit__ ( self,
*object _args )

Exit the managed context.

Parameters
selfThe current instance.
_argsThe _args value.

◆ _read_output()

None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._read_output ( self,
BinaryIO stdout )
protected

◆ _write_input()

None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._write_input ( self)
protected

◆ close()

None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.close ( self)

Close the component.

Parameters
selfThe current instance.

◆ drain()

tuple[RedseaRecord, ...] sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.drain ( self)

Drain the component.

Parameters
selfThe current instance.
Returns
The operation result.

◆ feed()

bool sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.feed ( self,
np.ndarray multiplex )

Queue multiplex samples without blocking the caller.

Returns False when the bounded queue is full; the newest block is dropped to avoid delaying live audio.

Parameters
selfThe current instance.
multiplexThe multiplex value.
Returns
The operation result.

◆ running()

bool sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.running ( self)

Return the running.

Parameters
selfThe current instance.
Returns
The operation result.

◆ start()

None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.start ( self)

Start the component.

Parameters
selfThe current instance.

Member Data Documentation

◆ _input

queue.Queue[bytes | None] sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._input = queue.Queue(maxsize=queue_capacity)
protected

◆ _lock

sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._lock = threading.Lock()
protected

◆ _pending

list sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._pending = []
protected

◆ _process

subprocess.Popen[bytes] | None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._process = None
protected

◆ _reader

threading.Thread | None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._reader = None
protected

◆ _writer

threading.Thread | None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._writer = None
protected

◆ _writer_error

str | None sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter._writer_error = None
protected

◆ amplitude

sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.amplitude = amplitude

◆ dropped_blocks

int sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.dropped_blocks = 0

◆ executable

sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.executable = executable

◆ samplerate_hz

sdrforge.protocols.rds.redsea_adapter.RedseaRdsAdapter.samplerate_hz = samplerate_hz

The documentation for this class was generated from the following file: