Author Topic: CEC - Channel Up/Down on same button as skip Left/right  (Read 4476 times)

Offline sirwio

  • Full Member
  • ***
  • Posts: 117
    • View Profile
CEC - Channel Up/Down on same button as skip Left/right
« on: September 16, 2012, 20:35:19 »
On my Philips TV remote the buttons Channel Up/Down and Skip Left/Right are on the same place on the remote.

While watching recordings we usually skip forward using the Skip Right button to skip the commercials :-). This does however not work on the raspi vompclient with my philips remote.

Could it be that the vompclient need to announce itself as being in different modes depending on where in the UI one are navigating. E.g while watching live tv its obvious that a press on the buttons mentioned above shall result in a Channel Up/Down message whilst in recordings and perhaps elsewhere in the menus one shall receive Skip Left/Right messages.

Sorry if this is totally of bound on how CEC and libcec is supposed to work but I'm a total noob in this area.

Another problem with the remote is that there is no "Record" button making it impossible to set a show from the program guide to be recorded. Any suggested workaround for this?


Offline MartenR

  • Hero Member
  • *****
  • Posts: 789
    • View Profile
Re: CEC - Channel Up/Down on same button as skip Left/right
« Reply #1 on: September 16, 2012, 22:07:54 »
Quote
On my Philips TV remote the buttons Channel Up/Down and Skip Left/Right are on the same place on the remote.
Actually there are modes.
Can you please look on the CEC messages in the log "vompclient -d>debug.log" to figure out as which keys code they arrive.

Then please go to the line
Code: [Select]
cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_TUNER);and change it to
Code: [Select]
cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);and look into the logs if the key code change and then try
Code: [Select]
cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);,
if it really makes a difference, I have think about a clean solution to handle this,
you now that also the color keys can be used for some skipping. (but not to the marks).
For the record button you may map another key to the record key function.

Marten



Offline sirwio

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: CEC - Channel Up/Down on same button as skip Left/right
« Reply #2 on: September 16, 2012, 22:44:11 »
Thanks for the pointers. Have for the last hour read the libcec api headers and might write a small test application to see whether its possible to switch between device types on the fly. It appears so.

But first I will follows your suggestion to actually check if the device type does change the command sent to the device.

Offline sirwio

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: CEC - Channel Up/Down on same button as skip Left/right
« Reply #3 on: September 17, 2012, 07:52:09 »
Did a quick test changing the device type between CEC_DEVICE_TYPE_TUNER, CEC_DEVICE_TYPE_PLAYBACK_DEVICE and CEC_DEVICE_TYPE_RECORDING_DEVICE. It did not have any impact on the message sent when pressing the Channel Up button.

Offline MartenR

  • Hero Member
  • *****
  • Posts: 789
    • View Profile
Re: CEC - Channel Up/Down on same button as skip Left/right
« Reply #4 on: September 17, 2012, 08:27:31 »
Ok, than I have an idea, we can let the raspberry behave like an old remote.
Thus using DF_UP and DF_DOWN.
So please test the following replace in vvideolive the case for Remote::UP with the case for Remote::DF_UP and the same for down.
If this works ok, I will add a c++ macro which switches this behaviour for different targets.

Marten

Offline MartenR

  • Hero Member
  • *****
  • Posts: 789
    • View Profile
Re: CEC - Channel Up/Down on same button as skip Left/right
« Reply #5 on: September 21, 2012, 19:50:42 »
I will commit within the next minutes a changes, that should at least make the channel up and down problem go away, by also using up and down arrows for channel up and down. For the record button, I have no solution in the moment, accept of assigning another key to it.

Marten