Renamed test_input.py to example_input.py
Some checks reported warnings
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Has been cancelled
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Has been cancelled

This commit is contained in:
Anne de Jong 2023-10-24 19:47:35 +02:00
parent ee7e5fbba9
commit e4f887dc5b
3 changed files with 9 additions and 72 deletions

4
.gitignore vendored
View File

@ -6,9 +6,6 @@
.ninja* .ninja*
build.ninja build.ninja
dist dist
src/lasp.egg-info
test/.ipynb_checkpoints
src/lasp/lasp_config.h
_deps _deps
compile_commands.json compile_commands.json
CMakeFiles CMakeFiles
@ -23,3 +20,4 @@ doc
acme_log.log acme_log.log
.venv .venv
.py-build-cmake_cache .py-build-cmake_cache
cpp_src/lasp_config.h

View File

@ -43,7 +43,7 @@ in a sister repository [lasp-doc](https://code.ascee.nl/ascee/lasp-doc).
If you have any question(s), please feel free to contact us: [email](info@ascee.nl). If you have any question(s), please feel free to contact us: [email](info@ascee.nl).
# Installation - Linux (Debian-based) # Installation - Linux (Ubuntu-based)
## From wheel (recommended for non-developers) ## From wheel (recommended for non-developers)
@ -62,39 +62,27 @@ download the latest `.whl`. Then run:
- `pip install lasp-*-linux_x86_64.whl` - `pip install lasp-*-linux_x86_64.whl`
## From source (Debian) ## From source (Ubuntu-based)
### Prerequisites ### Prerequisites
One-liner: Run the following one-liner:
- `$ sudo apt install python3-pybind11 libopenblas-dev python3-pip python3-scipy libusb-1.0-0-dev libpulse-dev cmake-curses-gui python3-h5py python3-dataclasses-json python3-matplotlib python3-appdirs`
- `sudo apt install -y git python3 python3-virtualenv python3-venv libopenblas-dev python3-pip libfftw3-dev libusb-1.0-0-dev libpulse-dev python3-build`
If building RtAudio with the ALSA backend, you will also require the following packages: If building RtAudio with the ALSA backend, you will also require the following packages:
- libclalsadrv-dev - `sudo apt install libclalsadrv-dev`
If building RtAudio with the Jack Audio Connection Kit (JACK) backend, you will also require the following packages: If building RtAudio with the Jack Audio Connection Kit (JACK) backend, you will also require the following packages:
- libjack-jackd2-dev - `sudo apt install libjack-jackd2-dev`
## Download & build ### Download & build
- `$ git clone --recursive https://code.ascee.nl/ASCEE/lasp.git` - `$ git clone --recursive https://code.ascee.nl/ASCEE/lasp.git`
- `$ cd lasp` - `$ cd lasp`
- `pip install -e .`
For a release build:
- `$ cmake .`
or optionally for a custom build:
- `$ ccmake .`
Configure and run:
- `$ make -j`
# Installation - (x86_64) Windows (with WinPython), build with MSYS2 # Installation - (x86_64) Windows (with WinPython), build with MSYS2

View File

@ -1,49 +0,0 @@
#!/usr/bin/env python3
import lasp
# Get handle to stream manager
mgr = lasp.StreamMgr.getInstance()
import time
time.sleep(1)
ds = mgr.getDeviceInfo()
# Search for a device
for i, d in enumerate(ds):
print(f'{i}: ' + d.device_name)
d = ds[0] # Create a configuration and enable some input channels
config = lasp.DaqConfiguration(d)
config.inchannel_config[0].enabled = True
config.inchannel_config[1].enabled = True
# Choose a different number of frames per block
config.framesPerBlockIndex = 2
# Start a stream with a configuration
mgr.startStream(config)
def reset_cb(daq):
print('Reset called')
def cb(data):
# Print something on callback
print(data.shape)
return True
# Attach the indata handler to the stream
#i = lasp.InDataHandler(mgr, cb, reset_cb)
ppm = lasp.PPMHandler(mgr)
#del ppm
del mgr
#del i
try:
while True:
val, clip = ppm.getCurrentValue()
print(val)
time.sleep(0.1)
#print(f'{val[0]} {val[1]}', end='')
except KeyboardInterrupt:
pass
# mgr.stopStream(lasp.StreamMgr.StreamType.input)