9
February
2022
Tizonia cloud console player is the key to the world of music and podcasts
14:08

Tizonia cloud console player is the key to the world of music and podcasts

9 February 2022 14:08

Modern www is overloaded with advertising, politics, counters, analytics, annoying ads and heavy videos. A successful attempt to return to the roots of the Internet in 2020-2022 (gopher, lynx, mosaik) - minimalist audio player Tizonia for the Linux console.

“Podcasts” are the same as radio broadcasts from Internet radio stations, but intended for downloading from the Internet and listening to them offline. An author or studio usually produces podcasts on a regular basis, focusing on a specific range of topics, over a period of months or years. Typically, podcasts contain only audio. Podcasts can be music or conversational.

What is the advantage of tizonia - it connects to popular services.
*Spotify*(leader, about 25% of the music content market)
SoundCloud**(supports account, personal preferences and playlists)
*Tune-In(free music podcasts with the most current musical styles and programs that attract millions of listeners - for example, Armin Van Buuren "ASOT")

  • runs from the command line. Control with keyboards(keys are always faster than the mouse)
  • ability to search for Internet radio stations on iHeart by song or by any word or sentence
  • can act as a server for transmitting MP3 files via the Icecast/SHOUTcast protocol (Internet radio station server)
  • can play sound from HTTP internet radio stations: connects as a client to servers Icecast and SHOUTcast
  • can act as an encoder for another device Chromecast with the specified IP address
  • free GNU application with source codes - can be compiled from source codes, if desired, on Raspberry PI (to make an Internet radio receiver) or run Tizonia in a container Docker.

The author of the tizonia program is programmer Juan A. Rubio "juanrubio".


We managed to build and run Tizonia under Linux Ubuntu 20.04.3 LTS Russian version Runtu Lite.

Link to official documentation

Method number 1. Installing the isolated component "tizonia" using the snap package manager.**

Installing snap, then tizonia in it

sudo apt install snapd
sudo snap install tizonia
sudo ln -s /var/lib/snapd/snap /snap
mkdir ~/.config/tizonia
cp /snap/tizonia/current/etc/xdg/tizonia/tizonia.conf ~/.config/tizonia/

Check:

tizonia https://sc.bce.lu/eldo80s
  • unsolvable problem: the error player: OMX_ErrorInsufficientResources is caused by the inability to obtain access to the sound card from "snap" packets, about which writes developer
  • in distributions based on PulseAudio there is no error, but the music cannot be heard, since there is no sound output to the device.

Method number 2. Installation using a script that runs in the Shell interpreter.

This recommended way to install tizonia for Debian and Ubuntu. However, it turned out that the DEB files for installation (tizonia repository) are located on a third-party Bintray server. Either the storage period has expired, or the payment period has expired, but the tizonia repository on Bintray is unavailable.

You can download and run the script from the github server, it won’t get any worse (dependencies will be installed), but it won’t be of much use either:
*at the final stage the package tizonia-all was not found.

  • Also, in the source text of the script it is clear that the author adapts the installation to various operating systems, the most famous, such as Debain "buster", Debian "bullseye". Obviously, it is impossible to take into account all OS variants, and the script may not work in rare or later versions of Linux.
    curl -kL https://github.com/tizonia/tizonia-openmax-il/raw/master/tools/install.sh > install.sh
    bash install.sh

or like this:
curl -kL https://github.com/tizonia/tizonia-openmax-il/raw/master/tools/install.sh | bash

In versions of Linux that the script does not support, the message appears: "Can't find a supported Debian or Ubuntu-based distribution."

This path is incorrect due to the unavailability of the repository on Bintray and incompatibility with various versions of Linux.

Method No. 3. Compiling and assembling the application from the source code of the programs.**

Этоt the path is correct, the method is justified and works in Ubuntu 20.04. In addition, you can compile the program for any Linux operating system that is compatible with Ubuntu 20.04.

The order of assembling the tizonia player from source codes:

The assembly from source codes was successful in the Runtu Lite operating system (Ubuntu 20.04 LTS package base). I recommend compiling also on Ubuntu-like OSs, because Debian has significantly more problems when building.

First way to compile Tizonia

1. Changed the default version of the python interpreter.

python -V

If this command returned version 2.7.x (or showed nothing), should switch python to version 3.x:

installed the newest version of python3 (and the additional package "python3-testresources" for it):

sudo apt-get update
sudo apt install python3 python3-testresources

defined the installation directory:

whereis python3

in the program output you need to look for a folder with a mention of the binary executable file (/bin/):

For example:
/usr/bin/python3.8

Switched interpreter version

sudo ln -sfn /usr/bin/python3.8 /usr/bin/python

Now the team python -V showed version 3.8 (in this distribution).

The newer version of python 3.9 is also suitable. Command to create a symbolic link:

sudo ln -sfn /usr/bin/python3.9 /usr/bin/python

2. I created tizonia directories in my home folder (the working destination folder when building the program) and a folder for the configuration file:

mkdir ~/tizonia
mkdir ~/.config/tizonia

3. Cloning the tizonia project from git to your local computer:

sudo apt-get install git
cd ~
git clone https://github.com/tizonia/tizonia-openmax-il

4. After that, go to the folder 'tizonia-openmax-il', then to the foldertools:

cd ~/tizonia-openmax-il/tools

5. Compiling dependencies

Did everything according to the author's instructions - BUILDING.HTML:

export TIZONIA_REPO_DIR=/home/vladimir/tizonia-openmax-il/
export TIZONIA_INSTALL_DIR=/home/vladimir/tizonia
export PATH=$TIZONIA_REPO_DIR/tools:$PATH
export PYTHONPATH=$TIZONIA_INSTALL_DIR/lib/python3.8/site-packages:$PYTHONPATH

Note: On a specific system, check for 3.8 or 3.9 using python -V.

Addition: Before starting compilation, you need to add the key 78FD980E271D2943 from the repository archive@mopidy.com to the system, because otherwise during compilation there will be an error that the source cannot be verified
(W: GPG Error: https://apt.mopidy.com buster InRelease: The following signatures cannot be verified because the public key is not available: NO_PUBKEY 78FD980E271D2943
E: The repository “https://apt.mopidy.com buster InRelease” is not signed.).

Therefore, before compilation, I ran the command:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 78FD980E271D2943

In the catalog "~/tizonia-openmax-il/tools" execute the script for dependency compilation:

bash tizonia-dev-build --deps

On an SSD drive, the compilation time is short (10 minutes 30 seconds).

6. Installing libspotify
The libspotify library has been removed from most distributions as deprecated (moved to archive).
Dependency: libspotify >= 12.1.51.
Luckily, there is an easy way to install libspotify using the Mopidy APT package:

Adding commands

sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/stretch.list
sudo apt-get update
sudo apt-get install libspotify12 libspotify-dev

7. The main compilation stage - everything from the same folder
~/tizonia-openmax-il/tools

Before compilation, it is advisable to install ccache in order to speed up the process:

sudo apt install ccache

The compilation of tizonia is started with the command according to instructions:

cd ~/tizonia-openmax-il/tools
bash tizonia-dev-build --release --install

The compilation time on a fast SSD drive is significant, 45 minutes or longer.

The tizonia player does not build on Ubuntu 22.04 and later, with the python 3.10 interpreter and the libboost 1.74 library - see.attempt at a solution at the end of the article.


Note: In some distributions, an error may occur when compiling the main program (next step)"/usr/bin/ld: cannot find -lboost_python3". On such OSes, you need to install the "libboost-python-dev" or "libboost-all-dev" package and create a symbolic link to the "libboost_python38.so" library. source of information about the solution:

Install the libraries “libboost-python-dev”, “libboost-program-options” and “libboost-filesystem-dev”, “libboost-thread-dev”, “libmediainfo-dev”, “libboost-dev and liblog4c-dev” needed for the program to work:

sudo apt-get install libboost-python-dev libboost-program-options-dev libboost-filesystem-dev libboost-thread-dev libmediainfo-dev libev-dev liblog4c-dev

We are looking for a file from the root user that can be called "libboost_python3":

su -
find / -name "libboost_python3*.*" -type f

a line like this will be found:

/usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0

or

/usr/lib/x86_64-linux-gnu/libboost_python39.so.1.74.0

Now let's create a soft symbolic link:

ln -s /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0 /usr/lib/libboost_python3.so

or

ln -s //usr/lib/x86_64-linux-gnu/libboost_python39.so.1.74.0 /usr/lib/libboost_python3.so

Be sure to log out of the root session:

logout

To run the program you need python libraries:

sudo apt-get install  python3-joblib python3-fuzzywuzzy

We compile the tizonia program under a normal user.

cd ~/tizonia-openmax-il/tools
bash tizonia-dev-build --release --install

Now there should be no errors when compiling.

The end of the compilation is as follows:
[code]CXX mpris/tizonia-tizmprismgr.o
CXX mpris/tizonia-tizmprisprops.o
CXX mpris/tizonia-tizmprisif.o
CXX services/iheart/tizonia-tiziheartgraph.o
CXX services/iheart/tizonia-tiziheartgraphops.o
CXX services/iheart/tizonia-tiziheartmgr.o
CXXLD tizonia
/usr/bin/mkdir -p '/home/vladimir/tizonia/bin'
/bin/bash ../libtool --mode=install /usr/bin/install -c tizonia '/home/vladimir/tizonia/bin'
libtool: install: /usr/bin/install -c .libs/tizonia /home/vladimir/tizonia/bin/tizonia


Elapsed time: 00:47:43[/code]### Second way to compile a Tizonia program

Applies in case of an error "No package 'libspotify' found" and it is impossible to install the libspotify package from the mopidy.com archive.

checking for SPOTIFY... no
configure: error: Package requirements (libspotify >= 12.1.51) were not met:

No package 'libspotify' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables SPOTIFY_CFLAGS
and SPOTIFY_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: error: ./configure failed for spotify_source
configure: error: ./configure failed for plugins

is solved as follows:

cd ~/tizonia-openmax-il
autoreconf -ifs 
./configure --without-libspotify
make
make install

or with one command:

cd ~/tizonia-openmax-il && autoreconf -ifs && ./configure --without-libspotify && make && make install

(Source,instructions)

!!!!Note dated 04/20/2022: at the "make" stage under Debian OS the build freezes with increasing RAM consumption over 10 GB. On Ubuntu Linux, I recommend method No. 1 (running ).

!!!Note dated 11/28/2023: in Ubuntu 22.04 Tizonia is not installed, even after building and compiling python3.6 and libboost. Cm.end of article.

Ready configured configuration file ~/.config/tizonia:

You need to create it in the ~/.config/tizonia directory and correct the folder paths in it.
tizonia.conf.zip

# A comma-separated list of paths to be scanned by the Tizonia IL Core when
# searching for component plugins
component-paths = /home/vladimir/tizonia/lib/tizonia0-plugins12

Correct the path to the program database:

# This is the path to the Resource Manager database
rmdb = /home/vladimir/tizonia/share/tizrmd/tizrm.db

Launching the tizonia program to play a podcast from the Internet

/home/vladimir/tizonia/bin/tizonia --tunein-search bobina -b 3

where -b 3 is the number of seconds of audio buffering,
bobina - search string.

Playback in Russian should begin - the show "Digital Emotions" from the author DJ Fonarev (Vladimir Fonarev):

Bobina

Player control:

n- next podcast
p- previous podcast
up- increase volume
down- reduce volume, etc.
space- stop/resume music.

A complete list of commands is in the description here.

Problems and solutions

If the tizonia player stops working, with an error

tizonia 0.22.0. Copyright (C) 2020 Juan A. Rubio and contributors
This software is part of the Tizonia project <https://tizonia.org>

ModuleNotFoundError: No module named 'tiztuneinproxy'

tizonia exiting (OMX_ErrorInsufficientResources).

[OMX.Aratelia.audio_source.http:port:0]
[OMX_ErrorInsufficientResources]

You need to run the above export commands before calling the program.

wrote a short script "tizonia.sh", which needs to be placed in the user's home directory (~) and given execution rights "chmod +x tizonia.sh":

#!/bin/sh
# Wrapper script for tizonia
export TIZONIA_INSTALL_DIR=/home/vladimir/tizonia
export PATH=$TIZONIA_REPO_DIR/tools:$PATH
export PYTHONPATH=$TIZONIA_INSTALL_DIR/lib/python3.8/site-packages:$PYTHONPATH

exec /home/vladimir/tizonia/bin/tizonia "$@"

solution

The program must be launched via a wrapper script as follows:

~/tizonia.sh --tunein-search ASOT -b 5

(Instead of “ASOT” we substitute keywords to search for the podcast).

Building tizonia in Ubuntu 22.04 (continuous problems)

Compilation problem with python 3.10:

configure: error: ./configure failed for libtizgmusic
configure: error: ./configure failed for gmusic
configure: error: ./configure failed for clients

Step 1 – Installing Dependencies

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev libgdbm-dev libnss3-dev libedit-dev libc6-dev

Step 2 – Download Python 3.6

wget https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz

tar -xzf Python-3.6.15.tgz

Step 3 – Compiling Python 3.6 Source Code

cd Python-3.6.15
./configure --enable-optimizations  -with-lto  --with-pydebug
make -j 2  #replace 2 with the number of processor cores - 4, 8 or 16
sudo make altinstall

Step 4 - Verify that Python 3.6 version is installed

python3.6 --version

**Step 5 - Switching from Python 3.10 to Python 3.6

whereis python3.6

/usr/local/bin/python3.6

Setting the path

echo $PATH
export PATH=/usr/local/bin/python3.6:$PATH    
echo $PATH

Setting:

whereis python2

/usr/bin/python2

whereis python3.6

/usr/local/bin/python3.6

whereis python3.10

/usr/bin/python3.10

sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 1

sudo update-alternatives --config python3      

examination:

python -V

Python 3.6.15

sudo update-alternatives --config python3

To compile program modules, you will need a dependency - a python library called "soundcloud"! Which needs to be installed in python 3.10 and 3.6 as follows:

sudo update-alternatives --config python3

I chose 3.6.

python -V

Version 3.6.15 is displayed.

Step 6 - Temporarily rename the lsb_release module

!This step is needed on Ubuntu 22.04 (Linux Mint 21 "Victoria") to install the python module: pip install soundcloud and prevent the "No module named 'lsb_release'" runtime error:

sudo mv /usr/bin/lsb_release /usr/bin/lsb_release_back

Step 7 - Install the required versions of tools and components before compilation

Errors occurred while compiling

checking python module: soundcloud... no
configure: error: failed to find required module soundcloud
configure: error: ./configure failed for libtizsoundcloud
configure: error: ./configure failed for soundcloud
configure: error: ./configure failed for clients

The following steps solve this problem:

Downgrade setuptools version

sudo -H pip install "setuptools<58.0" 
sudo -H pip3 install "setuptools<58.0" 

sudo -H python -m pip install "setuptools<58.0" 
sudo -H python3 -m pip install "setuptools<58.0" 

Installing dependency libraries, including soundcloud:

sudo -H pip3 install --upgrade gmusicapi soundcloud youtube-dl pafy pycountry titlecase pychromecast plexapi spotipy fuzzywuzzy eventlet python-Levenshtein **ШStep 8. Compilation** 

compiling tizonia - described in detail in paragraph 5 of the article.

Full compilation takes over 45 minutes.

cd ~/tizonia-openmax-il/tools/
bash tizonia-dev-build --release --install

A new problem has appeared:
/usr/bin/ld: /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0: undefined reference to PyModule_Create2' /usr/bin/ld: /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0: undefined reference toPyCMethod_New'
collect2: error: ld returned 1 exit status
make[5]: [Makefile:459:tizcastd] Error 1
make[5]: exit from the directory “/home/vladimir/tizonia-openmax-il/cast/tizcastd/src”
make[4]:
[Makefile:497: all-recursive] Error 1
make[4]: exit from the directory “/home/vladimir/tizonia-openmax-il/cast/tizcastd”
make[3]: [Makefile:406: all] Error 2
make[3]: exit from the directory “/home/vladimir/tizonia-openmax-il/cast/tizcastd”
make[2]:
[Makefile:338: all-recursive] Error 1
make[2]: exit from the directory “/home/vladimir/tizonia-openmax-il/cast”
make[1]: [Makefile:389: all-recursive] Error 1
make[1]: exit from the directory “/home/vladimir/tizonia-openmax-il”
make:
[Makefile:330:all] Error 2

Attempted solution:

sudo ldconfig

Repeat compilation.
cd ~/tizonia-openmax-il/
./configure
make
make install

On Linux Mint 21 (Ubuntu 22.04), the compilation issue is related to libboost_python310.so.

At the same time, there are no errors in Ubuntu Linux 20.04 (runtu Lite).

Дupdate dated 12/01/2023. Solving the problem in Linux Mint 21 with libboost: compiling the boost library from source

Tried to compile boost according to instructions.

cd ~
wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz
sha256sum boost_1_83_0.tar.gz
tar zvfo boost_1_83_0.tar.gz 
cd boost_1_83_0/
df -h #need >600 MB

./bootstrap.sh --with-python=python3
./b2

The library was created in the /home/vladimir/boost/boost_1_83_0/stage/lib directory

ls -l /home/vladimir/boost/boost_1_83_0/stage/lib | grep libboost_python

libboost_python310.a
libboost_python310.so -> libboost_python310.so.1.83.0
libboost_python310.so.1.83.0

I copy:

mkdir /opt/boost
sudo cp /home/vladimir/boost/boost_1_83_0/stage/lib/*.* /opt/boost

Changing the soft link: /usr/lib/libboost_python3.so will point to /opt/boost/libboost_python310.so

cd 
sudo mv /usr/lib/libboost_python3.so /usr/lib/libboost_python3.so.BAK
sudo mv /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0 /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0.BAK
sudo mv /lib/x86_64-linux-gnu/libboost_python310.so.1.83.0 /lib/x86_64-linux-gnu/libboost_python310.so.1.83.0.BAK
sudo ln -s /opt/boost/libboost_python310.so  /usr/lib/libboost_python3.so
sudo rm /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0
/#was /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0
sudo ldconfig
sudo rm /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0
sudo ln -s /opt/boost/libboost_python310.so  /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0
ls -l /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0

Entering the tizonia-openmax-il directory and rebuilding:

cd ~/tizonia-openmax-il/
make

The error is the same:
/usr/bin/ld: /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0: undefined reference to PyModule_Create2' /usr/bin/ld: /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0: undefined reference toPyCMethod_New'
collect2: error: ld returned 1 exit status
make[5]:*** [Makefile:459:tizcastd] Error 1
make[5]: exit from the directory "/home/vladimir/tizonia-openmax-il/cast/tizcastd/src"

Conclusion: On Ubuntu 22.04 (Linux Mint 21) the build is a problem.

I return it back:

sudo mv /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0.BAK /lib/x86_64-linux-gnu/libboost_python310.so.1.74.0
sudo apt install --reinstall libboost-all-dev

After completing the assembly of the executable file, we return the file to its place lsb_release:

 sudo mv /usr/bin/lsb_release_back /usr/bin/lsb_release 

---------------### Full list of podcasts on Tune-In:

https://tunein.com/podcasts/.

Using tizonia to play audio from an Internet radio station

  1. Radio stations can be found here:https://directory.shoutcast.com/Search
  2. Playing audio from an Internet radio station:

    ~/tizonia.sh https://sc.bce.lu/eldo80s


Building the Spotify client

The Spotify command line client is written in the Rust programming language by another developer. Although the Spotify client is not related to Tizonia, they have a lot in common - calling from the command line I was able to build the Spotify client:

An enthusiast created a project to replace it -https://github.com/librespot-org/librespot.

The procedure for compiling the "LibreSpot" program:

cd ~
git clone https://github.com/librespot-org/librespot.git
sudo apt-get install build-essential libasound2-dev pkg-config
curl https://sh.rustup.rs -sSf | sh

Restarting the terminal window.

rustup component add rustfmt
rustup component add clippy
cd librespot/
cargo build --release --no-default-features --features "alsa-backend" 

Date of change: 04/01/2026



Related publications