Apple remote starts both XBMC and iTunes after 10.7.2 update

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bniswe Offline
Junior Member
Posts: 24
Joined: Nov 2009
Reputation: 0
Post: #11
I have verified that when the mac goes to sleep (I close the lid etc), and when I wake it up again, Lion takes over control of the remote.

Button presses still reach XBMC but they take effect in the OS first, starting iTunes, changing volume, etc.

A reboot is the only workaround I have found, but its not very good since I use a MacBook Pro and use it in "clamshell" mode and connect it to our TV. i.e. it falls asleep every time I close the lid (as it should).
find quote
Torroa Offline
Senior Member
Posts: 108
Joined: Nov 2010
Reputation: 1
Post: #12
The best solution might be to have a script re-enabling or disable - enable the IR within XBMC as it seems like 10.7.2 reloads or reclaims the event server on port 9777 after a wakeup.

You can do this manually by clicking disabled remote, then enabled within the preferences menu in XBMC. It is not exactly "decent" as it require more than a remote.

I am not a script expert, but would not something like a this script be a solution?

#!/bin/sh


# This script uses curl. Install curl using the following command from your terminal apt-get install curl
# This script will restart (ADD YOUR DEVICE NAME HERE WHEN FINISHED), Lirc, and XBMC upon resume.
case "$1" in
resume)
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"


/etc/init.d/lirc restart
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"
echo "lirc resume script completed!!!" >>/tmp/script.log
;;
(This post was last modified: 2011-12-31 13:52 by Torroa.)
find quote
Torroa Offline
Senior Member
Posts: 108
Joined: Nov 2010
Reputation: 1
Post: #13
double
(This post was last modified: 2011-12-31 13:53 by Torroa.)
find quote
Torroa Offline
Senior Member
Posts: 108
Joined: Nov 2010
Reputation: 1
Post: #14
triple
(This post was last modified: 2011-12-31 13:57 by Torroa.)
find quote
davilla Offline
Team-XBMC Developer
Posts: 10,399
Joined: Feb 2008
Reputation: 58
Post: #15
10.7.2 seems to have broken that handling. Nothing we can do. Roll back to an OSX version that is not broke if you MUST have this ability.


MediaInfo : http://mediainfo.sourceforge.net/
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
find quote
idioteque Offline
Fan
Posts: 395
Joined: Aug 2008
Reputation: 0
Post: #16
Reply
4:19 p.m. Wednesday Nov. 23, 2011 (about 1 year after publishing)
Thanks! — f.
Great, thank you for this small thing. It works well on LION (10.7.2)! Thanks!!!
Reply
7:22 p.m. Thursday Nov. 24, 2011 (about 1 year after publishing)
RE: Thanks! — farhan
I am glad that this is useful. Enjoy!
Reply
9:58 a.m. Monday Dec. 5, 2011 (about 1 year after publishing)
This is useful and it works perfectly. — dieTunes
Installed and tested under Mac OS X Snow Leopard 10.6.8 on an Intel-based iMac. The keyboard's Play/Pause key and the remote control's Play/Pause button do not launch iTunes anymore. Aside from this, the keyboard media keys and remote control buttons work normally. Conclusion is... this smart little patch works flawlessly. It does exactly what it is supposed to do. Kudos to the author of this script. Note: I haven't tried the unpatching process, I like my RCD patched!
Reply
11:06 p.m. Thursday Dec. 8, 2011 (about 1 year after publishing)
Great Fix — Eric
Thanks so much!!
Reply
10:07 a.m. Monday Dec. 5, 2011 (about 1 year after publishing)
RE: This is useful and it works perfectly. — farhan
I am glad that this worked for you. Enjoy the media keys! Smile



Play Button iTunes Patch

Published Sunday November 21, 2010

Overview

This is a patch for removing the default OS X behavior of always starting iTunes when the play button on the keyboard is pressed. This feature can be useful for a lot of users, but it can also be annoying if you are using VLC or other similar programs that support the media keys.

The Patch.command script will patch the Remote Control Daemon to prevent it from starting iTunes whenever you press the play button on the keyboard or an external remote control. This will only prevent iTunes from starting, all other functions (like play/pause while iTunes is running) will continue to work as before.

Lastly, this program will backup the original file in case if you would like to restore the original functionality.

Updates

2011-08-18 farhan: Updated to 0.8 to account for spaces in the directory name (thanks to Michael Winstock for submitting the patch!).

2011-07-26 farhan: If you are upgrading to OS X Lion with a previously patched file then please note that the OS X Lion upgrade process replaces the patched file with an updated version so you will have to re-run this to patch the latest file.

Download

Play Button iTunes Patch 0.8.1

After downloading double click on Patch.command and follow the prompt.

License

Copyright © 2010 Farhan Ahmad.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

http://www.thebitguru.com/site_media/upl..._0.8.1.zip

http://www.thebitguru.com/projects/iTunesPatch#375

MBP late 2009 - TimeCapsule 2TB - Harmony One+ - Readynas NV+ 8TB RAID5 - Mac Mini late 2009 with 10.8.0 and VDA - Panasonic TX-PG420ES -
find quote
davilla Offline
Team-XBMC Developer
Posts: 10,399
Joined: Feb 2008
Reputation: 58
Post: #17
@idioteque, thanks, I forgot all about Farhan Ahmad's iTunesPatch.


MediaInfo : http://mediainfo.sourceforge.net/
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
find quote
Torroa Offline
Senior Member
Posts: 108
Joined: Nov 2010
Reputation: 1
Post: #18
I got one solution to this.
Installed SleepWatcher 2.2.
It makes it possible to automatically run a script at wakeup. The script reloads XBMCHelper, and it makes XBMC get the focus again.
(This post was last modified: 2012-01-01 17:55 by Torroa.)
find quote
bniswe Offline
Junior Member
Posts: 24
Joined: Nov 2009
Reputation: 0
Post: #19
Torroa, great find, that looks like a decent workaround.

Can you share your XBMCHelper relaunch script? I was unable to figure out what parameters it needs to be launched with.
find quote
Torroa Offline
Senior Member
Posts: 108
Joined: Nov 2010
Reputation: 1
Post: #20
bniswe Wrote:Torroa, great find, that looks like a decent workaround.

Can you share your XBMCHelper relaunch script? I was unable to figure out what parameters it needs to be launched with.


Here is what I did:

1. Extracted the tar file onto the desktop.

2. Open Terminal and:

sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8

sudo cp ~/Desktop/sleepwatcher_2.2/sleepwatcher /usr/local/sbin

sudo cp ~/Desktop/sleepwatcher_2.2/sleepwatcher.8 /usr/local/share/man/man8

sudo cp ~/Desktop/sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist

sudo cp ~/Desktop/sleepwatcher_2.2/config/rc.* /etc

sudo launchctl load /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist


3. After installing SleepWatcher, create a .wakeup file in the home directory, using nano or vi in Terminal (nano ~/.wakeup) that looks like this:

#!/bin/bash

#
# Kill off the XBMCHelper process.
#
killall -9 XBMCHelper

#
# Restart XBMCHelper.
#
((//Applications/XBMC.app/Contents/Resources/XBMC/tools/darwin/runtime/XBMCHelper -x & ) & )


4. Not sure if it is needed to make this file executable, but I did a: chmod +x ~/.wakeup
(This post was last modified: 2012-01-26 16:23 by Torroa.)
find quote