MusicPlayerPlus is a character-based console and terminal window music player
- plus Beets media library management with preconfigured plugins
- plus Character-based spectrum visualizer
mppcava
- plus Music Player Daemon and ALSA configuration management
- plus Mopidy Music Server with preconfigured extensions
- plus Navidrome Music Server/Streamer automated install/config/service
- plus Bliss acoustic analysis and song similarity database
- plus Essentia acoustic analysis and metadata extraction
- plus YAMS MPD Last.fm scrobbler running as a service
- plus Media fuzzy finder using
fzf
- plus Album cover art download
- plus Bandcamp collections download
- plus Soundcloud favorites download
- plus Discogs user collection to markdown generator
- plus Automated setup, import and organization, metadata, playlists, …
MusicPlayerPlus is one of the Neoman managed projects:
Neoman | Managed | Projects |
---|---|---|
Asciiville | Lazyman | MirrorCommand |
MusicPlayerPlus | Neoman | RoonCommandLine |
Table of contents
Click here to expand/collapse
- Overview
- Screenshots
- Videos
- Quickstart
- Installation
- Post Installation Configuration
- Client Configuration (required)
- MusicPlayerPlus Configuration File
- MPD Music Directory Configuration
- Initializing the Beets media library management system
- Additional metadata analysis and retrieval
- Activating the YAMS scrobbler for Last.fm
- MPD Audio Output Configuration
- Fuzzy Finder Configuration
- Start MPD
- System verification checks
- Initialize Music Database
- Installing Mopidy
- Installing Navidrome
- Terminal Emulator Support
- Discogs User Collection
- MusicPlayerPlus Services and Clients
- Documentation
- MusicPlayerPlus Commands
- Removal
- Troubleshooting
- Infrared remote control of MPD
- Building MusicPlayerPlus from source
- Contributing
Overview
The MusicPlayerPlus project provides integration and extension of several audio packages designed to stream and play music. MusicPlayerPlus interacts with the Music Player Daemon (MPD). Outputs from the MPD streaming audio server are used as MusicPlayerPlus inputs for playback and visualization. MusicPlayerPlus components are used to manage and control MPD and ALSA configuration.
MusicPlayerPlus integrations and extensions are primarily aimed at the character-based terminal user. They enable an easy to use seamlessly integrated control of audio streaming, playing, music library management, and visualization in a lightweight character-based environment.
Audio streaming is provided by the Music Player Daemon (MPD). At the core of MusicPlayerPlus is the mpplus
command which acts as a front-end for a variety of terminal and/or tmux
sessions.
The mpplus
command can be used to invoke:
- The lightweight character-based MPD client,
mpcplus
- One or more terminal emulators running an MPD client and visualizer
- A tmux session using the tmux session manager
tmuxp
- A spectrum visualizer
- A download of album cover art for every album in a music library
- Conversion of all WAV/M4A format media in a music library to MP3 format media
- An import of a music library to the Beets media library manager
- A download of lyrics for all songs in the music library without lyrics
- Analysis and retrieval of audio-based information for media matching a query
- YAMS MPD Last.fm scrobbler activation
- Any MPD client the user wishes to run
- One of several asciimatics animations optionally accompanied by audio
- A fuzzy listing and searching of the audio library using
fzf
[Note:] Typical use of mpplus
as a music player and spectrum visualizer will invoke a tmux
session to display the MPD client, spectrum visualizer, and album cover art all in a single terminal window. MusicPlayerPlus configures tmux
with a custom key binding to exit tmux sessions. To exit an mpplus
tmux session, the Alt-x
key binding can be used.
Integration is provided for:
- mpd, the Music Player Daemon
- mpcplus, character-based MPD client
- beets, media library management system
- essentia, acoustic metadata analysis and extraction
- mopidy, music server with cool extensions
- navidrome, self-hosted music server and streamer
- yams, MPD scrobbler for Last.fm
- cava, an audio spectrum visualizer
- mplayer, a media player
- fzf, interactive fuzzy finder
- asciimatics - automatically display a variety of character-based animation effects
- asciinema - automatically create ascii character-based video clips
- tmux, a terminal multiplexer
- tmuxp, a tmux session manager
- Enhanced key bindings for extended control of terminal windows and tmux sessions
- Several terminal emulators
- kitty (the default MusicPlayerPlus terminal emulator)
- cool-retro-term
- gnome-terminal
- tilix
The goal of MusicPlayerPlus is to provide the user with a sophisticated set of complex music library tools that can be integrated and managed in a fairly simple to understand fashion. Also, to make some cool looking powerful stuff happen from the command-line in a character-based environment.
Requirements
MusicPlayerPlus is compiled and packaged for installation on any Linux platform. It has been tested on the following platforms:
- Arch Linux
- CentOS Linux
- Fedora Linux
- Raspberry Pi OS
- Ubuntu Linux
Installation and initialization require admistrative privilege. The mppinit
command, executed after installing MusicPlayerPlus, installs several packages and therefore requires access to the Internet along with administrative privilege (e.g. sudo
privilege).
Memory and storage requirements depend upon the size of the music library.
With a moderate sized music library, the Music Player Daemon can exceed a 2GB memory capacity. Therefore, 4GB or more of memory is recommended.
Storage should be sized to adequately host what will likely be a growing music library. Plan ahead and leave your library room to grow. A few hundred Gigabytes of storage might suffice for some music libraries but a Terabyte or more will provide room to grow. Testing is performed on systems with 4GB RAM and 2TB storage using a 600GB music library.
Essentia metadata extraction, Blissify similarity analysis, and transcoding all consume significant CPU resources. Testing has been performed on systems with the following CPU resources:
- 8 x Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
- 2 x Intel(R) Celeron(R) CPU G1840 @ 2.80GHz
- 4 x ARMv7 Processor rev 3 (v7l)
All of these processors were able to handle significant loads. However, import, metadata extraction, and transcoding are all much quicker on the 8 x Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz system. Although not necessary, these infrequent operations consume much less time on a more powerful CPU.
Screenshots
Videos
Quickstart
See the MusicPlayerPlus Quickstart section for details on getting started quickly.Installation
See the MusicPlayerPlus Install section for details on MusicPlayerPlus installation.Post Installation Configuration
See the MusicPlayerPlus Configuration section for details on MusicPlayerPlus post-installation configuration.MusicPlayerPlus Services and Clients
See the MusicPlayerPlus Services section for details on MusicPlayerPlus services and clients.Documentation
See the MusicPlayerPlus Documentation section for MusicPlayerPlus documentation and usage.MusicPlayerPlus Commands
See the MusicPlayerPlus Commands section for details on MusicPlayerPlus commands.Removal
On Debian based Linux systems where the MusicPlayerPlus package was installed using the MusicPlayerPlus Debian format package, remove the MusicPlayerPlus package by executing the command:
sudo apt remove musicplayerplus
or
sudo dpkg -r musicplayerplus
On RPM based Linux systems where the MusicPlayerPlus package was installed using the MusicPlayerPlus RPM format package, remove the MusicPlayerPlus package by executing the command:
sudo dnf remove MusicPlayerPlus
or
sudo rpm -e MusicPlayerPlus
On Arch based Linux systems where the MusicPlayerPlus package was installed using the MusicPlayerPlus Pacman format package, remove the MusicPlayerPlus package by executing the command:
sudo pacman -Rs musicplayerplus
The MusicPlayerPlus package can be removed by executing the “Uninstall” script in the MusicPlayerPlus source directory:
git clone https://github.com/doctorfree/MusicPlayerPlus.git
cd MusicPlayerPlus
./Uninstall
Troubleshooting
Many problems encountered with MusicPlayerPlus often resolve to problems with the underlying Linux audio configuration. As a first step in troubleshooting, verify the audio subsystem is functioning properly. Most systems use either ALSA or PulseAudio and there are numerous audio test guides available.
MusicPlayerPlus includes a convenience script to test the ALSA audio subsystem. The command alsa_audio_test
can be run to test your ALSA audio setup. If successful you will hear the test output of the aplay
command. To view a alsa_audio_test
usage message and current ALSA configuration settings, run the command alsa_audio_test -u
Another source of problems to investigate is the Music Player Daemon (MPD). This is the music streaming server that MusicPlayerPlus connects to. MPD is run as a system service that runs automatically. You can check the status of the MPD service by running the command systemctl --user status mpd
. You can restart the MPD service with systemctl --user restart mpd.service
. If the issue is not resolved by a restart or reboot, check the MPD log file at $HOME/.config/mpd/log
looking for recent failures and exceptions.
It may be the case that the root of a problem is a missing dependency. MusicPlayerPlus should have installed any missing dependencies but one may have been overlooked, improperly installed, or subsequently removed. If the system logs or error output indicates something was “not found” then check for its existence. On Debian based systems there is a nice repository package index maintained. If a command was not found, it is often possible to simply type that command at a shell prompt and the Debian packaging system will be searched for any packages that contain a command with that name. If a likely looking package is returned, the problem may be solved by installing that package.
Finally, see the Troubleshooting section of the MusicPlayerPlus Wiki. for additional troubleshooting techniques and commonly resolved issues.
If an issue cannot be resolved and all troubleshooting efforts have failed, open an issue at MusicPlayerPlus issues. Even if you do manage to resolve an issue, it may still be helpful to report the issue at https://github.com/doctorfree/MusicPlayerPlus/issues so that a fix may be incorporated in the next release.
Known issues
Tmux key bindings in iTerm2 terminal emulator
The iTerm2
terminal emulator has built-in support for tmux. Several of the iTerm2 built-in tmux key bindings conflict with and override the default tmux key bindings and the MusicPlayerPlus custom tmux key bindings.
Unless you are quite familiar with iTerm2 and its tmux implementation, we do not recommend using iTerm2 with MusicPlayerPlus when running tmux sessions.
MusicPlayerPlus support for iTerm2 may be forthcoming in future releases but at this time iTerm2 is not a supported MusicPlayerPlus terminal emulator.
Tmux sessions over SSH to Fedora systems
A tmux session initiated over SSH to a Fedora Linux system may size the tmux panes incorrectly. This issue is not yet understood but will hopefully be addressed in a future release of MusicPlayerPlus. If, for example, a mpplus
or mpcplus-tmux
tmux session displays the mpcplus
pane with a small height while the spectrum visualizer pane consumes most of the session window, then the mpcplus
pane will need to be resized manually.
Tmux panes can be resized either using keyboard shortcuts or with the mouse.
To resize the mpcplus
tmux pane using the mouse, click and drag the bottom of the upper pane in the session window. Drag the pane border down until the mpcplus
display of music media appears.
To resize the mpcplus
tmux pane using keyboard shortcuts, use one of the default tmux key bindings:
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
This means you can resize a pane by <prefix>
Alt ↓
(tmux prefix followed by “Alt-DownArrow”). The default MusicPlayerPlus tmux prefix is Ctrl-a
so in order to resize the mpcplus
pane using the keyboard, type Ctrl-a
then type Alt ↓
. You can repeat Alt ↓
several times without needing to re-type the Ctrl-a
prefix if you type it fast enough (about a second). If the display of Ctrl
on the tmux status line disappears and you still need to resize the mpcplus
pane, then you will need to re-type the prefix key Ctrl-a
.
This issue has only been detected on Fedora Linux over SSH. However, it may occur with other systems and may not be exclusive to either SSH or Fedora.
Infrared remote control of MPD
Advanced users may wish to add remote control capabilities to MusicPlayerPlus. Getting IR remote control of MPD working is pretty geeky and fun. Also cool.
This can be accomplished on most Linux systems using LIRC (Linux Infrared Remote Control). LIRC setup and usage is described at https://wiki.archlinux.org/title/LIRC
To get started, see the ArchLinux Step-by-step LIRC setup guide for USB IR receiver with universal remote control.
The only prerequisites are a USB IR receiver, preferably an MCE model, and an old universal remote control you have lying around the house.
A long list of LIRC supported remotes with corresponding LIRC configurations can be found at the LIRC Remotes Databass.
The hard part is getting the remote control device talking to the IR receiver since there are a number of different protocols and devices supported. The LIRC setup guide linked above has pretty good step-by-step procedures for establishing communication between the remote and the receiver.
Once the hardware is successfully communicating, you can control MPD with lirc
and mpc
by configuring lirc. For example, add the following to ~/.lircrc
:
## irexec
begin
prog = irexec
button = play_pause
config = mpc toggle
repeat = 0
end
begin
prog = irexec
button = stop
config = mpc stop
repeat = 0
end
begin
prog = irexec
button = previous
config = mpc prev
repeat = 0
end
begin
prog = irexec
button = next
config = mpc next
repeat = 0
end
begin
prog = irexec
button = volup
config = mpc volume +2
repeat = 1
end
begin
prog = irexec
button = voldown
config = mpc volume -2
repeat = 1
end
begin
prog = irexec
button = pbc
config = mpc random
repeat = 0
end
begin
prog = irexec
button = pdvd
config = mpc update
repeat = 0
end
begin
prog = irexec
button = right
config = mpc seek +00:00:05
repeat = 0
end
begin
prog = irexec
button = left
config = mpc seek -00:00:05
repeat = 0
end
begin
prog = irexec
button = up
config = mpc seek +1%
repeat = 0
end
begin
prog = irexec
button = down
config = mpc seek -1%
repeat = 0
end
A guide for configuring lirc
to control MPD using mpc
can be found at https://wiki.archlinux.org/title/Music_Player_Daemon/Tips_and_tricks#Control_MPD_with_lirc
Building MusicPlayerPlus from source
MusicPlayerPlus can be compiled, packaged, and installed from the source code repository. This should be done as a normal user with sudo
privileges:
# Retrieve the source code from the repository
git clone https://github.com/doctorfree/MusicPlayerPlus.git
# Enter the MusicPlayerPlus source directory
cd MusicPlayerPlus
# Install the necessary build environment (not necessary on Arch Linux)
scripts/install-dev-env.sh
# Compile the MusicPlayerPlus components and create an installation package
./mkpkg
# Install MusicPlayerPlus and its dependencies
./Install
These steps are detailed below.
Clone MusicPlayerPlus repository
git clone https://github.com/doctorfree/MusicPlayerPlus.git
cd MusicPlayerPlus
[Note:] The mkpkg
script in the top level of the MusicPlayerPlus repository can be used to build an installation package on all supported platforms. After cloning, cd MusicPlayerPlus
and ./mkpkg
. The resulting installation package(s) will be found in ./releases/<version>/
.
Install build dependencies
MusicPlayerPlus components have build dependencies on the following:
- libtool
- automake
- build-essentials
- Boost library
- NCurses library
- Readline library
- Curl library
- fftw library
- tag library
- iniparser
- ALSA dev files
- Pulseaudio dev files
- Eigen
- Gaia
- libavcodec/libavformat/libavutil/libswresample
- libsamplerate
- LibYAML
- Chromaprint
- TensorFlow
Install build dependencies via:
scripts/install-dev-env.sh
or manually with:
sudo apt-get install \
build-essential libeigen3-dev libfftw3-dev clang \
libavcodec-dev libavformat-dev libavutil-dev libswresample-dev \
libsamplerate0-dev libtag1-dev libchromaprint-dev libmpdclient-dev \
autotools-dev autoconf libtool libboost-all-dev fftw-dev \
libiniparser-dev libyaml-dev swig python3-dev pkg-config \
libncurses-dev libasound2-dev libreadline-dev libpulse-dev \
libcurl4-openssl-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools \
libavfilter-dev libavdevice-dev libsqlite3-dev
On RPM based systems like Fedora Linux, manually install build dependencies via:
sudo dnf install alsa-lib-devel ncurses-devel fftw3-devel \
pulseaudio-libs-devel libtool automake iniparser-devel \
SDL2-devel eigen3-devel libyaml-devel clang-devel \
ffmpeg-devel libchromaprint-devel python-devel \
python3-devel python3-yaml python3-six sqlite-devel
On Arch Linux or other PKGBUILD based Linux systems, manually install build dependencies via:
sudo pacman -S --needed base-devel eigen fftw clang ffmpeg4.4 libsamplerate \
taglib chromaprint libmpdclient boost boost-libs iniparser libyaml swig \
alsa-lib ncurses readline libpulse libcurl-compat sqlite qt5-base \
qt5-tools python python-numpy python-six pandoc zip
[Note:] The MusicPlayerPlus PKGBUILD
on Arch Linux defines build dependencies and these will be automatically installed when performing a makepkg
build. It is not necessary to pre-install these packages.
Install packaging dependencies
MusicPlayerPlus components have packaging dependencies on the following:
On Debian based systems like Ubuntu Linux, install packaging dependencies via:
sudo apt install dpkg
On RPM based systems like Fedora Linux, install packaging dependencies via:
sudo dnf install rpm-build rpm-devel rpmlint rpmdevtools
Build and package MusicPlayerPlus
To build and package MusicPlayerPlus, execute the command:
./mkpkg
On Debian based systems like Ubuntu Linux, the mkpkg
scripts executes scripts/mkdeb.sh
.
On RPM based systems like Fedora Linux, the mkpkg
scripts executes scripts/mkrpm.sh
.
On PKGBUILD based systems like Arch Linux, the mkpkg
scripts executes scripts/mkaur.sh
.
Install MusicPlayerPlus from source build
After successfully building and packaging MusicPlayerPlus with either ./mkpkg
, install the MusicPlayerPlus package with the command:
./Install
Contributing
There are a variety of ways to contribute to the MusicPlayerPlus project. All forms of contribution are appreciated and valuable. Also, it’s fun to collaborate. Here are a few ways to contribute to the further improvement and evolution of MusicPlayerPlus:
Testing and Issue Reporting
MusicPlayerPlus is fairly complex with many components, features, options, configurations, and use cases. Although currently only supported on Linux platforms, there are a plethora of Linux platforms on which MusicPlayerPlus can be deployed. Testing all of the above is time consuming and tedious. If you have a Linux platform on which you can install MusicPlayerPlus and you have the time and will to put it through its paces, then issue reports on problems you encounter would greatly help improve the robustness and quality of MusicPlayerPlus. Open issue reports at https://github.com/doctorfree/MusicPlayerPlus/issues
Sponsor MusicPlayerPlus
MusicPlayerPlus is completely free and open source software. All of the MusicPlayerPlus components are freely licensed and may be copied, modified, and redistributed freely. Nobody gets paid, nobody is making any money, it’s a project fully motivated by curiousity and love of music. However, it does take some money to procure development and testing resources. Right now MusicPlayerPlus needs a multi-boot test platform to extend support to a wider variety of Linux platforms and potentially Mac OS X.
If you have the means and you would like to sponsor MusicPlayerPlus development, testing, platform support, and continued improvement then your monetary support could play a very critical role. A little bit goes a long way in MusicPlayerPlus. For example, a bootable USB SSD device could serve as a means of porting and testing support for additional platforms. Or, a decent cup of coffee could be the difference between a bug filled release and a glorious musical adventure.
Sponsor the MusicPlayerPlus project at https://github.com/sponsors/doctorfree
Contribute to Development
If you have programming skills and find the management and ease-of-use of digital music libraries to be an interesting area, you can contribute to MusicPlayerPlus development through the standard Github “fork, clone, pull request” process. There are many guides to contributing to Github hosted open source projects on the Internet. A good one is available at https://www.dataschool.io/how-to-contribute-on-github/. Another short succinct guide is at https://gist.github.com/MarcDiethelm/7303312.
Once you have forked and cloned the MusicPlayerPlus repository, it’s time to setup a development environment. Although many of the MusicPlayerPlus commands are Bash shell scripts, there are also applicatons written in C and C++ along with documentation in Markdown format, configuration files in a variety of formats, examples, screenshots, video demos, build scripts, packaging, and more.
The development environment consists of several packages needed to build, package, and test MusicPlayerPlus components. These include:
build-essential libeigen3-dev libfftw3-dev clang
libavcodec-dev libavformat-dev libavutil-dev libswresample-dev
libsamplerate0-dev libtag1-dev libchromaprint-dev libmpdclient-dev
autotools-dev autoconf libtool libboost-all-dev fftw-dev
libiniparser-dev libyaml-dev swig python3-dev pkg-config
libncurses-dev libasound2-dev libreadline-dev libpulse-dev
libcurl4-openssl-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
libavfilter-dev libavdevice-dev libsqlite3-dev
Utilities and applications built from source in MusicPlayerPlus include:
- mppcava character based spectrum visualizer
The build scripts in the scripts/
directory of the MusicPlayerPlus repository can be used to compile bliss-analyze, blissify, and mppcava. These are:
- scripts/build-bliss-analyze.sh
- scripts/build-blissify.sh
- scripts/build-mppcava.sh
Invoke the appropriate build script for the utility you wish to compile. For example, to compile the mppcava
spectrum visualizer from source, run the command:
./scripts/build-mppcava.sh
On Debian (e.g. Ubuntu), PKGBUILD (e.g. Arch) and RPM (e.g. Fedora) based systems the MusicPlayerPlus installation package can be created with the mkpkg
scripts. The mkpkg
script determines which platform it is on and executes the appropriate build and packaging script in the scripts/
directory. These scripts invoke the build scripts for each of the projects included with MusicPlayerPlus, populate a distribution tree, and call the respective packaging utilities. Packages are saved in the ./releases/<version>/
folder. Once a package has been created it can be installed with the Install
script.
It’s not necessary to have C/C++ expertise to contribute to MusicPlayerPlus development. Many of the MusicPlayerPlus commands are Bash scripts and require no compilaton. Script commands reside in the bin
and share/scripts
directories. To modify a shell script, install MusicPlayerPlus and edit the bin/<script>
or share/scripts/<script.sh>
you wish to improve. After making your changes simply copy the revised script to /usr/bin
and test your changes.
Modifying the configuration files is a little more tricky. Configuration files generally live in the config
directory but each has its own installation location and some are modified by the mppinit
command during installation. If you are just modifying the shell scripts or configuration files then you don’t need to worry about the extensive list of dependencies listed above.
Feel free to email me at github@ronrecord.com with questions or comments.