Philipp Schafft
2021-Dec-10 00:27 UTC
[Icecast] Prefered way to check if mountpoint is in use
Good evening, On Thu, 2021-12-09 at 23:39 +0100, tyctor wrote:> hi icecast masters > > i have question what is prefered way to check if icecast mount point > is in use. what i want to achieve is to start source ezstream as soon > as mount point is free. > probably i have two choices: > - check icecast status and parse responseParsing the status page is *always* *wrong*. If you you would want to access status data just use the API.> - connect directly to omunt point with PUT request and check if > icecast response is "Mountpoint in use"This is the 'correct' way. There is no point in checking first beside creating an extra race condition and more ways for the check to go wrong. ;)> which way is prefered? or is there another way how to do it?Generally I would suggest to have a look at <on-disconnect>, "mount_remove" option for URL auth, as well as the "source-disconnect" event (Icecast 2.5.x). Those can provide triggers. However keep in mind that Icecast is multi-threaded as well as your operating is multi-tasking so it might take a few extra milliseconds before the mountpoint is ready to be mounted again.> is ok if i repeat this check once per second?Icecast can work with that. But see above.> i have also defined fallback mount point to avoid client > disconnections where short loop is still playing is it proper way how > i doing it?I just wonder why not just send the backup signal to the fallback all the time. With best regards, -- Philipp Schafft (CEO/Gesch?ftsf?hrer) Telephon: +49.3535 490 17 92 L?wenfelsen UG (haftungsbeschr?nkt) Registration number: Bickinger Stra?e 21 HRB 12308 CB 04916 Herzberg (Elster) VATIN/USt-ID: Germany DE305133015 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: This is a digitally signed message part URL: <http://lists.xiph.org/pipermail/icecast/attachments/20211210/b0d41cc5/attachment.sig>
hi, thanks for hints On Fri, 2021-12-10 at 00:27 +0000, Philipp Schafft wrote:> This is the 'correct' way. There is no point in checking first beside > creating an extra race condition and more ways for the check to go > wrong. ;) >understand, no check, just to try to run ezstream, while mount point is not in use, am i right?> Generally I would suggest to have a look at <on-disconnect>, > "mount_remove" option for URL auth, as well as the "source- > disconnect" > event (Icecast 2.5.x). > > Those can provide triggers.<on-disconnect> should be the best way, but it seems not working in version 2.4.4-1 which we are using this seems is latest version in ubuntu 18.04 $ apt-cache policy icecast2 icecast2: Installed: 2.4.4-1 Candidate: 2.4.4-1 Version table: *** 2.4.4-1 500 500 http://download.opensuse.org/repositories/multimedia:/xiph/xUbuntu_18.04 ./ Packages 100 /var/lib/dpkg/status or is there 2.5.x package, for ubuntu 18.04?> I just wonder why not just send the backup signal to the fallback all > the time.probably i am not clearly understanding how you mean this :o) could you please describe it more? best regards tyctor
Philipp Schafft:> > - check icecast status and parse response > > Parsing the status page is *always* *wrong*. If you you would want to > access status data just use the API.interesting! I've been parsing status-json.xsl for years in apps and scripts, in order to check for mountpoints, and it never has failed. Can't be so wrong ;) Curious, what does "API" refer to? Something like http://192.168.1.10:8000/admin/listmounts ? bests, u.