[mythtv-users] Switching between Mythtv and Amarok

Michael T. Dean mtdean at thirdcontact.com
Sat Jun 14 13:53:13 UTC 2008

On 06/14/2008 08:41 AM, Dave M G wrote:
> I have a dedicated Mythbuntu computer, with a Hauppauge PVR-150 card.
> I'm trying to set it up to use Amarok as it's music player.
> I've followed the instructions here as best I could:
> http://acidzebra.blogspot.com/2007/07/integrating-mythtv-and-amarok_17.html
> The main menu on my MythTV front end interface has an Amarok option, and 
> when I select it, Amarok comes up.
> But, after that, I have no control over Amarok. Further, LIRC seems to 
> continue to send signals to the MythTV interface. The MythTV interface 
> could be in any menu or have selected any option after I quit Amarok.

Are you really selecting Amarok via the frontend menu or are you pushing 
the "Music" button on your remote (as configured below)?  There's a 
/huge/ difference as the remote is configured to start amarok 
directly--without telling Myth.  The frontend menu option does, well, 
something, but since you didn't show the menu XML, I can't tell you 
what.  :)

The way the frontend menu EXEC function works, mythfrontend will stop 
listening to LIRC events, start a new process, and wait for that process 
to finish, then begins listening for LIRC events once the process 
exits.  That means if the process runs as long as you want to use it, 
Myth does exactly what it should (ignores LIRC until you're done using 
the "other" program).  If, however, you configure Myth to run a shell 
script that starts amarok backgrounded or amarok runs as a daemon 
process or something, the script will exit almost immediately, so Myth 
will resume listening to LIRC events almost immediately.

Note, also, that this means that the /only/ valid way to start another 
process on your mythfrontend and use the remote with that other 
application is to do so through the frontend menus.

> My main guess at this point is that my lirc file is not set up right, so 
> that control is not properly switching between MythTV and Amarok.
> Or maybe it's something else. I'm open to suggestions.

If you want to be able to start amarok without going through the MythTV 
main menu or if it runs "backgrounded" somehow, you'll have to do more 
work--specifically, figure out how to use LIRC modes.  LIRC modes are 
extremely sparsely documented on the 'net as a whole (and much of what's 
out there is wrong).  The only real documentation I found was 
http://lirc.org/html/configure.html#lircrc_format , but it really 
doesn't document LIRC modes directly--only mentions them in passing.

Unfortunately, I don't have time to write up a lot of information about 
LIRC modes, but I'll say that I was able to figure them out from the 
information about the .lircrc file format (link above) and a little bit 
of trial and (a /lot/ of) error.

> One additional note. On the web page I referenced, it says to put "begin 
> mythtv" before all MythTV related controls, and "end mythtv" at the end 
> of them. However, when I do that, the remote doesn't do anything at all. 
> So right now I don't have those entries in my .lirc file.

That would be LIRC modes...

As far as not being able to control amarok goes, make sure the dcop 
executable can be run by the user running mythfrontend in the 
environment in which mythfrontend is running (i.e. that the PATH is 
configured correctly) or just put a full path in the config string.  
After that, just start testing the commands you've configured in your 
.lircrc without LIRC to make sure they work, and, if not, read the 
amarok docs.


> I've included my .lirc

Surely you mean .lircrc, right?

>  file for reference.
> - - lirc file begins - -
> begin
> prog = irexec
> button = Music
> repeat = 3
> config = /usr/bin/amarok
> end

More information about the mythtv-users mailing list