Welcome! Log In Create A New Profile

Advanced

Howto: Airplay on a Pogoplug

Posted by ubermacin 
Howto: Airplay on a Pogoplug
February 01, 2014 10:51PM
I don't know how many folks know about (or might care about) running an airplay service on their plug. I have an E02 (Pink) pogoplug with wheezy installed and I stumbled on this tutorial for a pi:Raspberry Pi Airplay Tutorial. It was pretty close to what I needed to get started. I first purchased this Syba USB sound card for about $8.50 (price changes though). The tutorial above is very well done, here is the process I followed:

apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils libmodule-build-perl make libavahi-client-dev libasound2-dev build-essential pkg-config alsa-utils
git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
cd perl-net-sdp
perl Build.PL
sudo ./Build
sudo ./Build test
sudo ./Build install
cd ..
git clone https://github.com/hendrikw82/shairport.git
cd shairport
make

At this point, everything is basically installed, lets first set the volume (mine was defaulted to max)

alsamixer

left and right to change which part your changing, up and down to set (I set my mic to 0 and main to 20). Esc will save the settings. Plug in speakers and lets test it:

./shairport.pl -a Pogoplay

Now you should be able to airplay to the pogo plug (of course, you can change the name from Pogoplay to whatever you wish).

Ctrl-c will end it once you have tested it. I continued to follow the tutorial above to have the shairport script run on startup:

make install
sudo cp shairport.init.sample /etc/init.d/shairport
cd /etc/init.d
chmod a+x shairport
update-rc.d shairport defaults
nano shairport

In that last script, change the following line to include -a Pogoplay

DAEMON_ARGS="-w $PIDFILE -a Pogoplay"

Ctrl-x, yes, and you will be ready to go! You will have to run the script manually the first time, and then should load automatically at each boot.

/etc/init.d/shairport start

Thanks again to Adam Burkepile from the tutorial linked at the beginning, I really only had to tweak a few small things to make it work on mine.



Edited 1 time(s). Last edit at 06/12/2015 10:47PM by ubermacin.
Re: Howto: Airplay on a Pogoplug
May 26, 2017 07:35PM
Has anyone managed to do something like this except using the newer and supported Shairport-Sync? I'd like to be able to use the Pogoplug Pro as an airplay receiver amongst other things.

Edit: I've got this working at least at a base level. There are a lot of options in the settings and compiling stage for shairport-sync. I'll try to write up a tutorial.



Edited 1 time(s). Last edit at 05/27/2017 09:26AM by cdlenfert.
Attachments:
open | download - airplay-pogo.jpg (23.6 KB)
Re: Howto: Airplay on a Pogoplug
May 31, 2017 08:33PM
Cool! It's funny, I just found a few pogo plugs in my basement I had with this setup. I think a few years ago I had a power outage and of course, the partitions crashed. I never fooled around with fixing them. I'd be interested to see what you come up with though. I wanted to get wheezy into read-only mode to keep it from that problem
Re: Howto: Airplay on a Pogoplug
May 31, 2017 10:37PM
Oh nice. I didn't know you could set up a read only mode for Wheezy. For a dedicated device like an airplay speaker that makes a lot of sense. I managed to tweak settings a bit and make the volume control a lot better. In my testing the Pogoplug hasn't dropped a stream nearly as much as my old original airport express (1st gen wireless G model)
Re: Howto: Airplay on a Pogoplug
May 31, 2017 11:21PM
cdlenfert Wrote:
-------------------------------------------------------
> Oh nice. I didn't know you could set up a read onl
> y mode for Wheezy. For a dedicated device like an
> airplay speaker that makes a lot of sense. I manag
> ed to tweak settings a bit and make the volume con
> trol a lot better. In my testing the Pogoplug hasn
> 't dropped a stream nearly as much as my old origi
> nal airport express (1st gen wireless G model)

You don't need make a read-only rootfs. Use Ext3 or Ext4 file system and it will survive all power outages.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Howto: Airplay on a Pogoplug
June 01, 2017 09:54AM
Thanks bodhi. Good to know.

Here's my guide for shairport-sync

A majority of the steps are available at the github page (link below), but steps for multiple platforms are provided and it can get confusing on which ones to follow. Here’s what you need to do to get shairport-sync running on a PogoPlug Pro running Debian Wheezy and a cheap usb sound card (specifically this one - http://amzn.to/2rokplS)
https://github.com/mikebrady/shairport-sync

apt-get install build-essential git xmltoman
apt-get install autoconf automake libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev
apt-get install avahi-daemon libavahi-client-dev


There are some additional installs for things like encryption and libsoxr-based resampling. I don’t think I need these, and don’t really know what resampling is??

git clone https://github.com/mikebrady/shairport-sync.git

cd shairport-sync

autoreconf -i -f


There are a lot of options for how you compile shairport-sync, here are the ones I’ve elected to use (metadata and pipe are optional):

./configure --with-alsa --with-avahi --with-metadata --with-systemv —with-pipe

make

sudo make install

sudo update-rc.d shairport-sync defaults 90 10


Configuring shairport-sync

cd /etc

nano shairport-sync.conf


By default shairport-sync will use the devices hostname, let’s change it! (optional)
under “general” find “name =…”
uncomment by removing the // and add your desired name in the parenthesis removing %H

Look for the option “mixer_control_name”, if you have my same sound card, uncomment this line and enter “Speaker” in the parenthesis.
If you have a different sound card run command “alsamixer” and look at the name of column on the left. Mine says “Speaker” but yours could say “PCM” or something else entirely. Use this name for “mixer_control_name”.

Start shairport-sync

/etc/init.d/shairport-sync restart


Now go forth and Airplay everything! shairport-sync should start automatically on a reboot (takes a minute or two).
Re: Howto: Airplay on a Pogoplug
June 01, 2017 11:59AM
cdlenfert ,

> Here's my guide for shairport-sync

Cool! thanks for your contribution, I will add this to the Wiki thread.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Howto: Airplay on a Pogoplug
June 01, 2017 01:58PM
If you're using Debian Jessie shairport-sync is available in jessie-backports.

Ray
Re: Howto: Airplay on a Pogoplug
June 01, 2017 04:41PM
Thanks Ray! That would have been nice to know when I set it up on my Pi Zero. On the main git page it says it would be back ported to Jessie if there was enough interest. I guess they had enough interest.
Re: Howto: Airplay on a Pogoplug
January 19, 2018 05:49PM
I've been trying to get shairport-sync running on my Pogo Pro running on Stretch. I initially came up against a 16mb limit during the install. Resolved by this thread - https://forum.doozan.com/read.php?2,34313

After removing and re-installing shairport-sync via:
apt-get install shairport-sync

Everything looked to go smoothly. And here is the status.
root@debian:~# systemctl status shairport-sync
● shairport-sync.service - ShairportSync AirTunes receiver
   Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-01-19 15:37:48 PST; 12s ago
     Docs: man:shairport-sync(7)
           file:///usr/share/doc/shairport-sync/README.md.gz
           https://github.com/mikebrady/shairport-sync
  Process: 1870 ExecStart=/usr/bin/shairport-sync --daemon $DAEMON_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 1872 (shairport-sync)
   CGroup: /system.slice/shairport-sync.service
           └─1872 /usr/bin/shairport-sync --daemon

Jan 19 15:37:48 debian systemd[1]: Starting ShairportSync AirTunes receiver...
Jan 19 15:37:48 debian systemd[1]: Started ShairportSync AirTunes receiver.

However if I run "top" I don't see shairport-sync running anywhere. But if I run "htop" it's at the top of the list

My thought was maybe I didn't have the config right and the Alsa output device wasn't correct. I went to check that by running:
alsamixer
Only to find out that it wasn't installed. I don't know much about Alsa. The mixer was available but default under Wheezy I think. I tried installing alsa-utils and still no mixer, but the following worked to check for the USB sound card:
root@debian:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Restarting shairport-sync doesn't seem to have any effect either
systemctl restart shairport-sync

Any ideas would be appreciated.
Re: Howto: Airplay on a Pogoplug
March 19, 2018 12:08PM
Updating with what I discovered today. Previously the Pogo was never available as an airplay endpoint (speaker) on my network. I went into the shairport-sync config file and set it up to output audio to a named pipe and configured the path to that pipe. Once I saved the config, I was able to get shairport-sync to start successfully and now see my PogoPlug in the list of airplay devices.

Still need to figure out what the issue was with the alsa device and not being able to use that output method.
Re: Howto: Airplay on a Pogoplug
May 04, 2018 09:31AM
Finally figured out that the output device I was using was incorrect. I had thought it was hw:0, but it was really hw:1,0

alsa =
{
  output_device = "hw:1,0";

This got audio to output through Shairport-Sync to my cheapo USB sound card. I still don't know how to get audio control from the Pogo side of things without Alsamixer, but that can wait.
Re: Howto: Airplay on a Pogoplug
May 04, 2018 05:02PM
cdlenfer,

> This got audio to output through Shairport-Sync
> to my cheapo USB sound card. I still don't know
> how to get audio control from the Pogo side of
> things without Alsamixer, but that can wait.

Try amixer and alsamixer. The command name is all lơwercase.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 05/04/2018 09:22PM by bodhi.
Re: Howto: Airplay on a Pogoplug
May 08, 2018 10:23PM
Haven't had much luck in troubleshooting. On Wheezy it worked out of the gate.

root@debian:~# alsamixer
cannot open mixer: No such file or directory
root@debian:~# amixer
amixer: Mixer attach default error: No such file or directory
root@debian:~# 
Re: Howto: Airplay on a Pogoplug
May 09, 2018 04:05AM
cdlenfert,

I am running Debian jessie on the HP T5325 box.

root@T5325:~# uname -a
Linux T5325 4.16.1-kirkwood-tld-1 #1 PREEMPT Mon Apr 9 00:51:18 PDT 2018 armv5tel GNU/Linux


root@T5325:~# cat /etc/apt/sources.list
deb http://ftp.us.debian.org/debian jessie main
deb http://security.debian.org/ jessie/updates main contrib non-free

deb     http://http.debian.net/debian jessie-updates main contrib
deb-src http://http.debian.net/debian jessie-updates main contrib


root@T5325:~# amixer 
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 15 [48%] [-24.00dB] [on]
  Front Right: Playback 14 [45%] [-25.50dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 22 [71%] [-13.50dB] [on]
  Front Right: Playback 22 [71%] [-13.50dB] [on]
Simple mixer control 'Speaker Mix AUXI2SPK',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Speaker Mix DAC2SPK',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Speaker Mix LI2SPK',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Speaker Mix MIC12SPK',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Speaker Mix MIC22SPK',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'SpeakerOut Mux',0
  Capabilities: enum
  Items: 'Vmid' 'HPOut Mix' 'Speaker Mix' 'Mono Mix'
  Item0: 'Vmid'
Simple mixer control 'SpeakerOut N Mux',0
  Capabilities: enum
  Items: 'RN/-R' 'RP/+R' 'LN/-R' 'Vmid'
  Item0: 'Vmid'
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 22 [71%] [-1.50dB]
  Front Right: Playback 22 [71%] [-1.50dB]
Simple mixer control 'LineIn',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 23 [74%] [0.00dB]
  Front Right: Capture 23 [74%] [0.00dB]
Simple mixer control 'Mic 1 Boost',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 2
  Mono: 1 [50%] [20.00dB]
Simple mixer control 'Mic 2 Boost',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 2
  Mono: 1 [50%] [20.00dB]
Simple mixer control 'Mic1',0
  Capabilities: cvolume cvolume-joined
  Capture channels: Mono
  Limits: Capture 0 - 31
  Mono: Capture 23 [74%] [0.00dB]
Simple mixer control 'Mic2',0
  Capabilities: cvolume cvolume-joined
  Capture channels: Mono
  Limits: Capture 0 - 31
  Mono: Capture 23 [74%] [0.00dB]
Simple mixer control 'AuxI',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 23 [74%] [0.00dB]
  Front Right: Capture 23 [74%] [0.00dB]
Simple mixer control 'AuxOut Mux',0
  Capabilities: enum
  Items: 'Vmid' 'HPOut Mix' 'Speaker Mix' 'Mono Mix'
  Item0: 'Mono Mix'
Simple mixer control 'Auxout',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 22 [71%] [-13.50dB] [on]
  Front Right: Playback 22 [71%] [-13.50dB] [on]
Simple mixer control 'Mono Mix ADC2MONO_L',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Mix ADC2MONO_R',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Mix AUXI2MONO',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Mix DAC2MONO',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Mix LI2MONO',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Mix MIC12MONO',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mono Mix MIC22MONO',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'AB-D Amp Mux',0
  Capabilities: enum
  Items: 'AB Amp' 'D Amp'
  Item0: 'AB Amp'
Simple mixer control 'Digital Boost',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 3
  Mono: 2 [67%] [12.00dB]
Simple mixer control 'HP Mix AUXI2HP',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'HP Mix DAC2HP',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'HP Mix LI2HP',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'HP Mix MIC12HP',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'HP Mix MIC22HP',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'HPL Mix ADC2HP_L',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'HPR Mix ADC2HP_R',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Left Capture Mix HPMixerL',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Capture Mix Left AuxI',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Capture Mix LineInL',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Capture Mix Mic1',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Capture Mix Mic2',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Capture Mix MonoMixer',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Capture Mix SPKMixer',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Left Headphone Mux',0
  Capabilities: enum
  Items: 'Vmid' 'HP Left Mix'
  Item0: 'Vmid'
Simple mixer control 'Rec',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 11 [35%] [0.00dB]
  Front Right: Capture 11 [35%] [0.00dB]
Simple mixer control 'Right Capture Mix HPMixerR',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Capture Mix LineInR',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Capture Mix Mic1',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Capture Mix Mic2',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Capture Mix MonoMixer',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Capture Mix Right AuxI',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Capture Mix SPKMixer',0
  Capabilities: cswitch cswitch-joined
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Right Headphone Mux',0
  Capabilities: enum
  Items: 'Vmid' 'HP Right Mix'
  Item0: 'HP Right Mix'

alsamixer also brought up the GUI for amixer.

So I'd say look at dmesg to see if your USB sound device was initialized successfully.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 05/09/2018 04:07AM by bodhi.
Re: Howto: Airplay on a Pogoplug
May 09, 2018 09:59AM
Pogo is definitely aware of the USB sound card. I've been able to get audio to play through it and it shows up when I:
root@debian:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And yet
root@debian:~# amixer
amixer: Mixer attach default error: No such file or directory

So I try re-installing alsa-utils
root@debian:~# apt-get install alsa-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
alsa-utils is already the newest version (1.1.3-1).

Thanks to Google I found a command that works to open the mixer as I think it goes straight to card 1 (my USB card in this case)
alsamixer -c 1

I used this command to see if the root user was part of the audio group (root is not in the audio group)
root@debian:~# id -Gn "root"|grep -c "audio"

I added root to the audio group but alsamixer command had no change
root@debian:~# usermod -a -G audio root

So the problem with simply running alsamixer is that there is no default sound device. We need to list the devices, get the card number:
aplay -l

Then create/edit the alsa configuration file at /etc/asound.conf, and paste these lines:
pcm.!default {
    type hw
    card 0
}

ctl.!default {
    type hw           
    card 0
}
but changing card 0 to the card number of your sound device (1 in my case).

Use alsamixer to double check that the default has been set correctly. Worked for me!



Edited 1 time(s). Last edit at 05/09/2018 09:59AM by cdlenfert.
Re: Howto: Airplay on a Pogoplug
May 09, 2018 11:57PM
Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Howto: Airplay on a Pogoplug
December 31, 2019 10:03AM
Continuing on with this project I recently got an Echo Flex for Christmas. As far as Amazon Echo devices go, this one is pretty interesting. It plugs directly into the wall, has a small integrated speaker for voice responses, as well as an AUX (audio output) 3.5mm jack and a USB port.

I'm planning to use this in my garage and want to route the AUX out from the Flex to the Mic input on the Pogoplug's USB DAC. The idea then is to capture the audio from the Flex and play it through the output of the USB DAC.

So that Shairport-sync (airplay receiver) and the Aux in setup play nice together I'm wanting to utilize a couple of config options within Shairport-sync that can run scripts when playback starts and when playback ends.

Basically this is the formula:
  1. Default to Mic capture so I can request music from the Flex and hear it on my speakers
  2. When playing to Shairport-sync (pogoplug via airplay) kill the Mic capture/playback
  3. When done playing to Shairport-sync start the Mic capture again

I found a guide that is doing pretty much this - https://www.hifiberry.com/docs/projects/airplay-player-with-line-input/

However I'm stuck trying to get Shairport-sync to run my capture start and capture stop scripts. I know it's most likely a permissions issue but I've tried totally opening up permissions on the file (777) and it shairport-sync still isn't running the scripts.

The Permissions
root@pogoplugpro:~/shScripts# ls -l
total 20
drwxrwxrwx 2 root root 4096 Dec 29 14:27 .
drwx------ 6 root root 4096 Dec 29 20:06 ..
-rwxrwxrwx 1 root root  104 Dec 29 13:56 shairportend.sh
-rwxrwxrwx 1 root root  118 Dec 29 13:57 shairportfade.sh
-rwxrwxrwx 1 root root   41 Dec 29 14:24 shairportstart.sh

The Scripts contents:
root@pogoplugpro:~/shScripts# cat shairportstart.sh 
#!/bin/sh
/usr/bin/pkill arecord&
exit 0

root@pogoplugpro:~/shScripts# cat shairportend.sh 
#!/bin/sh
/usr/bin/arecord -D plughw:CARD=Set -f dat | /usr/bin/aplay -D plughw:CARD=Set -f dat&
exit 0

If I run them manually they work as expected (I think).
root@pogoplugpro:~/shScripts# bash -x shairportend.sh 
+ exit 0
root@pogoplugpro:~/shScripts# + /usr/bin/arecord -D plughw:CARD=Set -f dat
+ /usr/bin/aplay -D plughw:CARD=Set -f dat
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

root@pogoplugpro:~/shScripts# bash -x shairportstart.sh 
+ exit 0
root@pogoplugpro:~/shScripts# + /usr/bin/pkill arecord

And the result on the running shairportend.sh script when testing the shairportstart.sh script (this should result in the recording process being killed)
root@pogoplugpro:~/shScripts# + /usr/bin/arecord -D plughw:CARD=Set -f dat
+ /usr/bin/aplay -D plughw:CARD=Set -f dat
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
root@pogoplugpro:~/shScripts# Aborted by signal Terminated...

Shairport-sync uses a user and group of "shairport-sync:shairport-sync"

However I can't do a 'su shairport-sync' to test things as this user because I get 'This account is currently not available'.

Do I need to make the shairport-sync user/group the owner of these scripts? Permissions and file paths seem to be my general weak points :)

Assuming I can get this working I'm curious if there's a better approach to getting this record command to run other than adding it to '/etc/rc.local'? I've used a program called cpiped in the past to capture mic input conditionally which is nice (capture when sound is detected, stop when silence is detected on the mic input), however I'm not sure if there is a way to tell ALSA to play from a pipe, or to tell cpiped to output to a different file type (whatever "dat" is).

Anyway thanks for reading and any tips on getting the last pieces in place. If I can get it working I'll write a more complete tutorial.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: