Building a player - terba/slimmer GitHub Wiki

First of all, you will need an installation of Logitech Media Server on your network. You can also install this on the player itself, but it is advisable to have a separate computer for that (a NAS for example).

Using the following components you can build a high quality & low-cost network audio player with a slick interface:

Hardware components

  • a Raspberry PI board with a power supply and SD card
  • a DAC (sound card)
  • a character LCD supported by lcdproc (for example a 2004 HD44780 compatible)
  • an incremental rotary encoder with switch
  • two momentary switches
  • and some basic electronic components (one trimpot and some resistors)

Software components

Setup

If you are not familiar with the text editor vi, you can download nano with tce-load -w nano. Just replace vi with tce-run nano in the following steps.

Set up the piCorePlayer image on your Raspberry Pi. You can find its documentation here. Use piCorePlayer 2.06 or a newer version!

It may be a good choice to resize the SD card partition using the piCorePlayer web interface before installing Slimmer.

If piCorePlayer is working on the Pi, you can follow the steps below to create a user interface for the player.

  1. Connect the LCD, the rotary encoder and the momentary switches to the pins of the Pi. You can find many good tutorials on the net on those topics. Be careful when connecting a 5V LCD! Backlight control is available from Slimmer 2.0, so you can connect a switching component to the Pi to allow Slimmer to switch on/off the backlight of the LCD.

  2. Turn on the Pi and log in over ssh with the tc user.

  3. Download the latest Slimmer binary bundle: cd /tmp && wget https://github.com/terba/slimmer/releases/download/v1.2.1/slimmer-bundle.tar.bz2

  4. Extract it: tar jxvf slimmer-bundle.tar.bz2

  5. Copy the extracted files to the SD card: cp slimmer-bundle/* /mnt/mmcblk0p2/tce/optional/

  6. Download the required libraries: tce-load -w curl icu libftdi

    If You encounter the problem of missing ipv6 kernel module, you should use your players web page to install this from the piCorePlayer repository or use the following commands:

    echo "http://picoreplayer.sourceforge.net/tcz_repo/" > /opt/tcemirror
    tce-load -w ipv6-X.X.X-pcpCore
    echo "http://repo.tinycorelinux.net/" > /opt/tcemirror
    

    Replace X.X.X with the version the error message was complaining for. After that You will be able to install the libs, so please repeat this step.

  7. Install the bundle: tce-load -i lcdproc-server pikeyd slimmer

  8. Configure LCDd: sudo vi /usr/local/etc/LCDd.conf See my HD44780 config.

  9. Start LCDd. You should see the welcome text on the display: sudo /usr/local/etc/init.d/lcdproc-server start

  10. Configure Pikeyd: sudo vi /usr/local/etc/pikeyd.conf See my config.

  11. Start Pikeyd: sudo /usr/local/etc/init.d/pikeyd start

  12. Configure Slimmer. sudo vi /usr/local/etc/slimmer.conf My config is OPTIONS="--lmshost 192.168.1.2 --lmsport 9002 --input /dev/pikeyd --volume 100 --encoding ISO-8859-2" Execute slimmer --help to see the possible options.

  13. Start Slimmer: sudo /usr/local/etc/init.d/slimmer start Slimmer should be working now.

  14. Add the config files to the backup list:

    cat >> /opt/.filetool.lst << EOF
    usr/local/etc/pikeyd.conf
    usr/local/etc/LCDd.conf
    usr/local/etc/slimmer.conf
    EOF
    
  15. Enable install at boot:

    cat >> /mnt/mmcblk0p2/tce/onboot.lst << EOF
    lcdproc-server.tcz
    pikeyd.tcz
    slimmer.tcz
    EOF
    
  16. Enable start at boot:

    cat >> /opt/bootlocal.sh << EOF
    /usr/local/etc/init.d/lcdproc-server start
    /usr/local/etc/init.d/pikeyd start
    /usr/local/etc/init.d/slimmer start
    EOF
    
  17. Save the config files: sudo filetool.sh -b

  18. Reboot: sudo reboot Do not turn the power off without rebooting after configuration changes!

Troubleshooting tips

Testing pikeyd and the connected encoder and buttons

With evtest you can monitor the generated keyboard events:

tce-load -iwl evtest
evtest /dev/pikeyd

Slimmer watches only the following keys: KEY_BACKSPACE, KEY_LEFT, KEY_RIGHT, KEY_ENTER and KEY_SPACE.

Rotary encoder is working in reverse

Just swap the key codes (KEY_LEFT, KEY_RIGHT) in pikeyd.conf.