Commit Graph
3 Commits
Author SHA1 Message Date
Jatin K MalikandGitHub 57a0ddd0b8 feat(speech): add whisper.cpp with Vulkan support for GPU acceleration (#179)
* feat(speech): add whisper.cpp with Vulkan support for GPU acceleration

Add whisper.cpp as a new speech recognition engine with the following features:
- Vulkan GPU acceleration support (AMD, Intel, NVIDIA)
- Fallback to CUDA for NVIDIA GPUs
- CPU-only mode with automatic thread optimization
- Support for all model sizes: tiny, base, small, medium, large
- Hardware detection to recommend best model/backend
- Models downloaded from Hugging Face (ggml format)
- Updated UI to show compute backend info in settings
- pywhispercpp as the Python binding library
- whisper_cpp as the new default engine

Changes:
- New whispercpp_model_info.py with model metadata and hardware detection
- Updated recognition_manager.py with whisper.cpp init and transcription
- Updated settings_dialog.py with whisper.cpp UI support
- Updated config_manager.py with whisper_cpp_model_size config
- Updated main.py with whisper_cpp CLI option
- Updated pyproject.toml with pywhispercpp dependency
- Updated install.sh with vulkan-tools for GPU detection

Closes #104

* style: fix black and isort formatting issues

* test: update config manager test for whisper_cpp default engine

* feat(install): interactive mode with 3 engine choices and whisper.cpp as default

Major changes to install.sh:
- Interactive mode is now the DEFAULT (not --auto)
- Added --auto flag for non-interactive automatic installation
- New --engine flag to specify engine directly
- Interactive mode shows 3 engine options with visual boxes:
  1. whisper.cpp (recommended) - Vulkan/CUDA/CPU support
  2. whisper (OpenAI) - PyTorch-based, NVIDIA-only
  3. VOSK - lightweight option
- Hardware detection with recommendations:
  - Detects Vulkan support (AMD/Intel/NVIDIA)
  - Detects NVIDIA CUDA
  - Checks available RAM
  - Recommends best engine based on hardware
- Updated help text with new options and examples
- Removed old --with-whisper, --whisper-cpu, --no-whisper flags
- whisper.cpp is now the default engine for automatic mode

* feat(uninstall): kill running vocalinux processes before uninstall

* fix(whisper.cpp): auto-download model, use all CPU cores, hide unavailable engines

Three fixes for whisper.cpp implementation:

1. Auto-download model during install
   - Added install_whispercpp_model() function to install.sh
   - Downloads ggml-tiny.bin (~39MB) from Hugging Face
   - Runs automatically when whisper.cpp engine is selected

2. Use all CPU cores for transcription
   - Added n_threads parameter to Model initialization
   - Uses multiprocessing.cpu_count() to get all cores
   - Significantly improves transcription speed

3. Hide unavailable engines from dropdown
   - Added get_available_engines() function to detect installed engines
   - Settings dialog now only shows engines that are actually installed
   - Falls back to first available engine if current not available

Fixes user-reported issues with whisper.cpp integration.

* ui(settings): display whisper.cpp correctly and increase dialog height

- Changed engine display name from 'whisper_cpp' to 'whisper.cpp'
- Added format_engine_display_name() helper function
- Dialog now uses 75% of screen height for better visibility
- More options visible by default without scrolling

* revert(settings): remove display name change, keep dialog height increase

- Reverted engine display name change (was breaking engine selection)
- Kept dialog height at 75% of screen for better visibility

* style: fix black and isort formatting for whisper.cpp logging

* style: fix black formatting in settings_dialog.py

* ci: fix Fedora 39 container package installation

Add dnf cache update and fallback with --nogpgcheck for Fedora containers
that may have stale or missing package metadata.
2026-02-11 19:37:58 -08:00
Jatin K MalikandGitHub 8e48b997a5 ci: Actually test install.sh distro detection in CI matrix (#163)
* docs: Add distribution package mapping reference

Add a comprehensive YAML reference file documenting package names
across different Linux distributions. This serves as:

1. Documentation for manual installation on unsupported distros
2. Reference for adding support for new distributions
3. Auxiliary reference for the installer's embedded package mappings

Completes Task 6 from the cross-distribution compatibility fix plan.

Related to: #158, #159, #160, #161

* ci: Actually test install.sh distro detection in CI matrix

Previously, the distro-test-matrix.yml workflow only did syntax checks
on install.sh without actually testing the core cross-distribution
functionality that was added in phases 1-4.

This update adds proper tests for:

1. Distro Detection - Tests detect_distro() function logic across
   different containers to verify proper identification of Ubuntu,
   Debian, Fedora, etc.

2. Typelib Path Detection - Tests detect_typelib_path() function
   which uses pkg-config and fallback paths for GI_TYPELIB_PATH

3. Virtual Environment Creation - Verifies Python venv can be
   created with minimal system dependencies

4. Dependency Checker - Runs check-system-deps.sh to see what's
   missing on each distro

5. Installer Help - Verifies install.sh --help works

This ensures the cross-distribution compatibility improvements
are actually tested by CI, not just syntax-checked.

Related to: #158, #159, #160, #161, #162

* ci: Fix distro test - avoid sourcing install.sh (root check fails)

The install.sh script has a root check that exits immediately when
running as root, which causes CI to fail when we try to source it.

Instead, we now test the distro detection logic directly without
sourcing install.sh. This gives us the same test coverage while
avoiding the root check issue.
2026-02-07 18:22:02 -08:00
Jatin K MalikandGitHub 6b0e81c117 feat: Phase 4 - Testing & Polish improvements (#161)
Add testing infrastructure and documentation improvements.

**Task 12: Add pkg-config to Core Dependencies**
- Added pkg-config check at the start of install_system_dependencies()
- Added pkg-config to all distribution package lists
- Provides distro-specific install instructions if pkg-config is missing
- Critical for library detection (GI_TYPELIB_PATH, PortAudio, etc.)

**Task 13: Update README with Distro Info**
- Updated Requirements section with tested distributions
- Added link to DISTRO_COMPATIBILITY.md
- Listed officially supported distros: Ubuntu 22.04+, Debian 11+, Fedora 39+, Arch, openSUSE
- Mentioned experimental support for Gentoo, Alpine, Void, Solus

**Task 14: Create Test Matrix for CI**
- New workflow: .github/workflows/distro-test-matrix.yml
- Tests on multiple container images: Ubuntu 22.04, 24.04, Debian 12, Fedora 39
- Runs dependency checker on each distro
- Tests Python imports and bash syntax validation
- Uses continue-on-error for experimental distro support

**Task 15: Integration Testing Checklist**
- New file: tests/distro-testing-checklist.md
- Comprehensive checklist for testing on new distributions
- Covers: Pre-install, Installation, Post-install, Functionality, Performance, Cleanup
- Includes quick reference commands
- Desktop environment and application-specific testing sections
- Template for submitting test results

Part of cross-distribution compatibility improvements (Phase 4 of 5).
Related to #157
2026-02-07 16:59:29 -08:00