CNA-BUG-149: Microphone::Start reports Started even when the capture device could not be opened
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
Start swallows every exception from opening the device and ignores an unusable negotiated format, then sets State to Started; XNA's Start surfaces the native error as an exception.
- Identifier
CNA-BUG-149- Category
- Bug
- Subsystem
- Audio & media
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Microphone::Start() and Microphone::getStateProperty()
Expected behaviour
XNA 4.0's Microphone.Start (IL) calls the native start and passes its result to Helpers.ThrowExceptionFromErrorCode, so a device that cannot start raises an exception (for example NoMicrophoneConnectedException) and State does not become Started.
Actual behaviour at TARGET
Microphone::Start in Microphone.cpp opens the device inside catch (...) {} (“FNA ignores native start failure and still transitions public state”), closes it without error if the negotiated format is not 16-bit mono, and then unconditionally sets state_ = MicrophoneState::Started. The caller sees a started microphone that never delivers data.
Source locations
modules/audio/src/Xna/Microphone.cpp— Microphone::Start: catch (...) and unconditional Started
Evidence
Checked by reading at 009d40f5 against the XNA 4.0 IL of Microphone.Start; not executed. The code follows FNA deliberately; this entry applies CNA's rule that XNA's contract wins where FNA differs.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
MicrophoneTests.cpp and MicrophoneStateTests.cpp cover state transitions with working or absent providers; none asserts the failure path.
Regression test
A canned recording provider whose Open throws, expecting an exception and State Stopped.
Blast radius
Voice or audio-capture features on machines whose device fails to open; the game waits for data that never arrives.
Workaround
Check that GetData delivers data within a timeout after Start.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Audio: microphone
- Deep dives
- Sound effects and streaming: microphone
- Known issues
- Bug index