Improve IR cut GPIO detection using /proc/maps#144
Merged
Conversation
The old heuristic (output + LOW) missed IR cut pins that are HIGH in steady state. Instead, scan /proc/*/maps for userspace processes that have GPIO registers memory-mapped via /dev/mem, then report output pins from those groups that have at most 2 outputs (dedicated IR cut groups vs busy general I/O groups). Falls back to the original heuristic when no /proc/maps matches found. Fixes #143 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/proc/*/mapsfor userspace processes (streamers) that have GPIO registers memory-mapped via/dev/mem/proc/mapsmatches foundProblem
The old heuristic reported GPIOs that are output+LOW as IR cut candidates. On a Hi3516AV200 camera this reported GPIO 11 (wrong) and missed GPIO 63 (the actual IR cut pin, which is output+HIGH in day mode).
Verified on hardware
Tested on Hi3516AV200 with vendor streamer
robcat:possible-IR-cut-GPIO: 11(wrong)possible-IR-cut-GPIO: 63(correct, verified by physical toggle test)Test plan
Fixes #143
🤖 Generated with Claude Code