Fix Oboe initialization and error reporting on Android - #178
Conversation
- Implement missing native exports nOboeGetLastErrorMessage and nOboeGetGlobalError to prevent P/Invoke failures and enable detailed status reporting. - Relax hardware constraints in OboeBridge::open fallback path (allowing format and channel conversion) to improve compatibility with diverse Android hardware. - Implement global error reporting in the native bridge to capture and report failures that occur during bridge creation. - Update AndroidNativeBridgeManager to utilize new native error reporting, providing descriptive feedback in the UI instead of a generic "Not Created" status.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses a critical issue where Oboe failed to initialize on some Android hardware, particularly in Release builds.
Changes:
Native Bridge Improvements:
nOboeGetLastErrorMessageand addednOboeGetGlobalErrortooboe_bridge.cpp. This fixes potential P/Invoke crashes and allows the C# layer to see exact failure reasons.OboeBridge::openfallback path. If the initial "Exclusive/Low Latency" attempt fails, it now allows format and channel conversion, ensuring Oboe can adapt to the device's hardware requirements.Managed Layer Updates:
OboeAudioBridge.cswith the new native declarations.AndroidNativeBridgeManager.csto query global errors ifOboeAudioBridge.Createreturns null.GetOboeStatus()to report specific Oboe result strings (e.g., "Failed: ErrorDisconnected") in the FPS counter status bar.These changes combined ensure that Oboe successfully initializes on more devices and provides clear diagnostic info if it still fails.
PR created automatically by Jules for task 13739441339635503911 started by @winnerspiros