Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
emansom opened this issue May 1, 2023 · 1 comment · Fixed by #6
Closed

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

emansom opened this issue May 1, 2023 · 1 comment · Fixed by #6

Comments

@emansom
Copy link
Contributor

emansom commented May 1, 2023

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.

@emansom
Copy link
Contributor Author

emansom commented May 2, 2023

Opened pull request #6 to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant