Hi all,

I posted this on the Tiny Core forums, but thought I'd include it here
too as it's based around piCorePlayer.

I just managed to get ShairPort installed on my piCorePlayer
installation.

By configuring ALSA to use the dmix (direct mixing) plugin, I now have
both apps working without stepping on each others toes.

To test the 'worst case' scenario, I've been playing music through both
apps at the same time, and it's producing the mixed output from both
sources. It's been playing for a few hours now, so it's looking really
promising. I will test it more over the next few days, trying different
scenarios.

In any case, I've included the steps below in case anyone else finds
this useful. I really hope it works flawlessly, as I'd love to have my
SqueezeBox-based players also support direct streaming from Airport
devices.

In my setup, I'm using a Behringer UCA202 USB DAC, but I believe these
steps will work with any USB DAC, as long as it's the default ALSA
device.

Cheers,
Pete


PREPARATION

Burn the piCorePlayer image to the SD card:
https://sites.google.com/site/picoreplayer/

Expand the second partition:
(refer to the 'System with pre-installed extensions' section)
http://distro.ibiblio.org/tinycorelinux/5.x/armv6/releases/README

Install nano:

Code:
--------------------
    tce-load -wi nano
--------------------



SHAIRPORT

Install shairport:

Code:
--------------------
    tce-load -wi shairport
--------------------


Create the shairport script:

Code:
--------------------
    sudo nano /usr/local/etc/init.d/shairport
--------------------


Add the following to the shairport script:


Code:
--------------------
    #! /bin/sh
  # /usr/local/etc/init.d/shairport
  #
  NAME="piCorePlayer"
  
  case "$1" in
  start)
  /usr/local/bin/shairport -d -a "$NAME" -b 95
  ;;
  stop)
  killall shairport
  ;;
  *)
  echo "Usage: /usr/local/etc/init.d/shairport {start|stop}"
  exit 1
  ;;
  esac
  
  exit 0
--------------------


Set the execute permissions for the shairport script:

Code:
--------------------
    sudo chmod a+x /usr/local/etc/init.d/shairport
--------------------


Configure the boot script to run the shairport script on startup:

Code:
--------------------
    sudo nano /opt/bootlocal.sh
--------------------


Add this line to the bottom of the boot script:

Code:
--------------------
    /usr/local/etc/init.d/shairport start
--------------------


Add the shairport script to the backup file list (to ensure it gets
persisted between reboots):

Code:
--------------------
    sudo nano /opt/.filetool.lst
--------------------


Add this line to the bottom of the backup file list:

Code:
--------------------
    usr/local/etc/init.d/shairport
--------------------



ALSA MIXER

Configure the mixer to ensure multiple apps can share the sound device:

Code:
--------------------
    sudo nano /etc/asound.conf
--------------------


Remove or comment out the original lines in the file, and add the
following:


Code:
--------------------
    pcm.!default {
  type plug
  slave.pcm "dmixer"
  }
  
  pcm.dsp0 {
  type plug
  slave.pcm "dmixer"
  }
  
  pcm.dmixer {
  type dmix
  ipc_key 1024 # the key must be unique
  ipc_key_add_uid 0
  ipc_perm 0666# permissions - octal notation
  slave {
  pcm "hw:0,0"
  period_time 0
  period_size 1024
  buffer_size 8192
  rate 48000 #or 44100
  }
  }
  
  ctl.dmixer {
  type hw
  card 0
  }
--------------------


Set the volume to maximum:

Code:
--------------------
    sudo alsamixer
--------------------


Code:
--------------------
    sudo alsactl store
--------------------



SQUEEZELITE

Set Squeezelite to use the default ALSA audio device (to ensure the ALSA
mixer get used):

Code:
--------------------
    sudo nano /usr/local/sbin/config.cfg
--------------------


Comment out the first line below, and add the second line:

Code:
--------------------
    #OUTPUT="sysdefault:CARD=ALSA"
  OUTPUT="default"
--------------------


-(Note: the above change can also be done via the piCorePlayer web page,
under Squeezelite Settings > Output settings)-


SAVE CHANGES

Ensure the changes are persisted between reboots:

Code:
--------------------
    sudo filetool.sh -b
--------------------


Reboot the device:

Code:
--------------------
    sudo reboot
--------------------


------------------------------------------------------------------------
petar's Profile: http://forums.slimdevices.com/member.php?userid=50217
View this thread: http://forums.slimdevices.com/showthread.php?t=97803

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to