Skip to content

feat(monitoring): Add config inspector and reconnect functionality [version 1.9] - #60

Merged
Peter-L-SVK merged 12 commits into
stagefrom
feat/version-1.9
Dec 22, 2025
Merged

Peter-L-SVK merged 12 commits into
stagefrom
feat/version-1.9

Conversation

@Peter-L-SVK

Copy link
Copy Markdown
Owner
  • Added Configuration Inspector tab for PipeWire/WirePlumber configuration file management
  • Implemented manual reconnect button for audio monitoring with retry logic
  • Enhanced PipeWire service health checks and automatic restart capability
  • Added configuration file scanning with active status detection via pw-dump
  • Implemented system/user config file differentiation and visual indicators
  • Added file opening support with automatic terminal detection for system files
  • Fixed thread-safety issues in monitoring restart operations
  • Improved UI feedback with detailed status messages during reconnection

…tion module [new feature]**

Implemented a new "Config Inspector" tab that provides detailed insight into PipeWire and WirePlumber configuration files:

**Features:**
- Scans both user (`~/.config/pipewire/pipewire.conf.d/`, `~/.config/wireplumber/`) and system (`/etc/pipewire/pipewire.conf.d/`, `/etc/wireplumber/`) configuration directories
- Detects active configuration files by parsing `pw-dump` output to identify pro-audio properties
- Displays file metadata: name, modification time, size, and owner
- Shows active/inactive status with visual indicators (✓ for active files)
- Supports double-click to open files with system default editor (uses `xdg-open` for user files, `pkexec` for system files)

**Technical implementation:**
- Uses `TreeView` with `ListStore` for efficient display of configuration files
- Background scanning with real-time updates via GTK timeouts
- JSON parsing of `pw-dump` output to detect active configuration properties
- Thread-safe communication between scanning threads and UI updates
- Proper handling of privilege escalation for system file access

**UI/UX:**
- Clean, organized layout with separate sections for user and system configurations
- Status indicators and clear visual feedback during scanning
- Legend explaining active/inactive file indicators
- Responsive design that matches existing application styling

This module provides professional audio configuration management, allowing users to understand
exactly which configuration files are active.
Users can inspect or edit them directly from the application interface.
…tion module [new feature]**

Implemented a new "Config Inspector" tab that provides detailed insight into PipeWire and WirePlumber configuration files:

**Features:**
- Scans both user (`~/.config/pipewire/pipewire.conf.d/`, `~/.config/wireplumber/`) and system (`/etc/pipewire/pipewire.conf.d/`, `/etc/wireplumber/`) configuration directories
- Detects active configuration files by parsing `pw-dump` output to identify pro-audio properties
- Displays file metadata: name, modification time, size, and owner
- Shows active/inactive status with visual indicators (✓ for active files)
- Supports double-click to open files with system default editor (uses `xdg-open` for user files, `pkexec` for system files)

**Technical implementation:**
- Uses `TreeView` with `ListStore` for efficient display of configuration files
- Background scanning with real-time updates via GTK timeouts
- JSON parsing of `pw-dump` output to detect active configuration properties
- Thread-safe communication between scanning threads and UI updates
- Proper handling of privilege escalation for system file access

**UI/UX:**
- Clean, organized layout with separate sections for user and system configurations
- Status indicators and clear visual feedback during scanning
- Legend explaining active/inactive file indicators
- Responsive design that matches existing application styling

This module provides professional audio configuration management, allowing users to understand
exactly which configuration files are active.
Users can inspect or edit them directly from the application interface.
…ting

- Replaced basic terminal detection with comprehensive multi-DE support
- Added support for 15+ desktop environments including:
  - MATE, Cinnamon, LXQt, LXDE, Xfce
  - COSMIC, Budgie, Pantheon, Deepin, Enlightenment
  - Fallback support for 20+ terminal emulators
- Fixed sudo access for system configuration files
- Added proper script cleanup with 2-second delay
- Maintained xdg-open support for user files
- Enhanced error handling with manual instructions fallback

The new implementation automatically detects the user's desktop environment
and launches the appropriate terminal with sudoedit for system files.
User files continue to use xdg-open for seamless editing.
…uto detect channels

- Update PipeWire crate API calls to match v0.9.2 (MainLoopRc, ContextRc, StreamBox)
- Fix manual re-connection function with proper error handling and retry logic
- Add automatic channel detection from active audio sink configuration
- Improve auto-connect timing with delayed initialization and multiple attempts
- Add helper function for manual pw-link connections with port matching
- Fix main loop iteration to use Duration instead of boolean/Option
- Streamline monitoring thread startup sequence
- Applied clippy sugestions and fixes
…ion**

- Added proper restart logic for PipeWireMonitor instances after service restarts
- Implemented connection cleanup to remove stale monitor ports before reconnection
- Added PipeWire service health checks and automatic restart capability
- Enhanced manual reconnect with multi-attempt strategy and error recovery
- Fixed PID change issues when audio daemons restart
- Added connection verification and monitoring thread lifecycle management
- Improved UI feedback during reconnection attempts with detailed status messages

fix(monitoring): Implement comprehensive audio monitoring reconnection [thread-safety issue]

- Fixed GTK thread-safety violations in restart_monitoring() calls
- Removed unsafe cross-thread GTK object sharing that caused `*mut c_void cannot be sent between threads safely` errors
- Simplified message handling architecture by leveraging existing main-thread GLib timeout mechanism
- Eliminated unnecessary callback_sender system that attempted to schedule closures on main thread
- Ensured all UI updates happen exclusively on main thread via handle_message() method
- Maintained proper separation between audio worker threads and GTK UI thread
@Peter-L-SVK Peter-L-SVK self-assigned this Dec 22, 2025
@Peter-L-SVK
Peter-L-SVK merged commit f7d0008 into stage Dec 22, 2025
1 check passed
@Peter-L-SVK
Peter-L-SVK deleted the feat/version-1.9 branch December 22, 2025 13:12
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.

1 participant