Skip to content

Conversation

@zsoerenm
Copy link

@zsoerenm zsoerenm commented Jan 5, 2026

Adds full TX (transmit) support to the loopback driver with a shared ring buffer that allows data written to TX to appear on RX. This enables end-to-end testing of SDR applications without hardware.

Changes:

  • Add writeStream implementation that copies data to loopback buffer
  • Add loopback ring buffer with mutex/condvar synchronization
  • Modify acquireReadBuffer to read from loopback buffer when enabled
  • Fix readStream to copy data to user's output buffer
  • Set getFullDuplex to return true for simultaneous TX/RX
  • Bump CMake minimum version to 3.10

🤖 Generated with Claude Code

I confirmed it works with SoapySDR

zsoerenm and others added 3 commits January 5, 2026 17:00
Adds full TX (transmit) support to the loopback driver with a shared
ring buffer that allows data written to TX to appear on RX. This enables
end-to-end testing of SDR applications without hardware.

Changes:
- Add writeStream implementation that copies data to loopback buffer
- Add loopback ring buffer with mutex/condvar synchronization
- Modify acquireReadBuffer to read from loopback buffer when enabled
- Fix readStream to copy data to user's output buffer
- Set getFullDuplex to return true for simultaneous TX/RX
- Bump CMake minimum version to 3.10

The loopback assumes CF32 format (8 bytes per complex sample).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
In loopback mode, _loopback_count is already decremented in
acquireReadBuffer, so releaseReadBuffer should not decrement _buf_count.
This was causing counter underflow which led to memory corruption.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously the loopback only supported CF32 (hardcoded 8 bytes/sample).
Now it stores the format from setupStream and uses the correct bytes
per sample for CS8 (2), CS12 (3), CS16 (4), and CF32 (8).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant