bug: Headset jack state not reported after Linux boot: flipper-one-input does not read the MCU's state at probe

Open Beginner friendly
#211 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, linux
Domain
embedded-iot

Research direction

Find the flipper-one-input driver and its probe function, then read how it handles MCU interrupts and reports SW_HEADPHONE_INSERT and SW_MICROPHONE_INSERT. Read register 0x0208 at probe and report the initial switch states before enabling the interrupt. Done when a jack already present at boot is reported correctly without requiring a plug change.

Written by the indexing model from the issue text.

Description

bug

With a plug in the 3.5 mm jack, SW_HEADPHONE_INSERT of the "Flipper One Headset" input device reads 0 after Linux boots, until the plug is pulled and inserted again.

The MCU tracks the jack correctly: it keeps the state in its I2C intercom register 0x0208 (bit 0 headphones, bit 1 microphone) and raises an interrupt only on a change. The MCU is not reset when Linux reboots, so after boot no change happens and no interrupt comes. The flipper-one-input driver does not read 0x0208 at probe, so the switch stays at its default 0.

Steps to reproduce (image 1312, kernel 7.4.0-rc1):

Insert a plug into the jack and boot Linux (or reboot it; the MCU keeps running).
evtest --query /dev/input/eventN EV_SW SW_HEADPHONE_INSERT returns 0, i.e. not inserted. The MCU log shows [HeadphonesSrv] Headphones status changed: 00000001.
Pull the plug and insert it again: the event SW_HEADPHONE_INSERT 1 arrives and the query returns 10, i.e. inserted.
Expected: after probe, the input device reports the current jack state.

Fix: in flipper-one-input, read register 0x0208 at probe and report the initial SW_HEADPHONE_INSERT and SW_MICROPHONE_INSERT before enabling the interrupt.

Dominant language
Shell
Stars
84
Forks
38
Avg merge
1d 15m
Merged PRs (30d)
7

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flipperdevices/flipperone-linux-build-scripts

All issues in flipperdevices/flipperone-linux-build-scripts

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.