User Tools

Site Tools


raspberry-pi:music_player

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
raspberry-pi:music_player [2020/11/01 21:14] Wulf Rajekraspberry-pi:music_player [2023/05/29 11:55] (current) – external edit 127.0.0.1
Line 6: Line 6:
 https://mopidy.com/ https://mopidy.com/
  
 +===== Hardware =====
  
 Pimoroni Pirate Audio Headphone AMP: Pimoroni Pirate Audio Headphone AMP:
Line 14: Line 15:
 https://shop.pimoroni.com/products/pirate-audio-mini-speaker  https://shop.pimoroni.com/products/pirate-audio-mini-speaker 
  
-Pimoroni Pirate Audio Case:+Pimoroni Pirate Audio Case with buttons: 
 +https://www.thingiverse.com/thing:5245754 
 + 
 +Pimoroni Pirate Audio Case (link dead):
 https://www.thingiverse.com/thing:4087948 https://www.thingiverse.com/thing:4087948
  
Line 20: Line 24:
 https://www.yeggi.com/q/pimoroni+pirate+audio/  https://www.yeggi.com/q/pimoroni+pirate+audio/ 
  
-===== Software install =====+Angled case: 
 +https://www.thingiverse.com/thing:5248110/comments 
 + 
 +===== System installation =====
  
 Download Raspberry OS lite (Buster) Download Raspberry OS lite (Buster)
Line 28: Line 35:
  
 Note: /etc/init.d/resize2fs_once is triggered on first boot, then removes itself. Note: /etc/init.d/resize2fs_once is triggered on first boot, then removes itself.
- 
  
 WIFI config: WIFI config:
 create wpa_supplicant.conf in /boot create wpa_supplicant.conf in /boot
-<code>+<code - /boot/wpa_supplicant.conf>
 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 update_config=1 update_config=1
Line 47: Line 53:
  
 /boot/config.txt /boot/config.txt
-<code>+<code - /boot/config.txt>
 #Set GPU memory to lowest value #Set GPU memory to lowest value
 gpu_mem=16 gpu_mem=16
Line 79: Line 85:
 Add the line to /etc/rc.local to disable HDMI on boot. Add the line to /etc/rc.local to disable HDMI on boot.
  
 +Now insert the SD-Card into the Pi and power it up. Then connect to it via SSH.
  
 Security. Default user pi with password raspberry Security. Default user pi with password raspberry
 https://www.raspberrypi.org/documentation/configuration/security.md https://www.raspberrypi.org/documentation/configuration/security.md
 +
 +
 +===== Mopidy Installation =====
  
 Install git if not already installed: Install git if not already installed:
Line 94: Line 104:
 #Then install mopidy-iris web interface and Pirate Audio plugins #Then install mopidy-iris web interface and Pirate Audio plugins
 #And create system service to autostart mopidy #And create system service to autostart mopidy
- 
 <code> <code>
 cd /usr/src cd /usr/src
Line 102: Line 111:
 </code> </code>
  
-Alternative web interfaces:+Additional web interfaces can be installed:
 https://github.com/pimusicbox/mopidy-musicbox-webclient https://github.com/pimusicbox/mopidy-musicbox-webclient
 <code> <code>
Line 118: Line 127:
 sudo apt-get purge bluez bluez-firmware sudo apt-get purge bluez bluez-firmware
 sudo apt autoremove sudo apt autoremove
 +</code>
 +
 +Install mopidy-local extension backend (local+sqlite combined) to build local index for search and increased performance.
 +https://github.com/mopidy/mopidy-local
 +<code>
 +sudo python3 -m pip install Mopidy-Local
 </code> </code>
  
 #Display will show ip and default mopidy port :6680 for web interface. Iris web client needs to be selected #Display will show ip and default mopidy port :6680 for web interface. Iris web client needs to be selected
 +
  
 #Edit Mopidy config #Edit Mopidy config
 sudo vi /etc/mopidy/mopidy.conf sudo vi /etc/mopidy/mopidy.conf
 <code> <code>
-#file section change +#disable file extension 
-media_dirs =  +[file] 
-    /media/music +enabled false 
-    /media/network+ 
 +#enable local with sqlite extension 
 +[local] 
 +enabled = true 
 +media_dir = /media/network 
 +scan_timeout = 5000 
 +scan_flush_threshold = 50 
 +album_art_files = 
 +  cover.* 
 +  folder.* 
 +directories = 
 +  Albums                  local:directory?type=album 
 +  Artists                 local:directory?type=artist 
 +  Composers               local:directory?type=artist&role=composer 
 +  Genres                  local:directory?type=genre 
 +  Performers              local:directory?type=artist&role=performer 
 +  Release Years           local:directory?type=date&format=%25Y 
 +  Tracks                  local:directory?type=track 
 +  Last Week's Updates     local:directory?max-age=604800 
 +  Last Month's Updates    local:directory?max-age=2592000 
 +timeout = 10
  
-#change 
-metadata_timeout = 5000 
  
-#add to http section+#add to http section to enable web server for web front-ends
 enabled = true enabled = true
 #port = 80 #issue with mopidy user and ports <1024 #port = 80 #issue with mopidy user and ports <1024
Line 193: Line 227:
 </code> </code>
  
 +
 +Trigger scan of media directories (when mopidy runs as service):
 +<code>
 +sudo mopidyctl local scan
 +</code>
 +or when running from terminal as logged in user:
 +<code>
 +mopidy local scan
 +</code>
 +
 +Note the default configuration files mopidy is looking for are in ~/.config/mopidy/mopidy.conf or /usr/share/mopidy/conf.d whereas the default service loads /usr/share/mopidy/conf.d and /etc/mopidy/mopidy.conf
 +The service file using the mopidy user is:
 +/etc/systemd/system/multi-user.target.wants/mopidy.service
 +
 +===== Mopidy MPD =====
 +
 +https://github.com/mopidy/mopidy-mpd
 +
 +<code>sudo python3 -m pip install Mopidy-MPD</code>
 +<code>
 +[mpd]
 +hostname = 0.0.0.0
 +</code>
  
 ===== Edit the volume button's sensibility ===== ===== Edit the volume button's sensibility =====
  
 Default volume button step is 5%. Adding <code>step = x</code> to the [raspberry-gpio] section of /etc/mopidy/mopidy.conf adjusts it. The total volume range is 0-100. Default volume button step is 5%. Adding <code>step = x</code> to the [raspberry-gpio] section of /etc/mopidy/mopidy.conf adjusts it. The total volume range is 0-100.
 +
  
 ===== Other music player projects ===== ===== Other music player projects =====
raspberry-pi/music_player.1604265254.txt.gz · Last modified: 2023/05/29 11:53 (external edit)