Skip to content

Conversation

@matt2005
Copy link

Added multitouch #12
Fixed Shutdown issue
Fixed display scaling issue
various buildissues #14 #16 #9 #17 #38

…ling

CRITICAL: The primary shutdown hang was caused by QtVideoOutput cleanup never
completing. Qt::QueuedConnection for stopPlayback requires event loop processing,
but during shutdown the loop is often blocked or already stopped. Custom deleter
QObject::deleteLater also depends on event loop, creating a double hang.

Changes:
1. QtVideoOutput destructor + synchronous stop:
   - Add explicit ~QtVideoOutput() to ensure cleanup even if deleteLater never fires
   - Change stopPlayback to Qt::BlockingQueuedConnection for reliable synchronous stop
   - Extract cleanupPlayer() helper for reuse in both onStopPlayback() and destructor
   - Ensures mediaPlayer_->stop() completes before object destruction

2. Complete OPERATION_ABORTED handling:
   - BluetoothService: Demote to debug (was: error)
   - MediaSourceService: Demote to debug (was: error)
   - Ensures clean logs on normal AA exit without spurious errors

Root cause: QueuedConnection + deleteLater both depend on Qt event loop, which is
often blocked or stopped during app teardown, causing ~90s timeout and SIGKILL.

Impact: Clean, immediate shutdown; no more 90-second timeout on AA exit.
The video widget was using setFullScreen which maintained aspect ratio despite IgnoreAspectRatio being set. This caused the AA video window to only occupy 75% of the physical screen width while touch coordinates were scaled to the full screen dimensions.

Solution: Explicitly set video widget geometry to match the physical screen dimensions using QScreen geometry instead of relying on setFullScreen. This ensures the video output fills the entire screen and touch coordinates map correctly to the displayed content.

Impact: Touch input now correctly maps to displayed AA buttons and controls. Video fills entire 800x480 RPi 7 inch screen. Eliminates the 25% horizontal offset in touch coordinates.
Implements full multitouch gesture support using Qt touch events. The Android Auto protocol already supports multitouch via repeated pointer_data fields - this change enables OpenAuto to properly capture and transmit multiple simultaneous touch points.

Key Changes:

- Updated TouchEvent structure to support multiple TouchPoint objects with vector

- Added actionIndex field to indicate which pointer triggered state change

- Implemented handleMultiTouchEvent to process Qt touch events (TouchBegin/Update/End/Cancel)

- Maps Qt touch point IDs to sequential pointer IDs for AA protocol

- Properly handles ACTION_DOWN, ACTION_UP, ACTION_POINTER_DOWN, ACTION_POINTER_UP, ACTION_MOVED, ACTION_CANCEL

- Updated InputSourceService to send all touch points in InputReport

- Maintains backward compatibility with mouse events as fallback

- Added Qt WA_AcceptTouchEvents attribute to parent widget

Impact:

- Enables pinch-to-zoom gestures in Google Maps

- Supports two-finger scrolling and rotation

- Allows multi-finger gestures in compatible AA apps

- Improves touch responsiveness and accuracy

- Fully compatible with RPi official touchscreen and external multitouch displays
@matt2005 matt2005 merged commit 2cc4c31 into main Nov 13, 2025
2 of 10 checks passed
@matt2005 matt2005 deleted the develop branch November 13, 2025 21:17
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 this pull request may close these issues.

2 participants