Mailing List Archive

Using TV remote to control MythTV frontend on Raspberry Pi
I discovered by accident a couple of days ago that both my TV and RPi3
support HDMI-CEC. After some fiddling around, I managed to get my TV
remote to control the MythTV frontend running on my RPi3. Not seeing the
info anywhere else (at least all together), I added it here:

https://www.mythtv.org/wiki/HDMI-CEC#Use_a_TV_remote_to_control_MythTV

Works a treat.

My only question is that I see in the frontend setup, that MythTV
support a load of system events, and one of them is a CEC command.

This lead me to think that the bash, cec-client and xdotool hackery
described above could be replaced by something altogether more elegant.

Does anybody know how to use the CEC command event directly in Myth?

Regards

Jeff
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 09/11/2017 04:25 PM, Jeff wrote:
> Works a treat.
>
> My only question is that I see in the frontend setup, that MythTV
> support a load of system events, and one of them is a CEC command.
>
> This lead me to think that the bash, cec-client and xdotool hackery
> described above could be replaced by something altogether more elegant.
>
> Does anybody know how to use the CEC command event directly in Myth?
>
> Regards
>
> Jeff
>
>
You don't need any tomfoolery, it just works. See here

https://www.mythtv.org/wiki/Raspberry_Pi#Remote_Control_with_CEC

Peter
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 12 September 2017 at 06:59, Peter Bennett <cats22@comcast.net> wrote:

>
>
> On 09/11/2017 04:25 PM, Jeff wrote:
>
> Works a treat.
>
> My only question is that I see in the frontend setup, that MythTV
> support a load of system events, and one of them is a CEC command.
>
> This lead me to think that the bash, cec-client and xdotool hackery
> described above could be replaced by something altogether more elegant.
>
> Does anybody know how to use the CEC command event directly in Myth?
>
> Regards
>
> Jeff
>
>
>
> You don't need any tomfoolery, it just works. See here
>
> https://www.mythtv.org/wiki/Raspberry_Pi#Remote_Control_with_CEC
>
> Peter
>
>
I found that the mythtv CEC support was mediocre and didn't support all the
remote buttons currently on my TV remote so I continue to use libcec-daemon
<https://github.com/pssc/libcec-daemon> and lircd

Appears there are newer forks of libcec-daemon that support libcec3
<https://github.com/benklop/libcec-daemon> & libcec4
<https://github.com/HonzaCholasta/libcec-daemon> now also aswell as a ppa
https://launchpad.net/~benklop/+archive/ubuntu/mmc/

Cheers,

Anthony
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 09/11/2017 06:15 PM, Anthony Giggins wrote:
> I found that the mythtv CEC support was mediocre and didn't support
> all the remote buttons currently on my TV remote so I continue to use
> libcec-daemon <https://github.com/pssc/libcec-daemon> and lircd
>
> Appears there are newer forks of libcec-daemon that support libcec3
> <https://github.com/benklop/libcec-daemon> & libcec4
> <https://github.com/HonzaCholasta/libcec-daemon> now also aswell as a
> ppa https://launchpad.net/~benklop/+archive/ubuntu/mmc/
> <https://launchpad.net/%7Ebenklop/+archive/ubuntu/mmc/>
>
> Cheers,
>
> Anthony

Did you try Setup->Edit Keys to add the missing keys to mythfrontend as
described in the wiki article? If that does not work please open a
ticket with the details, as I would like to have it working properly.
Please include details of what happens with Setup->Edit Keys

Peter
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 12 September 2017 at 08:20, Peter Bennett <cats22@comcast.net> wrote:

>
>
> On 09/11/2017 06:15 PM, Anthony Giggins wrote:
>
> I found that the mythtv CEC support was mediocre and didn't support all
> the remote buttons currently on my TV remote so I continue to use
> libcec-daemon <https://github.com/pssc/libcec-daemon> and lircd
>
> Appears there are newer forks of libcec-daemon that support libcec3
> <https://github.com/benklop/libcec-daemon> & libcec4
> <https://github.com/HonzaCholasta/libcec-daemon> now also aswell as a ppa
> https://launchpad.net/~benklop/+archive/ubuntu/mmc/
> <https://launchpad.net/%7Ebenklop/+archive/ubuntu/mmc/>
>
> Cheers,
>
> Anthony
>
>
> Did you try Setup->Edit Keys to add the missing keys to mythfrontend as
> described in the wiki article? If that does not work please open a ticket
> with the details, as I would like to have it working properly. Please
> include details of what happens with Setup->Edit Keys
>
> Peter
>
>
Thanks Peter

Good point I didn't know thats where the keys were configured I'll take a
look at this again, when I get some spare time.

Cheers,

Anthony
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 11/09/17 22:59, Peter Bennett wrote:
> You don't need any tomfoolery, it just works. See here
>
> https://www.mythtv.org/wiki/Raspberry_Pi#Remote_Control_with_CEC

We'll that is interesting. Thanks for the pointer.

Trying it out, I see that the built-in CEC support is:
a. easier to set up
b. context-specific

However, using cec-client:
a. produces a different device name
b. allows more of the remote buttons to be used (e.g. channel up/down,
guide, prev ch, etc.)

Without knowing how CEC works, it looks to me as though the different
device names reflect different device types. It would be nice to be able
to use the extra buttons. Can this be specified somehow?

Your wiki entry also explains nicely why my TV was powering off when
exiting MythTV, which was annoying me.

Is there any way of specifying which input the TV uses? It is defaulting
to the HDMI mode without CEC.

Regards

Jeff
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 09/12/2017 03:17 PM, Jeff wrote:
> On 11/09/17 22:59, Peter Bennett wrote:
>> You don't need any tomfoolery, it just works. See here
>>
>> https://www.mythtv.org/wiki/Raspberry_Pi#Remote_Control_with_CEC
> We'll that is interesting. Thanks for the pointer.
>
> Trying it out, I see that the built-in CEC support is:
> a. easier to set up
> b. context-specific
>
> However, using cec-client:
> a. produces a different device name
> b. allows more of the remote buttons to be used (e.g. channel up/down,
> guide, prev ch, etc.)
>
> Without knowing how CEC works, it looks to me as though the different
> device names reflect different device types. It would be nice to be able
> to use the extra buttons. Can this be specified somehow?
>
> Your wiki entry also explains nicely why my TV was powering off when
> exiting MythTV, which was annoying me.
>
> Is there any way of specifying which input the TV uses? It is defaulting
> to the HDMI mode without CEC.
>
> Regards
>
> Jeff
>
>
CEC supports device types that determine what commands are available
CEC_DEVICE_TYPE_TV =0,
CEC_DEVICE_TYPE_RECORDING_DEVICE =1,
CEC_DEVICE_TYPE_RESERVED =2,
CEC_DEVICE_TYPE_TUNER =3,
CEC_DEVICE_TYPE_PLAYBACK_DEVICE =4,
CEC_DEVICE_TYPE_AUDIO_SYSTEM =5

We are using PLAYBACK, so that the play, pause, fast forward, rewind
buttons are available.
If a different profile was selected, different buttons may work, but
those may not. Unfortunately it is hard coded into MythTV. Would it be
useful to be able to change it? Which profile would you use if you could
change it?

I do not understand the question about which input the TV uses.
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 12/09/17 22:38, Peter Bennett wrote:
> CEC supports device types that determine what commands are available
> CEC_DEVICE_TYPE_TV =0,
> CEC_DEVICE_TYPE_RECORDING_DEVICE =1,
> CEC_DEVICE_TYPE_RESERVED =2,
> CEC_DEVICE_TYPE_TUNER =3,
> CEC_DEVICE_TYPE_PLAYBACK_DEVICE =4,
> CEC_DEVICE_TYPE_AUDIO_SYSTEM =5

> We are using PLAYBACK, so that the play, pause, fast forward, rewind
> buttons are available.
> If a different profile was selected, different buttons may work, but
> those may not. Unfortunately it is hard coded into MythTV. Would it be
> useful to be able to change it? Which profile would you use if you could
> change it?

I imagine that this is all TV-specific, so it would probably be best to
be able to change it to any one of those.

Looking at the cec-client source, it seems to default to
CEC_DEVICE_TYPE_RECORDING_DEVICE

> I do not understand the question about which input the TV uses.

When my (Samsung) TV starts, it sees the RPi connected via HDMI and
defaults to the basic HDMI input. I have to use the source button on the
remote to switch to the HDMI-CEC input so that the remote buttons are
passed to MythTV.

Therefore, it would be useful for MythTV to tell the TV to switch to
that input automatically. This seems to be possible from cec-client, so
I could probably add it to my frontend launch script, but if MythTV
could handle it, it would be more convenient.

Regards

Jeff
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
Hoi Jeff,

Tuesday, September 12, 2017, 11:17:30 PM, you wrote:

> On 12/09/17 22:38, Peter Bennett wrote:
>> CEC supports device types that determine what commands are available
>> CEC_DEVICE_TYPE_TV =0,
>> CEC_DEVICE_TYPE_RECORDING_DEVICE =1,
>> CEC_DEVICE_TYPE_RESERVED =2,
>> CEC_DEVICE_TYPE_TUNER =3,
>> CEC_DEVICE_TYPE_PLAYBACK_DEVICE =4,
>> CEC_DEVICE_TYPE_AUDIO_SYSTEM =5

>> We are using PLAYBACK, so that the play, pause, fast forward, rewind
>> buttons are available.
>> If a different profile was selected, different buttons may work, but
>> those may not. Unfortunately it is hard coded into MythTV. Would it be
>> useful to be able to change it? Which profile would you use if you could
>> change it?

> I imagine that this is all TV-specific, so it would probably be best to
> be able to change it to any one of those.

> Looking at the cec-client source, it seems to default to
> CEC_DEVICE_TYPE_RECORDING_DEVICE

>> I do not understand the question about which input the TV uses.

> When my (Samsung) TV starts, it sees the RPi connected via HDMI and
> defaults to the basic HDMI input. I have to use the source button on the
> remote to switch to the HDMI-CEC input so that the remote buttons are
> passed to MythTV.

> Therefore, it would be useful for MythTV to tell the TV to switch to
> that input automatically. This seems to be possible from cec-client, so
> I could probably add it to my frontend launch script, but if MythTV
> could handle it, it would be more convenient.

> Regards

> Jeff


Can't you set the default mode on your TV for your hdmi port. I seem
to remember I can do so on my Philips TV

Tot mails,
Hika mailto:hikavdh@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

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 12/09/17 23:30, Hika van den Hoven wrote:
> Can't you set the default mode on your TV for your hdmi port. I seem
> to remember I can do so on my Philips TV

I went through all the menus and couldn't find a way of doing that on my TV.

Thanks anyway.

Regards

Jeff
Re: Using TV remote to control MythTV frontend on Raspberry Pi [ In reply to ]
On 12/09/17 23:17, Jeff wrote:
> When my (Samsung) TV starts, it sees the RPi connected via HDMI and
> defaults to the basic HDMI input. I have to use the source button on the
> remote to switch to the HDMI-CEC input so that the remote buttons are
> passed to MythTV.
>
> Therefore, it would be useful for MythTV to tell the TV to switch to
> that input automatically. This seems to be possible from cec-client, so
> I could probably add it to my frontend launch script, but if MythTV
> could handle it, it would be more convenient.

It seems I was not being patient enough. Either Myth is saying to the TV
something like "make me the input", or the TV is doing it automatically
after the frontend is fully up, but the input changes between boot and
frontend start.

Regards

Jeff