Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: ingotee on March 19, 2015, 01:05:40 PM
-
Hello,
I put an RPi inside a JVC Boomblaster, replacing the cassette player.
Now I would like to run an airplay and a dlna sink and maybe mpd/mopidy on it - but it should be tolerant to the power being cut off. So I think, Tiny Core Linux would be a great choice.
Now I realize that neither shairport nor minidlna nor mpd/mopidy are available as TCZs for TC6. I will try and build them myself, but since I haven't dealt with piCore before, this looks like a long shot :-)
So if anybody has built any of them as tczs and just not submitted them, for whatever reason - please drop me a line.
Thanks!
Ingo
-
shairport added to repo. I did not test it, just packed. Please try and report wheter it works or not.
-
Thank you VERY much. It works like a charm!
-
minidlna added to repo. I did not test it, just packed. Please try and report wheter it works or not
-
It starts, but I am not in the office right now, so I cannot test it yet. Will do so in an hour or so.
I really must learn this building process, all the library names and stuff. I spent several hours on trying to build those two daemons last night with no success. mopidy was even more puzzling, without pip and some other stuff.
Thank you VERY, VERY much, Béla!
Ingo
-
I did nothing special, just followed what was written in the source, make / make install and than packed to tcz. But after make install it must work. Missing tools and libs can cause a problem.
-
I am stumped. I realized that I need media render, too.
I downloaded the source, ran ./configure.
It complained that it needed lo pump.
So I got that source and built it with no problems. Before packaging it I just installed it with make install so that I could check if it would help me with gmediarender. But ./configure still fails, although the headers are in /usr/local. ./configure --prefix=/usr/local didn't help either.
What am I missing?
-
I should not post from an iPhone with autocorrect on. I cannot always see what I am typing. I tried to build gmediarender and libupnp :-)
Here's an excerpt of config.log
configure:5292: checking upnp.h usability
configure:5304: gcc -c -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes
-Wmissing-declarations -I/usr/include/upnp conftest.c >&5
So I tried ./configure --includedir=/usr/local/include, where the upnp stuff is, but that changes nothing.
I guess I am really showing to be a newbie here, but I realld don't know what else to try to make gmediarender look in the right place.
-
Maybe you could try looking at config.log after you run ./configure and search for the error message associated with "pump" to give some clues as to what is the problem.
-
Thanks! "lo pump" was what autocorrect made of "libupnp".
| #include <upnp.h>
configure:5373: result: no
configure:5408: checking for upnp.h
configure:5415: result: no
configure:5514: result: not found
configure:5516: error: the upnp library is required to build and run this program
..and configure says it is looking in the right place:
## ----------------- ##
## Output variables. ##
## ----------------- ##
...
includedir='/usr/local/include'
-
It's looking in the right place, but is upnp.h present in /usr/local/include or /usr/local/include/upnp or /usr/local/include/libupnp?
-
Darn, you are so much smarter than I am :-\
/usr/local/include/upnp/upnp.h
-
..so if upnp.h is present, now you need to check where the configure script is looking for it and alter things to suit
-
thanks again. I googled a bit and I see that other people have had this issue before, albeit on other platforms. I'll see what I can make of it (no pun intended :) ) and then I'll report back.
-
Found it. gmediarender needs
--with-libupnp=/usr/local
because without it only /usr is prepended when looking for upnp.h.
This does not mean, that I am finished, though. Now it complains that I don't have GStreamer Development packages installed :-)
They are of course present and I'll continue searching there. Thanks for pointing me in the right direction!
-
I will dumping gmediarender - it just seems to be too old.
Trying the fork gmrender-resurrect next.
alas, it seems I still have a lot to learn.
tc@itGhetto2:~/gmedia/gmrender-resurrect$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: creating directory config
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/local/bin/autoconf --force
configure.ac:59: error: possibly undefined macro: AC_SUBST
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
-
Ok, consider this thread closed.
Thanks to Béla I have shairport and minidlna up and running.
I did not manage to build the seemingly obsolete gmediarender and the younger gmrender-resurrect.
But I managed to build mpd, although with a lot of the more exotic and some desirable plugins missing. I will try and make an mpd-minimal extension and submit it to Béla.
And then I will have a shot at a plugin for mpd that makes it a upnp/dlna renderer. I'll cover that in a separate thread.
Thanks for all the help and for being patient with my dumb questions while I am still learning.
Cheers,
Ingo
-
Hi Ingo
in the mean time added mpd.tcz to the repo, please try. It is built with all features aavailable with current repo.
Minimal version welcome!
Béla
-
Béla, you are just great. I will check out your mpd and try and build a mininmal one, too.
-
Hi all,
First of all, a big thank you to Bela for getting ShairPort into the repo.
I just managed to get ShairPort installed on my piCorePlayer installation, which already has Squeezelite running on it.
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/ (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 (http://distro.ibiblio.org/tinycorelinux/5.x/armv6/releases/README)
Install nano:
tce-load -wi nano
ShairPort
Install shairport:
tce-load -wi shairport
Create the shairport script:
sudo nano /usr/local/etc/init.d/shairport
Add the following to the shairport script:
#! /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:
sudo chmod a+x /usr/local/etc/init.d/shairport
Configure the boot script to run the shairport script on startup:
sudo nano /opt/bootlocal.sh
Add this line to the bottom of the boot script:
/usr/local/etc/init.d/shairport start
Add the shairport script to the backup file list (to ensure it gets persisted between reboots):
sudo nano /opt/.filetool.lst
Add this line to the bottom of the backup file list:
usr/local/etc/init.d/shairport
ALSA Mixer
Configure the mixer to ensure multiple apps can share the sound device:
sudo nano /etc/asound.conf
Remove or comment out the original lines in the file, and add the following:
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:
sudo alsamixer
sudo alsactl store
Squeezelite
Set Squeezelite to use the default ALSA audio device (to ensure the ALSA mixer get used):
sudo nano /usr/local/sbin/config.cfg
Comment out the first line below, and add the second line:
#OUTPUT="sysdefault:CARD=ALSA"
OUTPUT="default"
Save changes
Ensure the changes are persisted between reboots:
sudo filetool.sh -b
Reboot the device:
sudo reboot
-
Béla,
did you Compiler mpd with zeroconf enabled? It runs fine, but does not announce itself in the LAN. The shairport you built does announce itself.
Thanks!
Ingo
-
did you Compiler mpd with zeroconf enabled? It runs fine, but does not announce itself in the LAN. The shairport you built does announce itself.
No, something was missing as a dependency and had no time to look for, just built with available deps.
-
Hi all,
First of all, a big thank you to Bela for getting ShairPort into the repo.
I just managed to get ShairPort installed on my piCorePlayer installation, which already has Squeezelite running on it.
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.
Hi again,
I spoke too soon. After getting ShairPort and Squeezelite working together, I went to bed and in the morning noticed that both had stopped. Actually, ShairPort wasn't even running any longer.
Oh well, was worth a shot :-)
I see there is a fork of ShairPort called Shairport-Sync. Would it be possible to build this and add it to the repo?
https://github.com/mikebrady/shairport-sync (https://github.com/mikebrady/shairport-sync)
Cheers.
-
Can you provide details what happened to them?
-
FYI: The shairport extension that you built has been running flawlessy for more that 12 hours straight a couple of times on several RPis here.
-
Concerning Shairport-sync, wouldn't it be better if we could use Shairport on the Squeezeboxserver as an LMS plugin or a server source rather than re-invent the wheel to do all the same communication?
-
Concerning Shairport-sync, wouldn't it be better if we could use Shairport on the Squeezeboxserver as an LMS plugin or a server source rather than re-invent the wheel to do all the same communication?
I fully agree.
This seems like a much better way. By doing so the LMS would take care of the sync and you would be able to play through LMS to all connected devices. Also the trouble with dual use of the sound card will be avoided as all will be played through LMS (and squeezelite in the case of piCorePlayer).
There is a recipe here, the only trouble seem to be related to the fact that the plug-in needs to be build for each architecture where the LMS is running:
http://forums.slimdevices.com/showthread.php?100379-Announce-ShairTunes-Plugin
Regards
Steen
-
Tried installing shairport on a Raspberry Pi 2, but getting a 'not found' error for one the the pulseudio files. Below is the output.
Any ideas?
tc@piCorePlayer:~$ tce-load -iw shairport
libao.tcz.dep OK
Downloading: pulseaudio.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
md5sum: pulseaudio.tcz.md5.txt: No such file or directory
Error on pulseaudio.tcz
-
pulseaudio added to armv7 repo
Az én iPad készülékemről küldve a Tapatalk segítségével
-
Excellent. Thanks a lot for that bmarcus!
-
Concerning Shairport-sync, wouldn't it be better if we could use Shairport on the Squeezeboxserver as an LMS plugin or a server source rather than re-invent the wheel to do all the same communication?
I fully agree.
This seems like a much better way. By doing so the LMS would take care of the sync and you would be able to play through LMS to all connected devices. Also the trouble with dual use of the sound card will be avoided as all will be played through LMS (and squeezelite in the case of piCorePlayer).
There is a recipe here, the only trouble seem to be related to the fact that the plug-in needs to be build for each architecture where the LMS is running:
http://forums.slimdevices.com/showthread.php?100379-Announce-ShairTunes-Plugin
Regards
Steen
I've been slowly moving all my little computers to LMS and squeezelite from Mopidy/MPD, but everyone I know still uses airplay (including me!) so I've been trying integrate both sync systems. I've more or less got squeezelite and shairport-sync nailed down on my one Pi and two bay trail linux boxes. Shairport-sync and shairport have an option that sends commands when you start (-B) and when you stop (-E) airplaying. So that's what I do. After my device is chosen, once I click play, shairport sends a command to turn off the squeezelite player, then the music will airplay. When I'm done, i.e. a few moments after clicking pause, shairport sends a command that turns the squeezelite player back on. Works pretty well.
I just ordered myself a raspberry pi a+ and thought I'd try picoreplayer, but I couldnt figure out where to even begin to get shairport-sync installed until I found this post. I thought I'd try the shairtunes plugin option for LMS mentioned above despite not liking the idea that airplay wouldn't work if LMS was off. But after going through the mentioned thread, I saw that no one has figured out how to get shairtunes plugin to play on more than one device at a time! In other words, no syncing at all! Unless I completely read the thread incorrectly...
So anyways, I think it would still be helpful to have shairport-sync that runs on tinycore just to get that airplay syncing functionality that LMS still is unable to provide.
-
I've been slowly moving all my little computers to LMS and squeezelite from Mopidy/MPD, but everyone I know still uses airplay (including me!) so I've been trying integrate both sync systems. I've more or less got squeezelite and shairport-sync nailed down on my one Pi and two bay trail linux boxes. Shairport-sync and shairport have an option that sends commands when you start (-B) and when you stop (-E) airplaying. So that's what I do. After my device is chosen, once I click play, shairport sends a command to turn off the squeezelite player, then the music will airplay. When I'm done, i.e. a few moments after clicking pause, shairport sends a command that turns the squeezelite player back on. Works pretty well.
I just ordered myself a raspberry pi a+ and thought I'd try picoreplayer, but I couldnt figure out where to even begin to get shairport-sync installed until I found this post. I thought I'd try the shairtunes plugin option for LMS mentioned above despite not liking the idea that airplay wouldn't work if LMS was off. But after going through the mentioned thread, I saw that no one has figured out how to get shairtunes plugin to play on more than one device at a time! In other words, no syncing at all! Unless I completely read the thread incorrectly...
So anyways, I think it would still be helpful to have shairport-sync that runs on tinycore just to get that airplay syncing functionality that LMS still is unable to provide.
hi aprilmayjune ,
I have been playing with shairport.tcz on piCorePlayer and it seems to work well. I don't like your idea of having shairport a priority over squeezelite though. ;D
Note that shairport.tcz has a lot of dependencies.
Rather than have a specific shairport install procedure, we are currently looking at a piCore extension installatiosn via the web interface.
I would recommend you initially use piCorePlayer1.18b on your RPi A+. Getting the wireless to work on piCorePlayer1.19 is problematic. The fix is done, just not available yet.
regards
Greg
-
hi aprilmayjune ,
I have been playing with shairport.tcz on piCorePlayer and it seems to work well. I don't like your idea of having shairport a priority over squeezelite though. ;D
Note that shairport.tcz has a lot of dependencies.
Rather than have a specific shairport install procedure, we are currently looking at a piCore extension installatiosn via the web interface.
I would recommend you initially use piCorePlayer1.18b on your RPi A+. Getting the wireless to work on piCorePlayer1.19 is problematic. The fix is done, just not available yet.
regards
Greg
Greg,
Haha, I prefer using squeezelite over shairport-sync also, but tell that to a significant other when all she wants to do is play music quickly from her iphone. Airplay passes the girlfriend/wife test. iPeng and web ui is still a hard sell.
Squeezelite, for some reason, hogs the sound card even when not in use. That's the main reason I need to turn it off.
If you were to add the shairport install as a picore extension via webface, i think the shairport-sync fork (if available as tcz) would be a better choice basically because the original shairport is no longer being maintained. As James Laird says, he doesn't even use it himself anymore. Not to mention, it has that really great syncing feature. Regular shairport does tend to drift after a while. Picoreplayer would be the ultimate streamer then!
Is wireless an issue with just the A+ and picoreplayer 1.19 or picoreplayer 1.19 in general? I tested it on my Raspberry PI B and the wireless seemed to work ok.
Thank you!
-
Installed shairport.tcz on my A+ and I'm having some strange problems. After a while, the Airport player will disappear from ios and itunes selector. On my other pi, it usually just means that shairport crashed, but on the A+ shairport it is still running! Another strange thing too is that the airplay device will appear disconnected from itunes (orange airplay icon instead of blue) while the music is still playing through the A+! When I uncheck the device, it disappears from the list. Then the final strange thing is the device will randomly reappear.
-
Hi here.
I am playing with this shairport plugin for my squeezelite player.
I see, that when i use the .asound solution, for sharing both LMS server stream, and airplay, the CPU usage goes higher.
Look below:
Around 48% CPU usage with "default/.asoundrc"
/home/tc/squeezelite/squeezelite-armv6hf -z -a 80 4 -n PlayBox -m xxxxxxx 5E -s 192.168.1.1xx
Around 8% COU usage with "hw:CARD=D20"
/home/tc/squeezelite/squeezelite-armv6hf -z -a 80 4 -o hw:CARD=D20 -n PlayBox -m xxxxxxx 5E -s 192.168.1.1xx
Well, i was thinking that if it was possible to identificate, wheather some media connect to shairport, then i can kill squeezelite with my D20 CARD, and start it with default(.asoundrc) CARD. -This way, CPU will only be high when shairport is actually used.
Any hints :o Rgds; Jesper.
-
Hi here.
I am playing with this shairport plugin for my squeezelite player.
I see, that when i use the .asound solution, for sharing both LMS server stream, and airplay, the CPU usage goes higher.
Look below:
Around 48% CPU usage with "default/.asoundrc"
/home/tc/squeezelite/squeezelite-armv6hf -z -a 80 4 -n PlayBox -m xxxxxxx 5E -s 192.168.1.1xx
Around 8% COU usage with "hw:CARD=D20"
/home/tc/squeezelite/squeezelite-armv6hf -z -a 80 4 -o hw:CARD=D20 -n PlayBox -m xxxxxxx 5E -s 192.168.1.1xx
Well, i was thinking that if it was possible to identificate, wheather some media connect to shairport, then i can kill squeezelite with my D20 CARD, and start it with default(.asoundrc) CARD. -This way, CPU will only be high when shairport is actually used.
Any hints :o Rgds; Jesper.
Shairport allows you send commands before and after shairport starts working. I'm assuming for situations like yours.
I do something similar to this in the init.d file:
/usr/sbin/shairport -d -a "My Airplay" -w -B "echo 'xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -" -E "xx:xx:xx:xx:xx power 1' | socat tcp:10.0.1.XX:9090 -" -- -d hw:0
Fill in your MAC address and LMS ip address.
When you airplay something, it sends the power 0 command through socat (which you'll need to install). This powers off the squeezelite player which releases the dac/soundcard. After you're done airplaying (a few moments after you pause the music), squeezelite will turn back on. Now you won't need to mix the sound. I don't set .asoundrc on my Pi. I just tell shairport and squeezelite to look at the dac/sound card directly.
-B is used for the command when you begin airplaying.
-w waits before the command above to complete before airplaying
-E is used for the command after you're done airplaying
-
Shairport allows you send commands before and after shairport starts working. I'm assuming for situations like yours.
I do something similar to this in the init.d file:
/usr/sbin/shairport -d -a "My Airplay" -w -B "echo 'xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -" -E "xx:xx:xx:xx:xx power 1' | socat tcp:10.0.1.XX:9090 -" -- -d hw:0
Fill in your MAC address and LMS ip address.
When you airplay something, it sends the power 0 command through socat (which you'll need to install). This powers off the squeezelite player which releases the dac/soundcard. After you're done airplaying (a few moments after you pause the music), squeezelite will turn back on. Now you won't need to mix the sound. I don't set .asoundrc on my Pi. I just tell shairport and squeezelite to look at the dac/sound card directly.
-B is used for the command when you begin airplaying.
-w waits before the command above to complete before airplaying
-E is used for the command after you're done airplaying
I just wanted to edit my previous post, but doesn't look like I can. Anyways, the following part of the shairport init.d may not work. I'm not sure why. the quotes? how socat terminates?
echo 'xx:xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -
The way I do it on my pi is put the command in bash scripts and put that script locations in the begin (-B) and end (-E) sections. I didn't want to overcomplicate it, but I guess did.
-
Shairport allows you send commands before and after shairport starts working. I'm assuming for situations like yours.
I do something similar to this in the init.d file:
/usr/sbin/shairport -d -a "My Airplay" -w -B "echo 'xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -" -E "xx:xx:xx:xx:xx power 1' | socat tcp:10.0.1.XX:9090 -" -- -d hw:0
Fill in your MAC address and LMS ip address.
When you airplay something, it sends the power 0 command through socat (which you'll need to install). This powers off the squeezelite player which releases the dac/soundcard. After you're done airplaying (a few moments after you pause the music), squeezelite will turn back on. Now you won't need to mix the sound. I don't set .asoundrc on my Pi. I just tell shairport and squeezelite to look at the dac/sound card directly.
-B is used for the command when you begin airplaying.
-w waits before the command above to complete before airplaying
-E is used for the command after you're done airplaying
I just wanted to edit my previous post, but doesn't look like I can. Anyways, the following part of the shairport init.d may not work. I'm not sure why. the quotes? how socat terminates?
echo 'xx:xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -
The way I do it on my pi is put the command in bash scripts and put that script locations in the begin (-B) and end (-E) sections. I didn't want to overcomplicate it, but I guess did.
hi aprilmayjune,
Thanks for posting your findings.
Here is the simplest command I can think of to do what you are suggesting.
shairport -B "echo pause | nc 192.168.1.xxx 9090" -E "echo play | nc 192.168.1.xxx 9090" &
192.168.1.xxx=your LMS IP
regards
Greg
-
Thanks...
I will look into it :)
So, could you perhaps, make a followup on this, so it would be easier to archive 8)
Anyway, i use .asoundrc while i am puzzling with bluetooth streaming. -Havent actually got any sound yet, but bluez4 is working.
Greg Erskine :
Do you and Steen use a persist /usr/local/etc/asound.conf in piCoreplayer, or nothing at all ?
Rgds; Jesper.
-
Do you and Steen use a persist /usr/local/etc/asound.conf in piCoreplayer, or nothing at all ?
hi lykkedk,
We just use a simple /etc/asound.conf. I am not sure it is really needed in most cases.
pcm.!default {
type route
slave.pcm hw
}
We have been investigating a more complex asound.conf for mono, channel muting and channel swapping but it hasn't made it into the piCorePlayer yet.
regards
Greg
-
Thanks... Greg
Sent from my iPhone using Tapatalk
-
hi aprilmayjune,
Thanks for posting your findings.
Here is the simplest command I can think of to do what you are suggesting.
shairport -B "echo pause | nc 192.168.1.xxx 9090" -E "echo play | nc 192.168.1.xxx 9090" &
192.168.1.xxx=your LMS IP
regards
Greg
Hi Greg,
I use the "power 0" / "power 1" commands because squeezelite locks out the alsa dac/soundcard completely for squeezelite use only when it's the on state from what I've noticed. Power 0 sends two commands in sequence, power off then pause (or stop based on your settings). On raspbian, I was using nc but I noticed something weird. When running the command using echo piped to nc, it would power off the squeezelite but not do the second step of pausing. nc terminates before it has a chance to do the second step. I've tried adding the wait parameters, but nothing seemed to work. I had to eventually use the pylms perl script thing to send commands to lms.
I found later that nc isn't even available in tce. And installing pylms seemed like it would be a pain in picoreplayer. This is when I found socat. socat actually runs the power 0 completely before terminating. I still have to do it from a bash script though. I tried removing the single quotes, but still doesn't work.
-
Hi...
I still have to do it from a bash script though. I tried removing the single quotes, but still doesn't work.
Could you care to share them bash / sh scripts here... I am in for making something simmilair, and would like to see, how you do it ?
Rgds; Jesper.
-
Hi...
I still have to do it from a bash script though. I tried removing the single quotes, but still doesn't work.
Could you care to share them bash / sh scripts here... I am in for making something simmilair, and would like to see, how you do it ?
Rgds; Jesper.
No problem. It's more or less what I tried putting in the init.d script, but in the script it seems to work. I place this file in a /home/pi/scripts and call this one squeezeoff.sh. I create a similar one but with power 1 and call it squeezeon.sh.
Replace with your MAC address and LMS server ip.
#!/bin/sh
(echo "xx:xx:xx:xx:xx:xx power 0") | socat tcp:10.0.1.xx:9090 -
Then..
sudo chmod 755 /home/pi/scripts/squeezeoff.sh
Then in the init.d I use a line similar to this:
/usr/sbin/shairport -d -a "My Airplay" -w -B "/home/pi/scripts/squeezeoff.sh" -E "/home/pi/scripts/squeezeon.sh" -- -d hw:0
-
hi aprilmayjune,
Thanks for posting your findings.
Here is the simplest command I can think of to do what you are suggesting.
shairport -B "echo pause | nc 192.168.1.xxx 9090" -E "echo play | nc 192.168.1.xxx 9090" &
192.168.1.xxx=your LMS IP
regards
Greg
Hi Greg,
I use the "power 0" / "power 1" commands because squeezelite locks out the alsa dac/soundcard completely for squeezelite use only when it's the on state from what I've noticed. Power 0 sends two commands in sequence, power off then pause (or stop based on your settings). On raspbian, I was using nc but I noticed something weird. When running the command using echo piped to nc, it would power off the squeezelite but not do the second step of pausing. nc terminates before it has a chance to do the second step. I've tried adding the wait parameters, but nothing seemed to work. I had to eventually use the pylms perl script thing to send commands to lms.
I found later that nc isn't even available in tce. And installing pylms seemed like it would be a pain in picoreplayer. This is when I found socat. socat actually runs the power 0 completely before terminating. I still have to do it from a bash script though. I tried removing the single quotes, but still doesn't work.
hi aprilmayjun,
Thanks for the information on socat, I'll keep it in mine if I have a problem with nc.
The command I posted in the earlier post works fine. The audio stream from squeezelite stops and the shairport streams starts and visa versa. I must admit I have only tested it on analog out though. What is the extra requirement for using the power command?
nc has always been available in the version of piCore that I have used. No extra software to load. It's part of busybox.
regards
Greg
-
hi aprilmayjun,
Thanks for the information on socat, I'll keep it in mine if I have a problem with nc.
The command I posted in the earlier post works fine. The audio stream from squeezelite stops and the shairport streams starts and visa versa. I must admit I have only tested it on analog out though. What is the extra requirement for using the power command?
nc has always been available in the version of piCore that I have used. No extra software to load. It's part of busybox.
regards
Greg
Greg,
I'm not sure why I couldn't get nc working in picoreplayer. I'll have to try again. I've switched back to a miminized version of raspbian because tiny core was getting a little overwhelming for me! I love that picoreplayer can just be unplugged and nothing corrupts, but I also need shairport-sync so that's why I've moved back to raspbian.
I think the analog output does some kind of mixing. I remember once when I was playing squeezelite through the analog out on my A+ before I received my i2s dac, I tested sending something through shairport and both shairport and squeezelite played at the same time. With a separate dac and you've designated your dac in shairport and squeezelite (the "-- -d hw:0" parameter in shairport and "-o front:CARD=DAC,DEV=0" parameter in squeezelite), if the squeezelite player isn't off, Shairport won't work. The dac is locked out by squeezelite. I've read others complain about this also. Squeezelite will release the dac for other things to use like shairport or mpd or whatever once squeezelite power state is off.
I was also having issues with shairport.tcz just disappearing from my airplay list. I don't remember if avahi-daemon was installed as a dependency. I'm guessing that it makes it a little more reliable on macs at least?
-
hi aprilmayjun,
Thanks for the information on socat, I'll keep it in mine if I have a problem with nc.
The command I posted in the earlier post works fine. The audio stream from squeezelite stops and the shairport streams starts and visa versa. I must admit I have only tested it on analog out though. What is the extra requirement for using the power command?
nc has always been available in the version of piCore that I have used. No extra software to load. It's part of busybox.
regards
Greg
Greg,
I'm not sure why I couldn't get nc working in picoreplayer. I'll have to try again. I've switched back to a miminized version of raspbian because tiny core was getting a little overwhelming for me! I love that picoreplayer can just be unplugged and nothing corrupts, but I also need shairport-sync so that's why I've moved back to raspbian.
I think the analog output does some kind of mixing. I remember once when I was playing squeezelite through the analog out on my A+ before I received my i2s dac, I tested sending something through shairport and both shairport and squeezelite played at the same time. With a separate dac and you've designated your dac in shairport and squeezelite (the "-- -d hw:0" parameter in shairport and "-o front:CARD=DAC,DEV=0" parameter in squeezelite), if the squeezelite player isn't off, Shairport won't work. The dac is locked out by squeezelite. I've read others complain about this also. Squeezelite will release the dac for other things to use like shairport or mpd or whatever once squeezelite power state is off.
I was also having issues with shairport.tcz just disappearing from my airplay list. I don't remember if avahi-daemon was installed as a dependency. I'm guessing that it makes it a little more reliable on macs at least?
Thanks for the additional information aprilmayjune,
Lesson learnt! My test setup was too basic. Everything works first time and reliably using analog out. Changed over to a USB DAC and the wheels fell off. Sorta works, but nowhere good enough.
regards
Greg
-
I found later that nc isn't even available in tce
The BusyBox nc applet is part of the base. However it may happen that you need the original due to incompatibilites to BusyBox version. Just added netcat.tcz to armv6/armv7 repos, try.
-
I must have lost my mind. After I reinstalled picoreplayer, i saw that NC was in fact already there. I think i may have tried running it using "netcat" instead of "nc". But it worked out for the best because I never would have found socat.
-
Hello :)
My first post in this forum.
Hope to get some help resolving my problem.
I tried to install shairport on Raspi, but it doesnt work. What have i done:
- I first installed the piCorePlayer 1.19k from this site: https://sites.google.com/site/picoreplayer/home/news
That was no problem. Works fine.
- Not sure if i have really expand the second partition. So i tried to expand it to the maximum but i am not sure if this was correct. The Pi starts and the second partition was shown in the new size, so i think it was correct. But what does this mean? Means it, that the Linux will not work in only in RAM any more?
- Installed shairport with the steps on site 2. step by step.
- Does not work. After rebooting my iphone doesnt show me any AirPlay Player. Whats wrong and how can i find the error?
Can somebody help me please?
Thank you very much.
-
Thank you. :)
I think, i will use another workaround.