GithubHelp home page GithubHelp logo

jcorporation / mympdos Goto Github PK

View Code? Open in Web Editor NEW
28.0 6.0 6.0 1.03 GB

A music player image for Raspberry Pi based on Alpine Linux, MPD and myMPD.

Home Page: https://jcorporation.github.io/

License: GNU General Public License v3.0

Shell 99.75% Lua 0.25%
mpd raspberry-pi alpine-linux

mympdos's Introduction

myMPDos

myMPDos is a Raspberry Pi image (aarch64) based on Alpine Linux. It is running entirely in RAM and it does not write to the sd-card unless you want to save settings. Therefore, myMPDos is very robust and you can simply turn off the power without any risk of corruption of your sd-card.

myMPDos is a turnkey music playback solution and is designed arround MPD and myMPD. After startup you can access the myMPD webinterface, copy music to the sd-card data partition, mount a music share or simply plugin an usb storage and you can start enjoying your music.

The initial configuration is done through a simple bootstrap file, that has sane default values preconfigured. Setting up myMPDos takes only a few minutes. Experts can use the advanced bootstrap file to customize the installation further.

Features

  • Based on latest Alpine Linux
  • Runs entirely in RAM
  • Very small ressource usage
  • Preconfigured MPD and myMPD
  • Latest stable MPD and myMPD releases
  • Bleeding edge versions of MPD, mpc and libmpdclient
  • Automounts USB devices and adds its contents to the mpd database
  • Configures MPD outputs automatically
  • Use GPIO buttons to control MPD and myMPD with myGPIOd
  • Optional bluetooth support

Usage

  1. Download the latest release image
  2. Transfer it to the sd-card, e. g. with balenaEtcher
  3. Copy bootstrap-simple.txt or bootstrap-advanced.txt to bootstrap.txt
  4. Adapt bootstrap.txt
  5. Boot your Raspberry Pi

Processlist

init-+-getty
     |-mpd-+-{decoder:mad}
     |     |-{io}
     |     |-{output:U24XL US}
     |     |-{player}
     |     `-{rtio}
     |-mympd-+-{mympd_api}
     |       `-{mympd_webserver}
     |-ntpd
     |-rngd
     |-sshd
     `-syslogd

Documentation

For further information on installation and configuration, see the myMPDos documentation.

Copyright

2020-2024 Juergen Mang [email protected]

mympdos's People

Contributors

jcorporation avatar juergenmang avatar kurtlawrence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mympdos's Issues

How to persist arbitrary files

My usecase requires running tailscale for connecting my pi3 to my network (using vpn as keyword here, for anyone having issues with vpn access and similar issues)

Installation, configuration and usage of tailscale works correctly.

But the process of loging in to tailscale does not persist across reboots. This is because tailscale keeps it's login state in /var/lib/tailscale/tailscaled.state (Note: to be verified, as I cannot test this across boots)

How would I be able to persist this file so it is available across reboots?

Sidenote: I am vaguely familiar with overlays, and I am struggling to understand the exact mechanism that myMPDos is using for the alpine overlays. Where can I read more about it?

Thanks!

rpi-dac / i2s-dac do not show up in the results when running audiohat.sh.

rpi-dac / i2s-dac do not show up in the results when running audiohat.sh. They are present in the overlays/README.

myMPDos:/usr/bin# ./audiohat.sh
Downloading audio hats description

  1. allo-boss-dac-pcm512x-audio
  2. allo-boss2-dac-audio
  3. allo-digione
  4. allo-katana-dac-audio
  5. allo-piano-dac-pcm512x-audio
  6. allo-piano-dac-plus-pcm512x-audio
  7. applepi-dac
  8. chipdip-dac
  9. hifiberry-amp
  10. hifiberry-amp100
  11. hifiberry-amp3
  12. hifiberry-dac
  13. hifiberry-dacplus
  14. hifiberry-dacplusadc
  15. hifiberry-dacplusadcpro
  16. hifiberry-dacplusdsp
  17. hifiberry-dacplushd
  18. hifiberry-digi
  19. hifiberry-digi-pro
  20. iqaudio-codec
  21. iqaudio-dac
  22. iqaudio-dacplus
  23. iqaudio-digi-wm8804-audio
  24. justboom-digi
  25. merus-amp
  26. pibell

Mympdos alpine repo is unreachable

After a few retry, I can't properly install mympdos as the alpine repo seems to be unreachable. A quick visit with a web browser gives me a 404 error.

So on a fresh install, alpine gets installed, the bootstrap file is read and used, but the os can't connect to your server and it doesn't get to install mpd or mympd and so on, ...

Anything you can do ?

Add a local browser feature

Like other audiophile distributions, it is convenient to use a touch screen. I checked the documentation, but I can't find any mention. Maybe I'm wrong.

mympdos 1.2.2 mongoose cant bind port

I launch a fresh 1.2.2, mympd doesn't start, so i try :
myMPDos:~# mympd
12:11:53 NOTICE mympd Cache dir: "/var/cache/mympd"
12:11:53 NOTICE mympd Work dir: "/var/lib/mympd"
12:11:53 NOTICE mympd Config dir: "/var/lib/mympd/config"
12:11:53 NOTICE mympd Setting loglevel to NOTICE
12:11:53 NOTICE mympd Starting myMPD 11.0.1
598a7 1 mongoose.c:4685:mg_open_listen bind: 98
598a7 1 mongoose.c:3713:mg_listen Failed: http://[::]:80, errno 98
12:11:53 EMERG mympd Can't bind to http://[::]:80
Exiting erroneous, thank you for using myMPD

Nothing runs on first boot

Followed the instructions to the letter and although I can ssh to my pi, no mpd/mympd services are running at all (nothing available at https://my.pi.ip)

Redid the installation (burned again a new sd card) but same result.

I noticed that:

# myMPDos repository
MYMPDOS_REPOSITORY="https://raw.githubusercontent.com/jcorporation/myMPDos/master/repository"

resolves to a 404 page. https://raw.githubusercontent.com/jcorporation/myMPDos/master/repository

That doesn't seem right, does it?

Build fails at stage 3, can't open image file

I think I have followed the steps and installed the dependencies (this is on Arch Linux), but yet when trying to build the image I get the following output:

./build.sh build                                                                                                                                                                                                                                         
Building for aarch64                                                                                                                                                                                                                                        
Checking dependencies                                                                                                                                                                                                                                       
myMPDos build stage 1: Download                                                                                                                                                                                                                             
Getting alpine-netboot-3.17.0-aarch64.tar.gz                                                                                                                                                                                                                
Getting alpine-rpi-3.17.0-aarch64.tar.gz                                                                                                                                                                                                                    
myMPDos build stage 2: Create build image                                                                                                                                                                                                                   
8192+0 records in                                                                                                                                                                                                                                           
8192+0 records out                                                                                                                                                                                                                                          
8589934592 bytes (8.6 GB, 8.0 GiB) copied, 70.0024 s, 123 MB/s                                                                                                                                                                                              
Checking that no-one is using this disk right now ... OK                                                                                                                                                                                                    
                                                                                                                                                                                                                                                            
Disk myMPDos-build.img: 8 GiB, 8589934592 bytes, 16777216 sectors                                                                                                                                                                                           
Units: sectors of 1 * 512 = 512 bytes                                                                                                                                                                                                                       
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                                                                       
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                                                                           
                                                                                                                                                                                                                                                            
>>> Created a new DOS disklabel with disk identifier 0x48256963.                                                                                                                                                                                            
myMPDos-build.img1: Created a new partition 1 of type 'W95 FAT32' and of size 1024 MiB.                                                                                                                                                                     
myMPDos-build.img2: Done.                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                            
New situation:                                                                                                                                                                                                                                              
Disklabel type: dos                                                                                                                                                                                                                                         
Disk identifier: 0x48256963                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                            
Device             Boot Start     End Sectors  Size Id Type                                                                                                                                                                                                 
myMPDos-build.img1 *        1 2097151 2097151 1024M  b W95 FAT32                                                                                                                                                                                            

The partition table has been altered.                          
Syncing disks.                                                 
Checking that no-one is using this disk right now ... OK       

Disk myMPDos-build.img: 8 GiB, 8589934592 bytes, 16777216 sectors                                                             
Units: sectors of 1 * 512 = 512 bytes                          
Sector size (logical/physical): 512 bytes / 512 bytes          
I/O size (minimum/optimal): 512 bytes / 512 bytes              
Disklabel type: dos                                            
Disk identifier: 0x48256963                                    

Old situation:                                                 

Device             Boot Start     End Sectors  Size Id Type    
myMPDos-build.img1 *        1 2097151 2097151 1024M  b W95 FAT32                                                              

myMPDos-build.img2: Created a new partition 2 of type 'Linux' and of size 7 GiB.                                              
myMPDos-build.img3: Done.                                      

New situation:                                                 
Disklabel type: dos                                            
Disk identifier: 0x48256963                                    

Device             Boot   Start      End  Sectors  Size Id Type                                                               
myMPDos-build.img1 *          1  2097151  2097151 1024M  b W95 FAT32                                                          
myMPDos-build.img2      2097152 16777215 14680064    7G 83 Linux                                                              

The partition table has been altered.                          
Syncing disks.                                                 
mkfs.fat 4.2 (2021-01-31)                                      
mke2fs 1.46.5 (30-Dec-2021)                                    
Discarding device blocks: done                                 
Creating filesystem with 1835008 4k blocks and 458752 inodes   
Filesystem UUID: 2f6bbed8-c482-42da-ba2c-5c73a93135d9          
Superblock backups stored on blocks:                           
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632                                                         

Allocating group tables: done                                  
Writing inode tables: done                                     
Creating journal (16384 blocks): done                          
Writing superblocks and filesystem accounting information: done                                                               

Copy build scripts                                             
Copy existing packages                                         
No saved abuild.tgz found                                      
Patching initramfs                                             
182862 blocks                                                  
patching file init                                             
46 blocks                                                      
myMPDos build stage 3: Starting build                          
qemu-system-aarch64: -drive file=myMPDos-build.img,format=raw: Could not open 'myMPDos-build.img': No such file or directory  
myMPDos build stage 4: Saving packages                         
losetup: myMPDos-build.img: failed to set up loop device: No such file or directory                                           
mount: mnt: mount point does not exist.                        
       dmesg(1) may have more information after failed mount system call.

Do you have any hint on what I should be looking for? Thanks.

Doesn't Work on Raspberry Pi 2B v1.2 (aarch64)

Hi,
I installed myMPDos v0.9.4 to Raspberry Pi 2 Model B V1.2 (aarch64), but it didn't work. How do I adapt myMPDos to run on the hardware? I tried the following so far.

I added the following lines to the usercfg.txt

[pi2]
kernel=boot/vmlinuz-rpi
initramfs boot/initramfs-rpi

After booting the Raspberry Pi, I confirmed a specific IP address was leased successfully.

Then, I followed the After first start procedure, but failed to access the myMPD via web interface. The web browser (Firefox) displayed the following message.

Unable to connect

Firefox can’t establish a connection to the server at 192.168.1.6.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

I also tried SSH access then the following message was displayed.

Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See http://wiki.alpinelinux.org/.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

myMPDos:~#

Since I'm not so familiar with the CUI, I gave up going further. Any help is highly appreciated.

Wrong mixer_control

Hi,
I have a Khadas tone board, and /etc/mpd.conf, in audio_output section, mixer_control is wrong :

audio_output {
  name          "Control USB Audio"
  device        "hw:0,0"
  type          "alsa"
  auto_resample "no"
  auto_format   "no"
  mixer_type    "hardware"
  mixer_device  "hw:0"
  mixer_control "Khadas"
}

#amixer

Simple mixer control 'Khadas Tone Control ',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 107 [84%] [-20.00dB] [on]
  Front Right: Playback 107 [84%] [-20.00dB] [on]
Simple mixer control 'Khadas Tone Control ',1
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 127 [100%] [0.00dB] [on]

I tried to change mixer_control to the correct value (mixer_control "Khadas Tone Control "), but after a reboot, mixer_control always reverts to the wrong value. I checked /media/mmcblk0p2/mpd.apkovl.tar.gz, /etc/mpd.conf file is correct after doing:

vi /etc/mpd.conf (edit with correct value)
rwdata.sh
lbu include /etc/mpd.conf
lbu commit -d

/etc/mpd.conf always reverts to the wrong value.
Thanks

Enable IPv6 by default

This fixes #21

  • Remove sysctl config bindipv6 only in mympdos-base package
  • Enable IPv6 in bootstrap config
  • Enable IPv6 for MPD

The repository may be heavier that it needs to be.

Not a big deal, but when I cloned this repo, I realized that it's about 700 MB if I recall correctly.
But nothing inside the repo actually weights this much. The heavy file is in .git/objects/pack/pack-5708580219d3200d25a4928c77da877ce737e0d0.pack.
Which means it's the history of the repo that contains this much.

If it's actually just the overall history then not much can be done. But it could very well be some big file that was committed accidentally and then removed but stayed in the history, like an .img for example.
That can be removed but it requires rewriting history, not sure you want to do that.
Just my 2 cents, feel free to close if you don't mind about the size. But as I am thinking about cloning the repo each time I need to create a new image I am a bit affected by this.

install failed

with simple bootstrap file, install the 0.93 failed.
with ssh, i just this commands to fix
chmod a+w /var/lib/mympd
mympd
(wait for some downloads) and after :
chmod a-w /var/lib/mympd
savereboot.sh
fix
(raspberry 3 v1.2)

mygpiod user and gpio group appears to be missing in myMPDos 1.3.0

I installed the current myMPDos version 1.3.0 image to a Raspberry Pi 3B+. Install appeared to go without error. I added a push button switch to gpio pins 5 & 6, and followed the set-up documentation for myMPD. When trying to run the service, it failed with an error to tell me, in effect, the mygpiod user and gpio group were missing.

I manually added the user and group after which the the service ran correctly. For some reason I had to reboot for the doas configuration to be read. Before rebooting I would get a "not permitted" error when I pushed the button. Although a long time Linux user this is my first exposure to Alpine Linux, and by RTFM, may have saved me a reboot or two. I did try reinstalling myGPIOd using apk, but this didn't recreate the user or group for me.

Otherwise the myMPDos set-up couldn't be easier and happy to say all working now. Very nice project.

Raspberry Pi Zero 2 W support

Hi, this project looks amazing, but I'm having some trouble getting it running on my Zero 2 W. This is my first Raspberry Pi project, so I could very well be missing some obvious knowledge.

After flashing my SD with myMPDos 0.9.4, the first issue I ran into was the ACT LED blinking 7 times. This looks to be a "kernel.img not found" error. I noticed the kernel paths being set in the config.txt file, and based on the docs for that file I added the following:

[pi02]
kernel=boot/vmlinuz-rpi
initramfs boot/initramfs-rpi

This allowed the system to boot.

The second issue I ran into was the boot sequence giving the message: No plan device found, falling back to eth0. This led to errors when starting the networking init script, when Checking network connectivity, and finally having mympdos-bootstrap.start fail.

From my searching, it looks like at least some issues with the pi02w were solved in Alpine 3.9.0, but it looks like this project currently uses 3.15.

I'm still searching for other information. The most promising has been this repo. I initially thought it might be a missing dtoverlay to enable wifi on the pi02w, but I don't see anything relevant in the overlay docs.

I'll follow-up here if I find any other useful information.

Self built image cannot use myMPDos repositories

I have successfully built the image but the first boot fails at:

adding repositories and upgrade
...
Adding myMPDos archiv signing public key
...
fetch https://raw.githubusercontent.com/jcorporation/myMPDos/master/repository/aarch64/APKINDEX.tar.gz
ERROR: https://raw.githubusercontent.com/jcorporation/myMPDos/master/repository: UNTRUSTED signature
WARNING: Ignoring https://raw.githubusercontent.com/jcorporation/myMPDos/master/repository: No such file or directory

the above error repeats another 2 times. Then the base Alpine linux installs correctly but there is no MPD running nor web server.

I have built the image with ./build.sh build.

Did I miss something?

SD card does not auto mount like a USB stick does

I don't believe this is an issue with myMPDos specifically, but wanted to raise here in case it was a configuration value set by the image. Feel free to close if this is out of this project's scope.

When I plug a USB stick into the Raspberry Pi, it's files are automatically mounted and accessible.

When I plug in a USB card reader, its device is detected, but when I insert an SD card into that it is not mounted or accessible.

Lastly, if I plug in the SD card before inserting the USB card reader, it is automatically mounted and accessible. Strange!

[RaspberryPi] -- Micro USB -- [USB Card Reader] -- SD Slot -- [SD Card]

I've tried with a couple different USB card readers, and a couple different SD cards, and non seem to support hot swapping the SD card. I've posted a question to the unix/linux Stack Exchange, and hopefully someone can point me in the right direction. More details in that post if this seems like something that could be configured through this distribution:

https://unix.stackexchange.com/questions/730184/with-a-usb-sd-card-reader-the-sd-card-only-shows-up-if-it-is-inserted-before-th

I am unable to control audio volume

myMPD shows Volume: Volumecontrol disabled.

I have switched the audio hat thanks to audiohat.sh to hifiberry-dac and the sound works but seems to be turned to maximum volume.

It seems to be at the OS level since alsamixer shows This sound device does not have any controls.
I am pretty sure I can control the sound device under Raspbian. Which makes me think it should work as well with Alpine.

I am going to investigate but in the meantime if you have any experience or suggestion regarding setting the audio volume I'll gladly take it.

Thanks.

Install myMPD scripts through bootstrap script

Install the myMPD scripts iin the bootstrap phase, not through the mympd-base package install. This prevents some permissions issues and does not override the scripts on each reboot.

Best way to use gpiozero

Hello,

I use some additional hardware to control the volume, next / previous, on / off actions.
See

https://shop.pimoroni.com/products/onoff-shim?variant=41102600138
https://shop.pimoroni.com/products/raspio-analog-zero

I am comfortable controlling those with gpiozero : https://gpiozero.readthedocs.io/en/latest/

What would be the best way to install gpiozero on myMPDos ?

All I can do is installing some alpine packages by listing them in the bootstrap.txt, but gpiozero recommends installing through pip (the python package manager).

I tried installing pip on a running myMPDos but it did not work. I guess because of the in ram system. The error is no space left on the device, which makes sense.
So, before fiddling more in the wrong direction, is there a recommended way ?

Thanks

OS Script failing to execute

myMPD version: 11.05

Describe the bug

I am failing to execute a shell script.

Getting

myMPDos authpriv.notice : command not permitted for mympd: /usr/bin/reset-dac-usb-port.sh

in the logs.

Server plattform (please complete the following information):

  • OS: myMPDos

Release an image for armv7 and armv6

Thanks for your awesome work on myMpd and myMpdos

myMPDos is a Raspberry Pi image (aarch64)

This means 32bit only Raspberry Pi models prior to the Rpi3 are not supported.
That leaves a lot of Rpi2 and Rpi zeros behind.

I run myMpd on a perfectly capable Rpi2 v1.1 (does not support aarch64).

Since Alpine Linux itself is, https://alpinelinux.org/downloads/ :

Designed for RPI 1, 2, 3 and 4. And much more..

Would it possible to release for these archs ?
Automate it through github actions ?

Thanks in advance.

ref: https://en.wikipedia.org/wiki/Raspberry_Pi#Processor

status.sh fails (location of vcgencmd has moved)

In status.sh vcgencmd is called by absolute path (/opt/vc/bin/vcgencmd) and fails.

find / -name vcgencmd return:
/usr/share/bash-completion/completions/vcgencmd
/usr/bin/vcgencmd

echo $PATH:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Why calling by absolute path?

NFS not supported

Thanks you very much for myMPD and myMPDos. It's a very good work, very good idea, very innovative.
I think it would be perfect to integrate NFS at myMPDos.
Otherwise an apk is enough : apk update and apk add nfs-utils

How to add extra software to the image?

In another conversation it was mentioned that "extra software" could be installed, by using the EXTRA_SOFTWARE config option.

It looks like the list requires valid Alpine packages to be installed with apk.

I need to install a few Python modules. I understand their dependencies can be installed through apk if I'm lucky. Some dependencies may require pip though, do you have any recommendation in this case?

Regarding the Python modules themselves, I guess the simple way would be to package those to be installable by apk, am I correct?
In this case, is there a simple way to provide those packages through a local apk repository?

Storage location for home icons

Discussed in jcorporation/myMPD#1259

Originally posted by bostrump April 18, 2024
My question relates to myMPDos, but there is no discussion area for this project.

Who can tell me how the home icons are persisted?
I would have expected home icons to be saved in a status file ("home_list"?) in "/var/lib/mympd/state".
After creating an icon, I can't see any changes there.
However, the new home icon does appear on another end device when I open the myMPD web interface there.
So the home icon must be persisted somewhere, but where?

Why I'm asking:
After reebot using the myMPDos script savereboot.sh, all home icons are lost.
So they are obviously not captured by the Alpine Linux "lbu commit".

I don't know if there is a correlation, but it is noticeable that after reebot is finished the web interface can no longer connect to myMPD.
Error mesage: "API Fehler" "Fehler beim Zugriff auf /api/default"

Only after reloading the page does the connection work again (but without home icons)
Other settings are saved correctly (e.g. background color)

I created the myMPDos image on 17.04.2024 (using myMPD 14.1.2) and it is running on Raspberry Pi 4 B.

I find it inconvenient to have to switch to write mode each time I want to favorite a web radio in myMPD.

I understand and support the point of having the OS in memory.

But I also find it inconvenient to have to remember that and toggle the read / write mode each time I want to save a web radio as a favorite in myMPD. Or maybe I misunderstand how it works, but if I don't toggle the write mode and save a favorite then it appears to be saved but when I reboot it's not there any more. Toggling the write mode does indeed save the favorite upon reboot.

Do you have any recommendation? Ideally leaving the OS in read only in memory and having a permanent write mode just to save the favorites would be great.
Or maybe a myMPDos configuration that allows to leave the OS in write mode all the time (also defeating the purpose of having the OS in memory if I understand correctly).

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.