Skip to content

Commit

Permalink
Merge pull request #1057 from anarkiwi/throt
Browse files Browse the repository at this point in the history
Reduce maximum output size per call for simulated radios.
  • Loading branch information
anarkiwi authored Dec 20, 2023
2 parents e4c4828 + 96f3264 commit b96f0a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
g++ \
gcc \
git \
gnuradio-dev \
libboost-all-dev \
libev-dev \
libopencv-dev \
Expand All @@ -41,6 +40,10 @@ jobs:
uhd-host \
wget \
&& grep -h 'git clone' docker/*|grep -v pytorch|sed -E 's/RUN\s+git clone\s+//g'|sort|uniq|xargs -L1 git clone
- name: install gnuradio
run: |
sudo add-apt-repository ppa:gnuradio/gnuradio-releases && sudo apt-get update && \
sudo apt-get install -y --no-install-recommends gnuradio-dev python3-packaging
- name: Install dependencies
run: |
for repodir in flatbuffers json libsigmf gr-iqtlabs ; do \
Expand Down
8 changes: 6 additions & 2 deletions gamutrf/grsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def work(self, input_items, output_items):
return len(samples)


def get_throttle(samp_rate, items=1024):
return blocks.throttle(gr.sizeof_gr_complex, samp_rate, True, items)


def get_source(
sdr,
samp_rate,
Expand All @@ -110,7 +114,7 @@ def get_source(
if url.scheme == "file" and os.path.exists(url.path):
sources = [
file_source_tagger(url.path, cmd_port),
blocks.throttle(gr.sizeof_gr_complex, samp_rate, True),
get_throttle(samp_rate),
]
else:
raise ValueError("unsupported/missing file location")
Expand All @@ -119,7 +123,7 @@ def get_source(
cmd_port = "cmd"
sources = [
iqtlabs.tuneable_test_source(freq_divisor),
blocks.throttle(gr.sizeof_gr_complex, samp_rate, True),
get_throttle(samp_rate),
]
elif sdr == "ettus":
sources = get_ettus_source(sdrargs, samp_rate, center_freq, agc, gain, uhd_lib)
Expand Down

0 comments on commit b96f0a9

Please sign in to comment.