Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#11338 closed Patch - Feature (fixed)

libCEC version 2 support

Reported by: macarno@… Owned by: Karl Egly
Priority: minor Milestone: 0.28
Component: MythTV - libCEC Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch provides support for version 2 of the libCEC library from Pulse-Eight. It maintains backward compatibility back to v 1.6.0. It is build and tested with the git master branch of Myth and versions 1.8.0 and 2.0.5 of libCEC on Ubuntu. Changes to the configuration file should be improved, now it’s just a hack to make Myth build. Any help of someone who understands the configuration process better than me would be appreciated. libCEC support in general needs more work, tips or feedback are welcome.

Attachments (5)

libcec-2-support.patch (13.3 KB) - added by macarno@… 7 years ago.
Patch for libCEC version 2 support
libcec-2-support.2.patch (16.6 KB) - added by macarno@… 7 years ago.
Update
libcec2-upstream.patch (17.3 KB) - added by Bradley Baetz <bbaetz@…> 5 years ago.
Alternative patch
libcec2.patch (21.4 KB) - added by bbaetz@… 5 years ago.
Updated patch
libcec2-upstream.2.patch (17.3 KB) - added by Bradley Baetz <bbaetz@…> 5 years ago.
Actual patch

Download all attachments as: .zip

Change History (15)

Changed 7 years ago by macarno@…

Attachment: libcec-2-support.patch added

Patch for libCEC version 2 support

Changed 7 years ago by macarno@…

Attachment: libcec-2-support.2.patch added

Update

comment:1 Changed 7 years ago by macarno@…

Updated the patch.

When Myth is selected as activated source the screensaver is reset.
Updated libCEC version detection.

comment:2 Changed 6 years ago by stuartm

Component: MythTV - User Interface LibraryMythTV - libCEC
Owner: changed from stuartm to Raymond Wagner

Changed 5 years ago by Bradley Baetz <bbaetz@…>

Attachment: libcec2-upstream.patch added

Alternative patch

comment:3 Changed 5 years ago by Bradley Baetz <bbaetz@…>

I've attached a slightly different patch. This works against libcec2.1 (in ubuntu 14.04) as well as libcec1.6 (in ubuntu12.04)

I wrote an initial version before seeing this, but then added in some of your changes.

The main differences are:

  • applies cleanly, following my patch in #11986
  • removed the runtime version check - if the wrong libcec.so is present, we don't get that far (libcec has a very odd scheme, where at compile time all mythtv does is #include a bunch of wrappers around dlopen, avoiding the need to link to libcec at build time. Not sure why it does that...)
  • builds against libcec1.6 (the other patch uses some callbacks that are only available from v1.7)
  • I didn't include the change to explicitly setting a logical address - that method is documented as deprecated and only for debugging purposes. Instead, I left it for libcec to handle.
  • I kept the support for setting the parent device type from the patch, but not setting the physical address directly - the attached patch hard codes that to 2.2.0.0, so presumably only works for you? At least on my libcec version the search order is:
    • specified physical address
    • auto-detection in libcec of the port info from EDID (which only works on the ATI drivers and older kernels with older nvidia drivers that use /proc/acpi/video)
    • specified parent logical device/port combination (defaults to TV/port 1)

I kept the change you made to wake up the screen when the TV source goes active (although for libcec2 only; yours supports it from 1.7.1 but won't compile against older versions). However, it doesn't actually wake the screen up for me - I need a button press to do that like before. Is that part working for you? My screensaver/desktop might just be set up differently...

comment:4 Changed 5 years ago by Bradley Baetz <bbaetz@…>

I kept the change you made to wake up the screen when the TV source goes active

and your code has a check that I skipped that doesn't do this on the first passthrough. I see that's because of a deadlock - the first time through, this is called in ::Open, while MythMainWindow? is being set up, so the call to ::ResetScreensaver? may deadlock trying to get the same lock

No idea why I didn't hit this earlier in all my testing - will fix and upload a different patch over the weekend

Changed 5 years ago by bbaetz@…

Attachment: libcec2.patch added

Updated patch

comment:5 Changed 5 years ago by bbaetz@…

I've been using the attached patch on top of fixes/0.27 for the past few months without issues. (Ubuntu 14.04)

Changed 5 years ago by Bradley Baetz <bbaetz@…>

Attachment: libcec2-upstream.2.patch added

Actual patch

comment:6 Changed 5 years ago by Bradley Baetz <bbaetz@…>

Oops, wrong patch - try this one instead

comment:7 Changed 5 years ago by stuartm

Milestone: unknown0.28
Owner: changed from Raymond Wagner to stuartm
Status: newaccepted

comment:8 Changed 5 years ago by stuartm

Owner: changed from stuartm to Karl Egly
Status: acceptedassigned

comment:9 Changed 5 years ago by Karl Dietz <dekarl@…>

Resolution: fixed
Status: assignedclosed

In ea74b8d0b78ced9126dd8a08ac82ef5a11f4b4ef/mythtv:

Add support for libcec 2

Patch by macarno@ and Bradley Baetz

Fixes #11338

comment:10 Changed 5 years ago by Karl Dietz <dekarl@…>

Note: See TracTickets for help on using tickets.