savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.42k stars 130 forks source link

Intro possible? #704

Closed webtent closed 5 years ago

webtent commented 5 years ago

I really like Liquidsoap, have tried with playlists as well as our live on-air using alsa.input. I've tried to add an intro using Icecast to our stream but an issue with mobile devices having their stream repeat to the point they first started listening when they are interrupted on the phone. When a text or call comes in, the intro replays as I would expect from the reconnect, but the stream repeats from the start instead of going back to live stream or at least the point the interruption occurred.

I'm assuming Liquidsoap, being a source like Darkice, it really isn't possible to serve an intro to Icecast on each connection. But if there is a solution to this issue, either from experienced Icecast users or that LS can handle, I'd love to hear about it...

Liquidsoap 1.3.3 Icecast 2.4.4

gilou commented 5 years ago

I really like Liquidsoap, have tried with playlists as well as our live on-air using alsa.input. I've tried to add an intro using Icecast to our stream but an issue with mobile devices having their stream repeat to the point they first started listening when they are interrupted on the phone. When a text or call comes in, the intro replays as I would expect from the reconnect, but the stream repeats from the start instead of going back to live stream or at least the point the interruption occurred.

I'm not sure I understand, if it's live, what do you mean by « it repeats from the start » ? There might have been a big buffer on the client, so it can jump ahead when it reconnects, but it shouldn't fully restart... Unless you're playing a file and not a stream, that is.

I'm assuming Liquidsoap, being a source like Darkice, it really isn't possible to serve an intro to Icecast on each connection. But if there is a solution to this issue, either from experienced Icecast users or that LS can handle, I'd love to hear about it...

Liquidsoap 1.3.3 Icecast 2.4.4

It's not that simple to have it like that, though there are ads services that do it. You'd need something between your listeners and icecast keeping track of your users, redirecting them to a file the first time they connect, and to the stream after on.

webtent commented 5 years ago

Yes, it is a live stream. When I say the stream repeats from the start, I mean the start of when you start listening. Yes, like it is being buffered and starts again where that buffer started when you reconnect after an interruption like a text or call on the phone. I wouldn't say it happens 100% of the time, but I can definitely duplicate the issue without trying many times. It seems the longer I wait before sending the interruption, the less it repeats, perhaps the buffer reaches its limit forcing it to go to the live stream. I'm just guessing here. I have enabled the intro on one of our streams if you wanna try. You can use our WMNF Player app in the iOS app store or Android play store to play our HD4 channel using Darkice source. Same happens whether Darkice or Liquidsoap. I just did it now and it happens like this: 1) start the stream 2) after the next song starts or some point you can remember, call the phone and hang up forcing it to disconnect and connect again 3) the song playing when you first connected to the stream is playing again after the intro plays again. If I remove the intro, this behavior does not happen, as with all our other channels currently without the intro.

I can write a Perl or PHP script to keep track of users to redirect, just not sure how I would get this between the listener and Icecast? I do have two streaming servers setup and can put something between the other and this one running Liquidsoap. The other server is in bad need of an upgrade running old Icecast/Darkice left on standard ports, I set up this new secure server on Ubuntu 16.04 with Liquidsoap from Opam using unique ports when the stream had to be secured. Not wanting to mess with the old one built by former IT person, I set up a new server and had the engineer split the audio signal, HD2 and 3 are mounted by Barix boxes. HD4 comes from yet another Darkice source engineer plans to move to another streamer box. Anyway, I am tasked to get all up to date and would like to add features like the intro or even other streams. I digress.

It was suggested on another forum to just do away with the intro and handle at our app or website player, but we would like the intro no matter the location you connect from, like TuneIn or NPR.org.

savonet-users commented 5 years ago

Hi,

Le lun. 4 févr. 2019 à 06:44, webtent notifications@github.com a écrit :

Yes, it is a live stream. When I say the stream repeats from the start, I mean the start of when you start listening. Yes, like it is being buffered and starts again where that buffer started when you reconnect after an interruption like a text or call on the phone. I wouldn't say it happens 100% of the time, but I can definitely duplicate the issue without trying many times. It seems the longer I wait before sending the interruption, the less it repeats, perhaps the buffer reaches its limit forcing it to go to the live stream. I'm just guessing here. I have enabled the intro on one of our streams if you wanna try. You can use our WMNF Player app in the iOS app store or Android play store to play our HD4 channel. I just did it now and it happens like this: 1) start the stream 2) after the next song starts or some point you can remember, call the phone and hang up forcing it to disconnect and connect again 3) the song playing when you first connected to the stream is playing again after the intro plays again.

I can write a perl or php script to keep track of users to redirect, just not sure how I would get this between the listener and icecast? It was suggested on another forum to just do away with the intro and handle at our app or website player, but we would like the intro no matter the location you connect from, like TuneIn or NPR.org.

I believe that this may, unfortunately, be a bug from the client's listening software. Liquidsoap is indeed just a source and, mostly, icecast acts as a proxy between one source and many listening clients.

There are several parameters you might want to test, for instance the burst of data that icecast sends initially to the listeners. Maybe more would help? Maybe less. Also, you could see about trying different formats, maybe the listening software behaves differently with mp3 or opus?

Good luck! Romain

webtent commented 5 years ago

Thanks for the feedback, yes, I've already tried a different format and playing with Icecast queue and burst settings up and down and none at all, same result. The players on both the app and website were setup using jplayer I believe, not by me. Guess I'll start debugging with a simple player setup of my own.

toots commented 5 years ago

Hi again,

Sorry to hear about these issues. Unfortunately, I don't think that we can do much about them here, thus closing this ticket.

Hope you find a good solution!