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

Debian 10 installation for Liquidsoap issue #1558

Closed carrzkiss closed 3 years ago

carrzkiss commented 3 years ago

Describe the bug (following this video as I have done in the past, what used to work, no longer works. (How to setup Icecast on Linux and make a Web Radio (Part 3) - LiquidSoap (Youtube) During the installation of Liquidsoap through app-get install liquidsoap The installation completes; however, the folders do not show up in places they should. /etc/liquidsoap (Does not exist) Did a search for radio.liq.example, and found it here. /usr/share/doc/liquidsoap/examples

The following commands give the following errors.

root@linuxcore-02:~# sudo systemctl status liquidsoap Unit liquidsoap.service could not be found. root@linuxcore-02:~# sudo systemctl restart liquidsoap Failed to restart liquidsoap.service: Unit liquidsoap.service not found.

To Reproduce Running app-get install liquidsoap on a Debian 10 new installation. After doing all updates to the system and after installing Icecast.

Expected behavior I would love for it actually to work, but I cannot get it to install properly. Or, am I missing something altogether, or is the new Debian 10 messing up the liquidsoap installation? The Icecast webpage loads; that is about as far as I can get with it.

Version details

Install method Installed Debian 10 apt-get install curl libvorbis-dev libxslt1-dev libxslt1-dev apt-get install build-essential Next, installed Icecast 2.4.4 Next, installed Liquidsoap, app-get install liquidsoap

Thanks for any assistance on this issue. I truly would love to get liquidsoap to work, as I would LOVE to have my own radio station going, so I can listen to the music I want to listen to, install of the endless droll of the same old songs played in repeat on the blasted radio.

Thanks all. Wayne

oranjebloom commented 3 years ago

Try the thread below. You might have some success installing via opam following the instructions in that discussion

https://github.com/savonet/liquidsoap/issues/1551

toots commented 3 years ago

Hi @carrzkiss! Unfortunately, we are not responsible for the debian package for liquidsoap anymore. You can find the list of files for this package here: https://packages.debian.org/buster/armhf/liquidsoap/filelist

I also noticed that the version in this distribution is 1.3.3 which is pretty outdated at this point. Our latest release is 1.4.4. We support installing it via opam and also provide custom built debian packages on the release page here: https://github.com/savonet/liquidsoap/releases/tag/v1.4.4

Hope this helps!

carrzkiss commented 3 years ago

Thanks, everyone. I am following link 1551, as provided by oranjebloom. However, the version of liquidsoap is still v1.3.3 when using opam to install. How do you do an upgrade on liquidsoap?

Also, I was using Ubunto 20.04 And I never could get liquidsoap to work on it either.

I don't care which one I use. Rather it is Ubuntu or Debian. I just want to get Liquidsoap running to create my first live radio station from it. So I can then learn how to use it properly.

If either of you can give me advice on which to use, and possibly the best installation method, that would be absolutely wonderful. I am installing the CORE version and NOT the desktop.

Thanks Wayne.

oranjebloom commented 3 years ago

You need to make sure that you install it in the correct switch. If you type opam switch, what do you see?

You should see a list of switches. In that list, you should see 4.08.0. If you see that, then type opam switch 4.08.0 and then opam list. It will display the version of liquidsoap you have installed. You should see liquidsoap 1.4.4 installed in there

toots commented 3 years ago

Also, make sure that you are using opam version 2.

carrzkiss commented 3 years ago

I've learned a lot in the last few hours. I am going to reinstall Debian and do the installation of everything from scratch. I will post back my results when I'm completed.

Thank you both for your information. Wayne

carrzkiss commented 3 years ago

I searched for the radio.liq file, and this is where I found it out. Is this correct, or did the installation not do something right? /home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq

oranjebloom commented 3 years ago

Well that looks right to me. Is the radio.liq in that directory the one you are using for your radio streams? Have you tried to get it going? Does it work for you?

carrzkiss commented 3 years ago

Well, I decided to move away from Debian and try my luck at installing it on Ubuntu. Following the same procedure provided by the link oranjebloom I also had to do an independent installation of liquidsoap using the following line. sudo apt install liquidsoap

Even though liquidsoap was installed with OPAM, I would get this error without having the above installed.

Unable to find liquidsoap_binary in your path.

Now, when I run the following.

iceadmin@linuxcore-01:/home/linuxcore01/liquidsoap-daemon$ ./daemonize-liquidsoap.sh /home/linuxcore01/.opam/default/lib/liquidsoap/share/doc/liquidsoap-1.4.4/examples/radio.liq

I get the below output.

iceadmin@linuxcore-01:~/liquidsoap-daemon$ ./daemonize-liquidsoap.sh /home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq
./daemonize-liquidsoap.sh: 100: cannot create /home/iceadmin/liquidsoap-daemon/script//home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq-run.liq: Directory nonexistent
./daemonize-liquidsoap.sh: 108: cannot create /home/iceadmin/liquidsoap-daemon/script//home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq-run.liq: Directory nonexistent
./daemonize-liquidsoap.sh: 118: cannot create /home/iceadmin/liquidsoap-daemon/script//home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq-run.liq: Directory nonexistent
cp: cannot create regular file '/etc/systemd/system//home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq-liquidsoap.service': No such file or directory
cp: cannot create regular file '/etc/logrotate.d//home/iceadmin/.opam/4.08.0/.opam-switch/sources/liquidsoap.1.4.4/examples/radio.liq-liquidsoap': No such file or directory

Any further advice?

carrzkiss commented 3 years ago

OK, I figured out that last post part. I had to move the radio.liq file into the /home/iceadmin/liquidsoap-daemon/radio.liq Then I ran the line ./daemonize-liquidsoap.sh radio.liq And I guess it started it? It did not give an error, nor did it give any other information. Just jumped to another prompt. However, it did create two extra files in the folder. radio.liq-liquidsoap.logrotate radio.liq-liquidsoap.systemd

oranjebloom commented 3 years ago

yep that's right. Those extra files are created when you ran the daemonize command. Also, because you installed liquidsoap via opam, the "independent installation" you did via aptis redundant (you mentioned that you did this two comments back in this thread). Your script, if you set it up correctly, should be pointing to the installation that you did via opam. By the sounds of things, you got there in the end.

carrzkiss commented 3 years ago

Thanks, Oranjebloom. I had to install the second instance; for whatever reason; it kept giving me errors. Though I have learned quite a bit more since then, so maybe, the next install will happen in a few days, and I can then put to work what I have learned so far. However, I am still not seeing any [Active Mountpoints] And no log files are being produced, or I am just not finding them. I have looked in the following areas.

/var/log/liquidsoap /home/iceadmin/liquidsoap-daemon/log

And when trying to check the status, I get the following.

sudo systemctl status liquidsoap Unit liquidsoap.service could not be found.

Right now, I am back at square one again, just like I was in 2018 when I tried it last time.

I cannot remember the script to run to produce a log output, or if there is a script, it has just been a few years.

oranjebloom commented 3 years ago

You can ignore /home/iceadmin/liquidsoap-daemon/log ... nothing will log there unless you tinker with the setup further. If you want info to log at /var/log/liquidsoap, then add this line near the top of your liq script set("log.file.path","/var/log/liquidsoap/NAME_OF_LOG_FILE.log")

As for the service not being found, what do you have at the very top of your liq script? You should see something like ... #!/home/iceadmin/.opam/4.08.0/bin/liquidsoap

oranjebloom commented 3 years ago

Also, you aren't using the right command to start the liquidsoap-daemon ... my liq script is named ssr2.liq ... so when I start my script, I do sudo systemctl start ssr2.liq-liquidsoap

Given that your liq script is called radio.liq, you'll probably need to do sudo systemctl start radio.liq-liquidsoap

carrzkiss commented 3 years ago

Sweet. Thank you. I will check in on that when I get home this evening.

On Wed, Apr 21, 2021, 4:15 AM oranjebloom @.***> wrote:

Also, you aren't using the right command to start the liquidsoap-daemon ... my liq script is named ssr2.liq ... so when I start my script, I do sudo systemctl restart ssr2.liq-liquidsoap

Given that your liq script is called radio.liq, you'll probably need to do sudo systemctl restart radio.liq-liquidsoap

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/savonet/liquidsoap/issues/1558#issuecomment-823873090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECVM2DOFAWQBXAI46CTRHLTJ2CTVANCNFSM42H7GF6Q .

carrzkiss commented 3 years ago

Great, this gets me one step closer. I ran the script and received this.

sudo systemctl start radio.liq-liquidsoap
Job for radio.liq-liquidsoap.service failed because the control process exited with error code.
See "systemctl status radio.liq-liquidsoap.service" and "journalctl -xe" for details.

So, I check the status

systemctl status radio.liq-liquidsoap.service
● radio.liq-liquidsoap.service - radio.liq Liquidsoap daemon
     Loaded: loaded (/etc/systemd/system/radio.liq-liquidsoap.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-04-25 00:45:50 UTC; 17s ago
       Docs: http://liquidsoap.fm/
    Process: 257530 ExecStart=/usr/bin/liquidsoap /home/iceadmin/liquidsoap-daemon/script/radio.liq-run.liq (code=exited, status=1/FAILURE)

And last.

journalctl -xe
------With this being the RED error
Apr 20 05:38:42 linuxcore-01 sudo[82369]: pam_unix(sudo:auth): conversation failed
Apr 20 05:38:42 linuxcore-01 sudo[82369]: pam_unix(sudo:auth): auth could not identify password for [iceadmin]
oranjebloom commented 3 years ago

What is at the top of your script mate? Something like ... #!/home/iceadmin/.opam/4.08.0/bin/liquidsoap

carrzkiss commented 3 years ago

(This is annoying, I wrote this up yesterday, got busy with something else, and forgot to submit it)

I've fixed the issue with the authentication. Now, it seems that my liq file is not formatted properly.

radio.liq

# !/home/iceadmin/.opam/4.08.0/bin/liquidsoap
# log dir
set ("log.file.path","/var/log/liquidsoap/basic-radio.log")

jingles = playlist("/opt/liquidsoap/plalists/jingles")
music = playlist("/opt/liquidsoap/plalists/music")

radio = fallback(
  [switch(
   [
#     ({ 0h-12h }, tech),
     ({ 12h01-23h59 }, music),
     ({ true }, music),
    ]),
  music])

radio = random(weights=[1,5], [ jingles, radio ])
  # Stream it out
output.icecast2{%vorbis,
  host = "192.168.2.200", port = 8000,
  password = "hackme", mount = "basic-radio.ogg",
  radio)

The error shows after running. journalctl -xe

Apr 25 00:58:56 linuxcore-01 liquidsoap[1277]: At /home/iceadmin/liquidsoap-daemon/script/radio.liq, line 12, char 20:
Apr 25 00:58:56 linuxcore-01 liquidsoap[1277]: Error 3: Syntax error!
Apr 25 01:01:39 linuxcore-01 liquidsoap[1436]: At /home/iceadmin/liquidsoap-daemon/script/radio.liq, line 14, char 6:
Apr 25 01:01:39 linuxcore-01 liquidsoap[1436]: Error 3: Syntax error!
Apr 26 02:28:46 linuxcore-01 liquidsoap[40053]: At /home/iceadmin/liquidsoap-daemon/script/radio.liq, line 19, char 23:
Apr 26 02:28:46 linuxcore-01 liquidsoap[40053]: Error 3: Syntax error!
carrzkiss commented 3 years ago

I decided to try running the following script, to see what I would get, compared to the other script.

# !/home/iceadmin/.opam/4.08.0/bin/liquidsoap
# log dir
set ("log.file.path","/var/log/liquidsoap/basic-radio.log")

 # Music
music = playlist("/opt/liquidsoap/plalists/music")
 # Some jingles
jingles = playlist("/opt/liquidsoap/plalists/jingles")

 # Start building the feed with music
radio = music
 # Now add some jingles
radio = random(weights = [1, 4],[radio, jingles]) # THIS IS LINE 15

  # Stream it out
output.icecast(%vorbis,
  radio, host = "192.168.2.200", port = 8000,
  password = "hackme", mount = "test.ogg")

This is what I am getting now.

May 08 06:14:35 linuxcore-01 liquidsoap[369009]: At /home/iceadmin/liquidsoap-daemon/script/radio.liq, line 15, char 8-49:
May 08 06:14:35 linuxcore-01 liquidsoap[369009]: Error 7: Invalid value:
May 08 06:14:35 linuxcore-01 liquidsoap[369009]: That source is fallible

I would really love to get this thing working. It is driving me insane to know that others have said it is simple. The video I watched on this looked simple enough, but I cannot get it to work for the life of me.

carrzkiss commented 3 years ago

@918483 Please do not hijack other threads. you already have your question opened, wait for someone to respond to it.

oranjebloom commented 3 years ago

try adding mksafe(radio)) to the last section of your script... kind of like in the example below. That should sort out your fallibility problem.

#OUTPUT#
output.icecast(%mp3(bitrate=256,samplerate=44100,internal_quality=0,id3v2=true,stereo=true,stereo_mode="stereo"),
name="test",
encoding="UTF-8",
host="hostname.net,
port=8000,
password="hackme",
mount="test",
mksafe(radio))
#END OF SCRIPT#
carrzkiss commented 3 years ago

After the changes, this is my script. (Rebooting after every major change, to get a fresh response) PART I:

# !/home/iceadmin/.opam/4.08.0/bin/liquidsoap
# log dir
set ("log.file.path","/var/log/liquidsoap/basic-radio.log")

 # Music
music = playlist("/opt/liquidsoap/plalists/music")
 # Some jingles
jingles = playlist("/opt/liquidsoap/plalists/jingles")
 # If something goes wrong, we'll play this
# security = single("/opt/liquidsoap/plalists/jingles")

 # Start building the feed with music
radio = music
 # Now add some jingles
radio = random(weights = [1, 4],[radio, jingles])
 # And finally the security
#radio = fallback(track_sensitive = false, [radio, security])

  # Stream it out
output.icecast(%mp3(bitrate=256,samplerate=44100,internal_quality=0,id3v2=true,stereo=true,stereo_mode="stereo"),
name="test",
encoding="UTF-8",
host="192.168.2.200",
port=8000,
password="hackme",
mount="test",
mksafe(radio))

I then ran. systemctl status radio.liq-liquidsoap.service

This was the output

● radio.liq-liquidsoap.service - radio.liq Liquidsoap daemon
     Loaded: loaded (/etc/systemd/system/radio.liq-liquidsoap.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: http://liquidsoap.fm/

Next, I ran. systemctl start radio.liq-liquidsoap.service I then ran journalctl -xe Gave me the following error. Error 4: Undefined variable mksafe

I then ran. systemctl status radio.liq-liquidsoap.service Output

● radio.liq-liquidsoap.service - radio.liq Liquidsoap daemon
     Loaded: loaded (/etc/systemd/system/radio.liq-liquidsoap.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-05-11 02:54:41 UTC; 2min 11s ago
       Docs: http://liquidsoap.fm/
    Process: 1511 ExecStart=/usr/bin/liquidsoap /home/iceadmin/liquidsoap-daemon/script/radio.liq-run.liq (code=exited, status=1/FAILURE)

PART II:

I found the following post. variable mksafe not previously defined

I did as he instructed and then started and checked the status.

systemctl status radio.liq-liquidsoap.service
● radio.liq-liquidsoap.service - radio.liq Liquidsoap daemon
     Loaded: loaded (/etc/systemd/system/radio.liq-liquidsoap.service; disabled; vendor preset: enabled)
     Active: activating (start) since Tue 2021-05-11 03:02:42 UTC; 2s ago
       Docs: http://liquidsoap.fm/
    Process: 1772 ExecStart=/usr/bin/liquidsoap /home/iceadmin/liquidsoap-daemon/script/radio.liq-run.liq (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 2252)
     Memory: 696.0K
     CGroup: /system.slice/radio.liq-liquidsoap.service

PART III: After REBOOT, I ran sudo systemctl start radio.liq-liquidsoap.service I then ran sudo journalctl -xe And I am getting the following error lines.

May 11 03:39:04 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Can't open PID file /home/iceadmin/liquidsoap-daemon/pid/radio.liq-run.pid (yet?) after start: Operation not permitted
May 11 03:39:07 linuxcore-01 multipathd[675]: sda: add missing path
May 11 03:39:07 linuxcore-01 multipathd[675]: sda: failed to get udev uid: Invalid argument
May 11 03:39:07 linuxcore-01 multipathd[675]: sda: failed to get sysfs uid: Invalid argument
May 11 03:39:07 linuxcore-01 multipathd[675]: sda: failed to get sgio uid: No such file or directory
(Repeat of the top lines several times, then)
May 11 03:39:21 linuxcore-01 systemd-timesyncd[716]: Timed out waiting for reply from 91.189.89.198:123 (ntp.ubuntu.com).
May 11 03:39:21 linuxcore-01 systemd-timesyncd[716]: Initial synchronization to time server 91.189.91.157:123 (ntp.ubuntu.com).

So, this is where we are currently at, at this moment.

oranjebloom commented 3 years ago

Were you getting the PID file message before you made changes to your liq script? This might not be the root of your problem, but you've set a mount in your liq script which is called "test" ... so in your icecast.xml, do you have a corresponding mount with that name?

    <mount type="normal">
       <stream-name>test</stream-name>
        <mount-name>/test</mount-name>
        <public>1</public>
        <max-listeners>100</max-listeners>
        <charset>UTF-8</charset>
    </mount>
carrzkiss commented 3 years ago

I am not sure about rather I was getting the PID error before, as I had just started using SUDO journalctl -xe Last night.

I added the information for the mount to my icecast.xml file. Rebooted the server, and still, no mount point was showing on the site. And also, the PID error still exists.

This is what I am getting now.

-- The job identifier is 583.
May 11 18:23:09 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Can't open PID file /home/iceadmin/liquidsoap-daemon/pid/radio.liq-run.pid (yet?) after start: Operation not permitted
May 11 18:23:09 linuxcore-01 cloud-init[1294]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~20.04.1 running 'modules:final' at Tue, 11 May 2021 18:23:09 +0000. Up 105.73 seconds.
May 11 18:23:09 linuxcore-01 cloud-init[1294]: Cloud-init v. 21.1-19-gbad84ad4-0ubuntu1~20.04.1 finished at Tue, 11 May 2021 18:23:09 +0000. Datasource DataSourceNone.  Up 106.03 seconds
May 11 18:23:09 linuxcore-01 cloud-init[1294]: 2021-05-11 18:23:09,653 - cc_final_message.py[WARNING]: Used fallback datasource

-- The job identifier is 110.
May 11 18:23:12 linuxcore-01 multipathd[677]: sda: add missing path
May 11 18:23:12 linuxcore-01 multipathd[677]: sda: failed to get udev uid: Invalid argument
May 11 18:23:12 linuxcore-01 multipathd[677]: sda: failed to get sysfs uid: Invalid argument
May 11 18:23:12 linuxcore-01 multipathd[677]: sda: failed to get sgio uid: No such file or directory
May 11 18:23:17 linuxcore-01 sudo[1297]: linuxcore01 : TTY=pts/0 ; PWD=/home/linuxcore01 ; USER=root ; COMMAND=/usr/bin/journalctl -xe
May 11 18:23:17 linuxcore-01 sudo[1297]: pam_unix(sudo:session): session opened for user root by linuxcore01(uid=0)

Next, I searched and found out the VMWare was causing an issue with the paths within Linux. So, I corrected this issue with the following information. Ubuntu 20.04 multipath configuration Then I found out how to add the config settings into VMWare for the VM of this installation. Cannot find "disk.EnableUUID = "TRUE""

Once added in, the above errors for "The job identifier is 110" no longer exist.

However, I am still getting the PID issue. This is my output. sudo journalctl -xe

-- The job identifier is 1287.
May 11 18:42:59 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Can't open PID file /home/iceadmin/liquidsoap-daemon/pid/radio.liq-run.pid (yet?) after start: Operation not permitted
May 11 18:42:59 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Supervising process 1340, which is not our child. We'll most likely not notice when it exits.
May 11 18:42:59 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Killing process 1340 (liquidsoap) with signal SIGKILL.
May 11 18:42:59 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Killing process 1340 (liquidsoap) with signal SIGKILL.
May 11 18:42:59 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Succeeded.
-- The job identifier is 1364.
May 11 18:43:00 linuxcore-01 systemd[1]: radio.liq-liquidsoap.service: Can't open PID file /home/iceadmin/liquidsoap-daemon/pid/radio.liq-run.pid (yet?) after start: Operation not permitted
May 11 18:43:13 linuxcore-01 sudo[1346]: iceadmin : TTY=pts/0 ; PWD=/home/iceadmin ; USER=root ; COMMAND=/usr/bin/journalctl -xe
May 11 18:43:13 linuxcore-01 sudo[1346]: pam_unix(sudo:session): session opened for user root by linuxcore01(uid=0)

I then found this for the PID file. liquidsoap startup and reloading (Comment from ROMEO)

I added in the directory which liquidsoap is looking for. set("init.daemon.pidfile.path","/home/iceadmin/liquidsoap-daemon/pid/ Githubissues.

  • Githubissues is a development platform for aggregating issues.