Skip to content

Doesn't play nice with the new CEC kernel subsystem #5

@emansom

Description

@emansom

The kernel has gained built-in drivers for CEC functionality, including the PulseEight USB adapter. libcec supports this new interface since recent versions.

Though, it requires some setup, documented here.

Once the system is configured to use the new CEC kernel subsystem and the pulse8 kernel driver, the /dev/cec0 device becomes available.

However, even once available, libcec still prefers the old userspace /dev/ttyACM0 interface above the new one, which yields a non-functional out-of-the-box experience: as the new kernel subsystem (specifically the inputattach --pulse8-cec "bridge") already took exclusive access.

Luckily, the API (and the python bindings) offer a different way of initialization.

Instead of calling cec.init() directly without arguments, one can provide 'Linux' as the first argument as such: cec.init('Linux').

This works, however now there's an opposite problem: systems that have not adopted/configured the new CEC subsystem will no longer be functional.

I think a utility function could be introduced that checks if /dev/cec0 exists, and if it does; it'll prefer that. If not, it'll let libcec decide (which will default to exclusive old legacy /dev/ttyACM0).

This would make it compatible and functional in both cases, legacy userspace and new kernel interface.

Will open a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions