lcav / easy-dsp Goto Github PK
View Code? Open in Web Editor NEWA browser based interface for real-time DSP on popular embedded platforms.
Home Page: https://lcav.github.io/easy-dsp/
License: GNU General Public License v3.0
A browser based interface for real-time DSP on popular embedded platforms.
Home Page: https://lcav.github.io/easy-dsp/
License: GNU General Public License v3.0
When applying browserinterface.change_config
, the first buffer sent to the callback does not have the correct shape (buffer size, number of channels) but subsequent ones do. Need to apply a check as in examples/frame_processing.py
.
The frame rate of the spectrogram should be limited to avoid overloading the browser.
Allow browser-main-daemon to run some rate conversion before sending the audio. This would allow to support more samplings rates (especially lower ones) even when the hardware doesn't.
What is required is to design a number of low pass filters to filter the data before downsampling.
Currently linear interpolation only is implemented to match the sampling rate of the stream to that of the audio context of the browser.
If the two frequencies are close to each other (e.g. 44.1 kHz vs 48 kHz), this is fine. However, if they are very different (e.g. 44.1 kHz vs 192 kHz), we will start to run into troubles.
Currently both the graphics and the audio are handled in the same thread in the browser. When there is a lot of audio streaming this could be a problem. We could create a web worker that takes care of getting the audio from the websocket, resample it and plays it back.
It the only communication needed with the main thread is:
what needs to be decided is how to handle configuration changes
We should integrate the easy-dsp pyramic support from Sepand and Sahand to the main repo in a nice way.
Do you have an example of a hardware_config.json file that I can use to define my own array?
Many thanks
Tao
The wsconfig demon could send a list of available rates and options upon connection. This would let the browser display correctly the available rates and number of channels.
Somehow the C daemons and the python code server and the browser interface should be separated in a nice way.
Some of the demonstration scripts where hacked before the icassp demo. Especially, some of the light color stuff should be handled in the neopixel class, like the HSV color scheme.
On running make the following error is generated
gcc -g -Wall -Wextra -O0 -std=gnu99 browser-main-daemon.c -o browser-main-daemon -lasound -lpthread browser-main-daemon.c: In function ‘main’: browser-main-daemon.c:74:3: warning: implicit declaration of function ‘query_available_config’ [-Wimplicit-function-declaration] query_available_config(); ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c:61:15: warning: unused parameter ‘argc’ [-Wunused-parameter] int main (int argc, char *argv[]) ^~~~ browser-main-daemon.c:61:27: warning: unused parameter ‘argv’ [-Wunused-parameter] int main (int argc, char *argv[]) ^~~~ browser-main-daemon.c: At top level: browser-main-daemon.c:110:6: warning: conflicting types for ‘query_available_config’ void query_available_config(void) ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c:74:3: note: previous implicit declaration of ‘query_available_config’ was here query_available_config(); ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c: In function ‘query_available_config’: browser-main-daemon.c:138:14: warning: ‘return’ with a value, in function returning void return 1; ^ browser-main-daemon.c:110:6: note: declared here void query_available_config(void) ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c:146:14: warning: ‘return’ with a value, in function returning void return 1; ^ browser-main-daemon.c:110:6: note: declared here void query_available_config(void) ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c:155:14: warning: ‘return’ with a value, in function returning void return 1; ^ browser-main-daemon.c:110:6: note: declared here void query_available_config(void) ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c:161:14: warning: ‘return’ with a value, in function returning void return 1; ^ browser-main-daemon.c:110:6: note: declared here void query_available_config(void) ^~~~~~~~~~~~~~~~~~~~~~ browser-main-daemon.c: In function ‘handle_audio’: browser-main-daemon.c:207:26: warning: unused parameter ‘nothing’ [-Wunused-parameter] void* handle_audio(void* nothing) ^~~~~~~ browser-main-daemon.c: In function ‘handle_connections_control’: browser-main-daemon.c:385:40: warning: unused parameter ‘nothing’ [-Wunused-parameter] void *handle_connections_control(void* nothing) ^~~~~~~ browser-main-daemon.c: In function ‘handle_connections_audio’: browser-main-daemon.c:474:38: warning: unused parameter ‘nothing’ [-Wunused-parameter] void* handle_connections_audio(void* nothing) { ^~~~~~~ gcc -g -Wall -Wextra -O0 -std=gnu99 browser-wsaudio.c -o browser-wsaudio -lwebsock -lpthread browser-wsaudio.c: In function ‘main’: browser-wsaudio.c:100:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t {aka long int}’ [-Wformat=] printf("%X %d\n", magic_byte, t); ~^ %ld browser-wsaudio.c:188:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < numChannelConfigs; i++) { ^ browser-wsaudio.c:206:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < numPossibleRates; i++) { ^ browser-wsaudio.c: In function ‘send_possible_config’: browser-wsaudio.c:276:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < numChannelConfigs; i++) { ^ browser-wsaudio.c:279:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] else if (i == numChannelConfigs - 1) ^~ browser-wsaudio.c:289:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < numPossibleRates; i++) { ^ browser-wsaudio.c:292:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] else if (i == numPossibleRates - 1) ^~ browser-wsaudio.c: In function ‘main_ws’: browser-wsaudio.c:330:21: warning: unused parameter ‘nothing’ [-Wunused-parameter] void* main_ws(void* nothing) { ^~~~~~~ In file included from /usr/local/include/websock/websock.h:73:0, from browser-wsaudio.c:5: browser-wsaudio.c: At top level: /usr/local/include/websock/utf.h:25:17: warning: inline function ‘decode’ declared but never defined uint32_t inline decode(uint32_t *state, uint32_t *codep, uint32_t byte); ^~~~~~ //usr/local/lib/libwebsock.so: undefined reference to
decode'
collect2: error: ld returned 1 exit status
Makefile:12: recipe for target 'browser-wsaudio' failed
make: *** [browser-wsaudio] Error 1`
I'm using ubuntu 18.04
any ideas? Many thanks in advance
In the logs.txt:
Home directory not accessible: Permission denied
Keeps appearing and no audio config is displayed on the web page, fields are just blank, struggling to find where that error may come from. The log shows that it’s finding the correct Any ideas?
Full log
Home directory not accessible: Permission denied
cannot set channel count (Invalid argument)
Possible number of channels: 2
Possible sampling rates: 44100 48000 96000 192000
Bind successful audio
Waiting for a connection...
Bind successful control
Waiting for a connection...
audio interface opened
hw_params allocated
hw_params initialized
hw_params access set
hw_params format set
hw_params rate set
connect: Connection refused
Cheers
Tao
After installation on ubuntu 18.04 the on trying to access from remote pc 'my-board-ip:8081' I get the following error.
Forbidden
You don't have permission to access / on this server.
I'm not an apache expert so don't know which settings to change next.
many thanks in advance
tao
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.