Skip to content

Feature: Tap API in simulated broadband source#141

Merged
gilbert-sci merged 6 commits intosciencecorp:mainfrom
arminvoid:armin/tap_example
Aug 5, 2025
Merged

Feature: Tap API in simulated broadband source#141
gilbert-sci merged 6 commits intosciencecorp:mainfrom
arminvoid:armin/tap_example

Conversation

@arminvoid
Copy link
Copy Markdown
Contributor

@arminvoid arminvoid commented Jul 14, 2025

Summary

This is a change for #125. I wasn't sure if there's another simulated/virtual SciFi device that I should write the example against so I went ahead and updated the simulated broadband source in this repo to stream data over tap API. Also migrates legacy ndtp type to BroadbandFrame.

Testing

Run simulated device

synapse-sim --iface-ip 127.0.0.1

Run Client

  1. script
python synapse/examples/tap_example.py
  1. CLI
➜  synapsectl discover
          ⠼ Discovering Synapse devices... Found 1 so far (⌘C to stop)
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                                       ┃                            Host ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ vague-strange-oryx                         │                   192.168.29.38 │
└────────────────────────────────────────────┴─────────────────────────────────┘

➜  synapsectl -u 192.168.29.38 info
Name: vague-strange-oryx
Status: Stopped
Serial: SFI000001
Synapse Version: 2097152
Firmware Version: 1
Peripherals
└── No peripherals found
None

➜  synapsectl -u 127.0.0.1 configure device_config.json
Device configured

➜  synapsectl -u 127.0.0.1 start
Device started

➜  synapsectl -u 127.0.0.1 read device_config.json --list-taps
[08:06:14] Connected to vague-strange-oryx                                        streaming.py:895

Available Taps:
==================================================
Name: broadband_source_sim ✓ SUPPORTED
Type: synapse.BroadbandFrame
Endpoint: tcp://127.0.0.1:5555
------------------------------

Total: 1 taps found, 1 supported

➜  synapsectl -u 127.0.0.1 read device_config.json --tap-name broadband_source_sim
[08:06:33] Connected to vague-strange-oryx                                        streaming.py:895
[08:06:34] Device is already running, reading from existing tap                   streaming.py:583
           Looking for specified tap: broadband_source_sim                        streaming.py:713
           Found specified tap: broadband_source_sim (type:                       streaming.py:716
           synapse.BroadbandFrame)
[07/17/25 08:06:34] INFO     INFO:synapse.client.taps:Connecting to tap...             taps.py:119
           Detecting stream parameters from first message...                      streaming.py:675
           Detected sample rate: 30000 Hz                                         streaming.py:695
           Detected 32 channels (0-31)                                            streaming.py:696
Starting data streaming... (Ctrl+C to stop)
[07/17/25 08:06:36] INFO     INFO:synapse.client.taps:Stream interrupted               taps.py:264
Messages: 77,816 (31737.1/s) Dropped: -65,536 Queue Drops: 0 Loss: -533.68% Runtime: 2.6s
Total streaming time: 2.7 seconds
[08:06:36] Stopping device...                                                     streaming.py:969
           Device stopped successfully

@arminvoid
Copy link
Copy Markdown
Contributor Author

@namthor9 tagging as I can't seem to be able to add a reviewer.

@maxhodak
Copy link
Copy Markdown
Contributor

@arminvoid -- thanks for your interest. There are a few things we need to set up before we can actually accept community contributions, but it's probably time. @morninj @gilbert-sci

@morninj
Copy link
Copy Markdown
Collaborator

morninj commented Jul 23, 2025

Hi @arminvoid—can you please sign our Contributor License Agreement?

@arminvoid
Copy link
Copy Markdown
Contributor Author

hey @morninj it's signed now. thanks!

@maxhodak maxhodak requested a review from gilbert-sci July 23, 2025 20:21
Copy link
Copy Markdown
Contributor

@gilbert-sci gilbert-sci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution, mostly just nits.

Comment thread synapse/simulator/nodes/broadband_source.py
Comment thread synapse/simulator/nodes/broadband_source.py
Comment thread synapse/simulator/nodes/broadband_source.py Outdated
Comment thread synapse/examples/tap_example.py Outdated
Copy link
Copy Markdown
Contributor Author

@arminvoid arminvoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gilbert-sci thanks for the review. i have made the required changes.

Comment thread synapse/simulator/nodes/broadband_source.py
Comment thread synapse/simulator/nodes/broadband_source.py
Comment thread synapse/simulator/nodes/broadband_source.py Outdated
Comment thread synapse/examples/tap_example.py Outdated
@gilbert-sci gilbert-sci merged commit 8b8b8c4 into sciencecorp:main Aug 5, 2025
@arminvoid arminvoid deleted the armin/tap_example branch August 6, 2025 04:56
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.

4 participants