How can I stop a program when a movie starts and resume it when it's finished?
#1
I have set up several Squeezeplayers around the house and control them all via Ipeng. For who doesn't know: Squeezeplayers are software audio streaming players that work with the Logitech Squeezebox system. There is a server, wich you actually controll remotely, that sends audio-streams to your various clients. Great, now I have a bunch of synced audio clients around my house and control them all from an ipod in my pocket (that's the Ipeng part).

In my living room there naturely is an xbmc. Since it is connected to a beamer, I really don't want to turn that one on for browsing music. There is a simple daemon - squeezeslave - that plays the audio just fine and in sync with the other squeezeplayers. If I put squeezeslave in my rc.local it comes up fine and I can hear music and don't need any monitor.

If now I want to watch a movie, I get an audio device error, since the daemon blocks the audio interface no mater if music is playing or not. What I am looking for is a way to gently end squeezeslave when I start a movie and to restart it after having stopped the movie (or better after a certain time, I might want to see another one.).

Does anyone have an idea how I could achieve this? Using a different audio output is no option, because I want to use HDMI for audio as well.
Reply
#2
There is caffeine but it is specific to screensavers/power saving daemons. Dunno about your situation.
Need help programming a Streamzap remote?
Reply
#3
If I only knew more about the internals of xbmc... I just got it to change refresh rates according to the content, so that is actually the right moment... Used a guide and a script to set it up, though..
Reply
#4
you'll need to alter the skin xml to launch a script that will send stop command to syour squeeze program then launch the movie.
Reply
#5
Could you be a bit more specific? I did a search in / for "*skin*.xml" and found:
/home/xbmc/.xbmc/addons/script.cdartmanager/resources/skins/Default/skin.xml
/home/xbmc/.xbmc/addons/script.xbmc.subtitles/resources/skins/Default/skin.xml
/home/xbmc/.xbmc/addons/script.cu.lyrics/resources/skins/Default/skin.xml

No default skin?

I am in no way a coder, so I'd need further help here Sad
Reply
#6
no skins are made of more than one xml !
if you don't know this kind of things, you'd better learn how a skin work before trying to do this modification, also you'll need to write the python code to do the behave you want.
Reply
#7
I don't understand: I find three skins: CDArts, Subtitles and Lyrics. These look like sub-parts of something. Where is the default skin, like the entire xbmc GUI?

Anyway, I am very bad with coding, so learning to write a python script will not work.

I was hoping for a very simple solution. sqeezeslave itself is ver simple to launch: /usr/local/bin/squeezeslave -M -o2 atom
That's it already. -M daemonizes, -02 chooses the hdmi audio aoutput and atom is the host running the squeezebox server.

Hmm, what now?
Reply
#8
I wonder if altering your command line to use padsp might work:

/usr/bin/padsp /usr/local/bin/squeezeslave -M -o2 atom

Using pulseaudio might fix the blocking problem. Just a thought, I have no way to test this.
Reply
#9
Too bad, when installing, I disabled pulseaudio somewhere globally. I think to remember there was an issue with it not working in the ubuntu 10.10 release. I'd rather stick with my alsa setup. It tookk quite a while to make it work flawlessly. Also I wonder, what would happen if a playing pcm-stream would meet a ac3-passthrough, surely something nasty.. Also there is mostly music playing in the kitchen and bathroom, while someone wants to watch a movie, so it's necesary to disable squeezeplay before launching a movie.
Reply
#10
just take a lot at your skin directory, there's plenty of xml, not just skin.xml, all these xml are for the skin.
Reply
#11
Well, before I'd figure out by myself how to achieve what I wanted, I'd have to understand what is happening. I quickly checked some of the files and must say: No chance for me in any forseeable time. If noone can point me to the exact line in a file and tell me what to put in there, I'll just have to give up. I can see that it looks rather simple to you, since you seem to be a skilled python coder, but for me it's too cryptic. I kow my way around linux administration a little and I get some things to compile, but messing around in the code on my own would only lead to disaster... Wink
Reply
#12
we've all started that at a time.
i've strated python in june 2009 Wink

the better way to understand is to see what others have done, then try, retry , retry ...

Big Grin

you have a good community behind.
Reply
#13
Whoo, thx for trying to encourage me, but I have been down that road before with C, the shell and python, too. It's just not for me, all the way to cryptic. I used to write shell scripts by myself but it always took ages to debug all the little typos and such.. I am not afraid to edit things, if I know what to do, but challenging the xbmc skin blindly won't do any good..
Reply
#14
So... for now I solved it with lirc and irexec, so the player starts up with xbmc and I have to press a ertain btton on my remote to turn it off or on again. Not very nice but working..
Reply
#15
((( atom ))) Wrote:So... for now I solved it with lirc and irexec, so the player starts up with xbmc and I have to press a ertain btton on my remote to turn it off or on again. Not very nice but working..

Just as an idea. Could you just bring up xbmc with a script instead of directly with the command? And in that script, before calling xbmc you could kill the daemon, and after closing again xbmc, bring the daemon up again?

Might that work?
Reply

Logout Mark Read Team Forum Stats Members Help
How can I stop a program when a movie starts and resume it when it's finished?0