Rodmg / linamp

GNU General Public License v3.0
127 stars 15 forks source link

Linamp player

Music player app for Linamp - Your favorite music player of the 90s, but in real life.

Requirements

Development

Setup

The exact steps you need to take to setup your dev environment will depend on your OS. Currently I'm using Debian Bookworm as my dev environment as it's very close to the target device environment (Raspberry Pi with DietPi, which is based on Debian Bookworm).

The instructions here are for Debian Bookworm:

# Install Qt, Qt Multimedia and Qt Creator
sudo apt-get install build-essential qt6-base-dev qt6-base-dev-tools qt6-multimedia-dev qtcreator cmake -y

# Install third party library dependencies
sudo apt-get install libtag1-dev libasound2-dev libpulse-dev libpipewire-0.3-dev libdbus-1-dev -y

# Install dependencies for Python (for CD player functionality)
sudo apt-get install vlc libiso9660-dev libcdio-dev libcdio-utils swig python3-pip python3-full python3-dev libdiscid0 libdiscid-dev -y

# Create Python venv and install Python dependencies (for CD player functionality)
## IMPORTANT: Make sure you are on the folder where you cloned this repo before running the following commands:
python3 -m venv venv
source venv/bin/activate
pip install -r python/requirements.txt

Build and run

Using Qt Creator:

  1. Open this project with Qt Creator (open CMakeLists.txt in Qt Creator)
  2. Qt Creator should guide you setting up your paths and settings for building the proyect in your machine
  3. You should be able to click the green "Play" icon in Qt Creator to build and run the app

From the console:

# From inside this repository:
## Generate build configuration, you only need to run this once:
cmake CMakeLists.txt
## Setup python dependencies, you only need to run this once:
./setup.sh

## Compile the project
make

## Run the app
./start.sh

Tip: If you want to see the app in a window instead of full screen, comment out the following line in main.cpp: //window.setWindowState(Qt::WindowFullScreen);

Building a Debian package

Install and setup sbuild running the following commands:

sudo apt-get install sbuild schroot debootstrap apt-cacher-ng devscripts piuparts dh-python dh-cmake
sudo tee ~/.sbuildrc << "EOF"
##############################################################################
# PACKAGE BUILD RELATED (additionally produce _source.changes)
##############################################################################
# -d
$distribution = 'bookworm';
# -A
$build_arch_all = 1;
# -s
$build_source = 1;
# --source-only-changes (applicable for dput. irrelevant for dgit push-source).
$source_only_changes = 1;
# -v
$verbose = 1;
# parallel build
$ENV{'DEB_BUILD_OPTIONS'} = 'parallel=5';
##############################################################################
# POST-BUILD RELATED (turn off functionality by setting variables to 0)
##############################################################################
$run_lintian = 1;
$lintian_opts = ['-i', '-I'];
$run_piuparts = 1;
$piuparts_opts = ['--schroot', '%r-%a-sbuild', '--no-eatmydata'];
$run_autopkgtest = 1;
$autopkgtest_root_args = '';
$autopkgtest_opts = [ '--', 'schroot', '%r-%a-sbuild' ];
##############################################################################
# PERL MAGIC
##############################################################################
1;
EOF
sudo sbuild-adduser $LOGNAME
newgrp sbuild
sudo ln -sf ~/.sbuildrc /root/.sbuildrc
sudo sbuild-createchroot --include=eatmydata,ccache bookworm /srv/chroot/bookworm-amd64-sbuild http://127.0.0.1:3142/ftp.us.debian.org/debian

Then simply run sbuild --no-run-piuparts --lintian-opt="--suppress-tags=bad-distribution-in-changes-file" in the cloned repository directory. The .deb packages will be in your home directory afterwards if everything went well.

You can install the newly built packages with the following command (replace placeholders accordingly):

sudo apt install ./linamp_[version]_[arch].deb

Known issues

Debugging memory leaks:

Links that I've found useful and/or got inspiration from: