Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Detailed Setup Instructions? #27

Closed
amcco1 opened this issue Apr 19, 2023 · 7 comments
Closed

More Detailed Setup Instructions? #27

amcco1 opened this issue Apr 19, 2023 · 7 comments

Comments

@amcco1
Copy link

amcco1 commented Apr 19, 2023

Hey Jojo or anyone else.

I have been looking for a solution like this for low latency audio streaming locally, and happened to find this project! It sounds like it's exactly what I've been looking for, but I'm not a web developer haha. I'm a fairly low level server admin I'm struggling to figure out how to set this up. Would anyone be willing to help me out and teach me a bit more about this?

Thanks!

@JoJoBond
Copy link
Owner

Hi there.
I'm glad you find this project interesting.
The instructions are indeed very minimal.
Is there a particular step that give you trouble?

@amcco1
Copy link
Author

amcco1 commented Apr 19, 2023

Thanks for the quick response.

I took notes of everything I did.

So I started with a fresh install of ubuntu server and installed all the prerequisites.

Sudo apt update && sudo apt upgrade
Sudo apt install git
Git clone https://github.com/JoJoBond/3LAS.git
Sudo apt install nodejs
Sudo apt install npm
sudo apt install ffmpeg
Npm install node-pre-gyp
npm install wrtc
Npm install ws

Then I noticed that you are specifying a web server and a streaming server. Can these both be the same server? So that's where I first get confused. Then I went ahead and tried the web server instructions. You say to "Change the 'SocketHost', 'SocketPort' and 'SocketPath' variables in the script/3las.js to match the server from the streaming server". But I cannot find that file.

I looked at 3las.server.js in both the example folder and the server folder and did a crtl f in them and couldn't find the variables you listed.

So basically I'm stuck at the very beginning haha.

@JoJoBond
Copy link
Owner

JoJoBond commented Apr 19, 2023

The webserver can be on the same machine. That's also the easiest way to do it.
As webserver you could use e.g. nginx or apache. I personally prefer nginx.
You could do:
sudo apt install nginx
(See https://ubuntu.com/tutorials/install-and-configure-nginx for details)

Check if a directory exist at either /usr/share/nginx/html or /var/www/html.
From 3LAS copy the contents of the example/client directory into the directory you found.
Overwrite the index.html file when prompted. Make sure there is no other index.xxx file in that directoy.
In your server machine you should now be able to u open a browser and navigate to http://localhost/ . There you should see the player.

@amcco1
Copy link
Author

amcco1 commented Apr 20, 2023

Your response got my brain working and I have been able to get up to the point of starting the server.

The problem I have now is the audio comes through extremely distorted. I'm not sure if its something to do with my virtual machine, or if its maybe a config issue, bitrate wrong or something like that?

Any ideas as to how to fix this?

@JoJoBond
Copy link
Owner

Good to hear that you are making progress.
You could eliminate the audio interface as the source of the issue by starting the 3LAS server with a sine tone generator:

Edit the test.sh:

#!/bin/sh

ffmpeg -re -f lavfi -i "aevalsrc='sin(1000*t*2*PI*t)':s=48000:d=3600" \
-af aresample=resampler=soxr -acodec pcm_s16le -ar 48000 -ac 1 \
-f s16le -fflags +nobuffer+flush_packets -packetsize 384 -flush_packets 1 -bufsize 960 pipe:1 \
| node 3las.server.js -port 8080 -samplerate 48000 -channels 1

@amcco1
Copy link
Author

amcco1 commented Apr 23, 2023

Just wanted to update this. With your suggestions I have been able to get it working! Only issue I have now is the Android screen off issue. Playback stops when screen is off, but that's a known issue.

I will post here the list of commands I used, maybe it will be helpful for someone else in the future.

Ubuntu Setup:

Install prerequisites

sudo apt install git
[git clone https://github.com/JoJoBond/3LAS.git](https://github.com/JoJoBond/3LAS.git)
sudo apt install nodejs
sudo apt install npm
sudo apt install ffmpeg
npm install node-pre-gyp
npm install wrtc
npm install ws
sudo apt install nginx

Copy files from example client

cd /3las/example/client
sudo cp -a style /var/www/html
sudo cp -a img /var/www/html
sudo cp -a script /var/www/html
sudo cp index.html /var/www/html

Edit JS file (Can change port to 80, can change host name, can change socket path if you want a different path on webserver (example 127.0.0.1/stream))

cd /3las/client/src/
nano 3las.js 
ctrl+x , ctrl+y , enter

Make test.sh executable

cd /3las/example/server
chmod ug+x test.sh

Start the server

cd /3las/example/server
./tesh.sh

@JoJoBond JoJoBond pinned this issue Apr 23, 2023
@JoJoBond
Copy link
Owner

Thank you for the info. I'm glad you got things working. I pinned this issue to make it more visible.

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

No branches or pull requests

2 participants