jahau
Posts: 12
Joined: Thu Dec 20, 2018 11:32 am

UV4L with audio only and multiple clients

Sat Jan 05, 2019 6:59 pm

I've installed the uv4l pretty much following the guide: https://www.linux-projects.org/uv4l/installation/

...and already checked links like viewtopic.php?t=108702

How do I stream something that I play on the raspberry (e.g. mp3), just the audio and just to test whether this works at all? I don't have camera attached or any other peripherals. I've tried this using the default page that comes with the uv4l: WebRTC two-way Audio/Video/Data Intercom & Recorder (in this case http://192.168.1.2:9080/stream/webrtc).

I've checked chrome://webrtc-internals/ on the client machine and there's at least something related to audio existing but I cannot hear any sound on the client machine. How do I enable multiple clients to uv4l? Is separate port need to be defined or some channel or whatever?

Thanks.

beefalo
Posts: 4
Joined: Thu Jan 03, 2019 10:43 pm

Re: UV4L with audio only and multiple clients

Sun Jan 06, 2019 5:51 am

This is what I use to steam just audio over webrtc.

Code: Select all

sudo uv4l --driver dummy --enable-server  --server-option=--enable-webrtc-audio=yes --server-option=--enable-webrtc-video=no
I don't know of any way to directly use an mp3 as the audio source but you could probably set something up with alsa so that it pipes the mp3 into a fake audio input that you can set as the default. That should get uv4l to pick it up as the audio input.

Then you should be able to call on the rtc page and play the audio.

jahau
Posts: 12
Joined: Thu Dec 20, 2018 11:32 am

Re: UV4L with audio only and multiple clients

Sun Jan 06, 2019 7:18 am

I've checked and the uv4l is using conf-file in this environment ("/etc/uv4l/uv4l-uvc.conf").

For some reason there are two processes running (/usr/bin/uv4l -f -k --sched-fifo --mem-lock --config).

Where is it told to uv4l to use certain source for the audio?

How do I define several "channels" for the uv4l so that several users could attach to the stream? Does anybody have experience about the latency when there are several users attached to the same stream?

RpiName
Posts: 710
Joined: Sat Jul 06, 2013 3:14 am

Re: UV4L with audio only and multiple clients

Mon Jan 07, 2019 3:34 am

jahau wrote:
Sat Jan 05, 2019 6:59 pm
How do I stream something that I play on the raspberry (e.g. mp3), just the audio and just to test whether this works at all?
Check this tutorial, it should do what you need:

https://www.linux-projects.org/uv4l/tut ... d-sharing/

beefalo
Posts: 4
Joined: Thu Jan 03, 2019 10:43 pm

Re: UV4L with audio only and multiple clients

Mon Jan 14, 2019 10:26 pm

Were you able to get this to work? I set up the webrtc audio sharing but could only connect one client at a time.

RpiName
Posts: 710
Joined: Sat Jul 06, 2013 3:14 am

Re: UV4L with audio only and multiple clients

Mon Jan 14, 2019 10:43 pm

beefalo wrote:
Mon Jan 14, 2019 10:26 pm
Were you able to get this to work? I set up the webrtc audio sharing but could only connect one client at a time.
You need Janus as a gateway (it can be installed on the same Rpi). There is a paragraph somewhere in the linked page mentioned before showing how to broadcast to a Janus videoroom and there are other examples more specific about UV4L+Janus.

beefalo
Posts: 4
Joined: Thu Jan 03, 2019 10:43 pm

Re: UV4L with audio only and multiple clients

Thu Jan 17, 2019 6:43 pm

RpiName wrote:
Mon Jan 14, 2019 10:43 pm
beefalo wrote:
Mon Jan 14, 2019 10:26 pm
Were you able to get this to work? I set up the webrtc audio sharing but could only connect one client at a time.
You need Janus as a gateway (it can be installed on the same Rpi). There is a paragraph somewhere in the linked page mentioned before showing how to broadcast to a Janus videoroom and there are other examples more specific about UV4L+Janus.
What are you using as the clients to receive the pi audio?

RpiName
Posts: 710
Joined: Sat Jul 06, 2013 3:14 am

Re: UV4L with audio only and multiple clients

Thu Jan 17, 2019 9:23 pm

beefalo wrote:
Thu Jan 17, 2019 6:43 pm
What are you using as the clients to receive the pi audio?
uv4l itself or the browser

jahau
Posts: 12
Joined: Thu Dec 20, 2018 11:32 am

Re: UV4L with audio only and multiple clients

Sun Jan 20, 2019 2:07 pm

Actually, I'm having trouble testing the audio in UV4L, I used "WebRTC two-way Audio/Video/Data Intercom & Recorder" demo page for this.

How do I cast the audio from Raspberry PI to e.g. PC (Chrome)? Do I need to check the option "Audio: microphone/other input". If I do that and click Call, I get "An error has occurred. Check media device, permissions on media and origin".

I did as the tutorial suggested, https://www.linux-projects.org/home/wp- ... sound.conf. I can hear the audio on the Raspberry (I have speakers for testing purposes attached to it) but cannot hear any audio from the Chrome (Raspberry/WebRTC is accessible in the address http://192.168.1.4:9080/stream/webrtc).

Additionally it's said here https://www.linux-projects.org/uv4l/installation/ to install uv4l-uvc. Is this really needed? It seems to create separate configuration file /etc/uv4l/uv4l-uvc.conf and includes same parameters as /etc/uv4l/uv4l-raspidisp.conf. This is very confusing.

Any ideas?

jahau
Posts: 12
Joined: Thu Dec 20, 2018 11:32 am

Re: UV4L with audio only and multiple clients

Thu Jan 31, 2019 5:41 pm

Anyone any ideas to proceed on this? Thanks.

Di0Z
Posts: 1
Joined: Fri Mar 15, 2019 9:51 am

Re: UV4L with audio only and multiple clients

Fri Mar 15, 2019 9:56 am

My answer may comes a little late, but if you have pulseaudio as audio server, you have to disable the service for audio to work with UV4L :

Code: Select all

sudo service pulseaudio stop
.
And maybe you will have to restart UV4L services :

Code: Select all

sudo service uv4l_raspidisp restart
sudo service raspidisp_server restart

Return to “Other projects”