Git Product home page Git Product logo

linamp's Introduction

Linamp player

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

Requirements

  • Qt 6 with Qt Multimedia
  • taglib 1.11.1 or newer
  • libasound2-dev
  • libpipewire-0.3-dev
  • vlc
  • libiso9660-dev
  • libcdio-dev
  • libcdio-utils
  • swig
  • python3-pip
  • python3-full
  • python3-dev
  • libdiscid0

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 player.pro 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

  • File picker and playlist view doesn't correctly work with mouse input, clicks are not detected (touch works fine). There was a bug with touch input which got fixed by disabling certain mouse events, but this had the side effect that if you don't have a touch screen, you cannot quite use it with a mouse. WORKAROUND: Whenever you want to click something inside the file browser or playlist, click and hold for about one second, this will trigger the click event correctly.
  • In order for the Python integration (and thus, the CD player functionality) to work and not crash, you need to run the app inside the Python venv, you can use the "start.sh" script as a helper to set everything up for you and run it. However, because Qt Creator by default will directly run the player executable outside of the venv, the cd player will crash. I'm yet to find a better way of running it inside Qt Creator, other than telling it to run the "start.sh" script instead of the executable.

Debugging memory leaks:

  • Install valgrind
  • In Qt Creator, in the menu bar, click Analyze -> Valgrind Memory Analizer
  • Wait for the app to start (it will be slow), use it and close it, you will get the results then.

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

linamp's People

Contributors

rodmg avatar rosmo avatar

Stargazers

Rowan H avatar Ed avatar Antonio Bellotta avatar Chris Marshall avatar Stephen Ludgate avatar Shawn Henderson avatar Uncleanone avatar  avatar  avatar  avatar  avatar  avatar Dale Morgan avatar  avatar Martin Hassman avatar Karun181 avatar Marcin Dąbrowski avatar Cassie Cheung avatar Backwoods Bob avatar tang avatar  avatar Brian Kelley avatar Anibal avatar Oliver Drechsler avatar Daniel Gilbert avatar  avatar John Blanton Jr avatar Steve Schroeder avatar Marcel Heers avatar  avatar Markus Rennings avatar  avatar Denis Belov avatar Sebastian Schlatow avatar Artur Kordowski avatar Victor Toni avatar Oliver Gerlach avatar Justin.Lee avatar  avatar  avatar Faiafokkusu avatar  avatar Peter Skarpetis avatar Justin Donaldson avatar Abraham Alamilla avatar Martin Zwigl avatar  avatar Roberto A. Foglietta avatar Montri Chatpoj avatar  avatar  avatar cmanon avatar  avatar Leonardo J. Caballero G. avatar Michael Taggatz avatar Kevin avatar Justine Akehurst avatar Howard_Lyu avatar  avatar Saul O'Driscoll avatar  avatar AndyLiebe avatar Aleix Murtra avatar Galip Usta avatar  avatar  avatar Sebastian Rios Sabogal avatar Elliot DeNolf avatar  avatar  avatar Bertrand DATAS avatar David M. Moreno avatar  avatar Juan Pablo Zamora Veraza avatar Grigoriy Krassilnikov avatar Chad Meyers avatar  avatar Faheem Pervez avatar Miguel avatar George Andrei avatar  avatar Jeremy Rode avatar E-Blaze Corp avatar weo3 avatar Xenon007 avatar Luis Pirir avatar przemu avatar  avatar Benjamin Choy avatar  avatar  avatar  avatar Tertius Stander avatar Charl avatar Kamil Dębicki avatar  avatar  avatar  avatar Wesley Moore avatar taoteh1221 avatar

Watchers

tang avatar Luis Pirir avatar  avatar  avatar  avatar  avatar Jason Wolosonovich avatar  avatar Montri Chatpoj avatar  avatar  avatar  avatar  avatar

linamp's Issues

3D model assets request

Once you are happy with the printable or other physical assets of the embedded player build, I’d love to have a look at those in order to recreate, iterate and build on. Thanks for sharing this project, it is truly awesome!

Issues compiling

Upon trying to compile this project with cmake .., it complains about not being able to find "player.cpp"

cmake ..
-- The CXX compiler identification is GNU 14.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Configuring done (0.6s)
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:629 (add_executable):
  Cannot find source file:

    player.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:575 (_qt_internal_create_executable)
  /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:869 (qt6_add_executable)
  CMakeLists.txt:18 (qt_add_executable)


-- Generating done (0.0s)
CMake Generate step failed.  Build files cannot be regenerated correctly.```

Am I missing something? There are no instructions on how to compile this project.

Adapt to 7 inch official raspberry pi screen

I tried editing several .ui files to get this working but there was always a scale issue and the buttons dissappeared. I tried setting the max size, etc on the .ui files but it wouldn't work properly.

Is there a way to get this working for a different size screen, specifically the 7 iinch official raspberry pi screen?

Just the guidance on how I can go about this would enough.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.