From e4f887dc5bc6dae708355af87015104b5b9f9540 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Tue, 24 Oct 2023 19:47:35 +0200 Subject: [PATCH] Renamed test_input.py to example_input.py --- .gitignore | 4 +--- README.md | 28 +++++++----------------- examples/test_input.py | 49 ------------------------------------------ 3 files changed, 9 insertions(+), 72 deletions(-) delete mode 100755 examples/test_input.py diff --git a/.gitignore b/.gitignore index 87c0172..e74d8ac 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,6 @@ .ninja* build.ninja dist -src/lasp.egg-info -test/.ipynb_checkpoints -src/lasp/lasp_config.h _deps compile_commands.json CMakeFiles @@ -23,3 +20,4 @@ doc acme_log.log .venv .py-build-cmake_cache +cpp_src/lasp_config.h diff --git a/README.md b/README.md index a950ae8..401cae6 100644 --- a/README.md +++ b/README.md @@ -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). -# Installation - Linux (Debian-based) +# Installation - Linux (Ubuntu-based) ## From wheel (recommended for non-developers) @@ -62,39 +62,27 @@ download the latest `.whl`. Then run: - `pip install lasp-*-linux_x86_64.whl` -## From source (Debian) +## From source (Ubuntu-based) ### Prerequisites -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` +Run the following one-liner: +- `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: -- 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: -- libjack-jackd2-dev +- `sudo apt install libjack-jackd2-dev` -## Download & build +### Download & build - `$ git clone --recursive https://code.ascee.nl/ASCEE/lasp.git` - `$ cd lasp` - -For a release build: - -- `$ cmake .` - -or optionally for a custom build: - -- `$ ccmake .` - -Configure and run: - -- `$ make -j` +- `pip install -e .` # Installation - (x86_64) Windows (with WinPython), build with MSYS2 diff --git a/examples/test_input.py b/examples/test_input.py deleted file mode 100755 index c248836..0000000 --- a/examples/test_input.py +++ /dev/null @@ -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)