Tiny Core Base > Raspberry Pi

shairport, minidlna, mpd or mopidy for TC6?

<< < (8/11) > >>

aprilmayjune:

--- Quote from: lykkedk on April 20, 2015, 02:44:27 PM ---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.

--- End quote ---

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:

--- Code: ---/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

--- End code ---
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

aprilmayjune:

--- Quote from: aprilmayjune on April 24, 2015, 12:10:21 PM ---

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:

--- Code: ---/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

--- End code ---
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


--- End quote ---

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?


--- Code: ---echo 'xx:xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -

--- End code ---

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.


Greg Erskine:

--- Quote from: aprilmayjune on April 24, 2015, 01:05:32 PM ---
--- Quote from: aprilmayjune on April 24, 2015, 12:10:21 PM ---

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:

--- Code: ---/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

--- End code ---
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


--- End quote ---

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?


--- Code: ---echo 'xx:xx:xx:xx:xx:xx power 0' | socat tcp:10.0.1.XX:9090 -

--- End code ---

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.

--- End quote ---

hi aprilmayjune,

Thanks for posting your findings.

Here is the simplest command I can think of to do what you are suggesting.


--- Code: ---shairport -B "echo pause | nc 192.168.1.xxx 9090" -E "echo play | nc 192.168.1.xxx 9090" &
--- End code ---

192.168.1.xxx=your LMS IP

regards
Greg

lykkedk:
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.

Greg Erskine:

--- Quote from: lykkedk on April 25, 2015, 04:21:54 AM ---Do you and Steen use a persist /usr/local/etc/asound.conf in piCoreplayer, or nothing at all ?
--- End quote ---

hi lykkedk,

We just use a simple /etc/asound.conf. I am not sure it is really needed in most cases.


--- Code: ---pcm.!default {
type route
slave.pcm hw
}

--- End code ---

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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version