[mythtv-users] Lirc commands in a shell script

Hika van den Hoven hikavdh at gmail.com
Sun Sep 28 13:50:07 UTC 2014



> Hoi Stephen,

> Sunday, September 28, 2014, 3:28:30 PM, you wrote:

>> On Mon, 29 Sep 2014 02:21:21 +1300, you wrote:

>>>On Sun, 28 Sep 2014 13:37:09 +0200, you wrote:
>>>
>>>>Hoi All ,
>>>>
>>>> I have Radio integrated in Myth with some adaptations as in the wiki.
>>>> The radio command (ivtv-radio and aplay) itself runs as an
>>>> independent service and I can select stations (with iradio, which can
>>>> set the station on the screen or v4l2-ctl) either through a Mythmenu
>>>> or through a shellscript. Also Volume (with amixer) I can control
>>>> through that script. 
>>>> Through my remote I can turn it on and off, by starting/stopping the
>>>> service. I would like to also be able to select stations and adjust
>>>> volume through the remote. That way I do not need to turn on the
>>>> screen. As I have seen suggested, it would be possible to receive
>>>> Lirc commands in a shellscript, as long as of cause it's on the
>>>> foreground. Does anybody know how to do that?
>>>
>>>Take a look at irexec - that runs things when triggered by a remote
>>>button.  It could be used to send signals to your radio service.  I
>>>have some test irexec setup in the MCE remote config I posted on my
>>>web server a couple of days ago:
>>>
>>>   http://www.jsw.gen.nz/mythtv/mythbuntu-devinput-lirc.bz2
>>>
>>>Look at the end of the "mythtv" file that goes in /home/<your
>>>mythfrontend user>/.lirc.  You can make an entire file of irexec setup
>>>and add it to the /home/<your mythfrontend user>/.lircrc file to be
>>>included in the lirc setup.  Whenever irexec is running, it will get
>>>those commands.

> Do you mean that I should in .lircrc set prog = irexec for the ones I
> want to use in my script? I now run irexec for it is by default
> present in the service script, but have all mythtv keys marked with 
> prog = mythtv. Then how do I catch them in the script? I guess I put a
> while true; do loop around that to trigger when it receives a valid
> command.
Or do they come in as regular keystrokes, so I can catch it with read.
But then I need a following <Enter>.

>> I should add that when I run mplayer from mythfrontend for a video
>> file that mythfrontend can not play, only mplayer gets the remote
>> buttons, not the underlying mythfrontend.  I do not know how that
>> works, as if I run irexec in parallel with mythfronted, they both see
>> the remote buttons.

> I guess that is because then mythfrontend is not the front window.

>> Another alternative for changing radio stations is to add them to
>> MythTV as channels and use a channel change script to send the change
>> station commands to your radio service.  I have that working for my FM
>> radio scripts I use with my mothers PVR-150 FM tuner.

> If looked at that some time ago, but couldn't get that working. Also
> then I probably need my screen on to see what happens.




Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens
--



More information about the mythtv-users mailing list