Skip to content

Conversation

@yconst
Copy link

@yconst yconst commented Nov 5, 2025

Add Pocket Device Support

Overview

Implements complete Pocket device support with MP3 recording download, backend processing, and fixes a bug where Pocket recordings were being incorrectly discarded.

What's New

Frontend:

  • BLE protocol implementation for Pocket devices (PKT01_*)
  • Pocket Recordings UI page with download progress tracking
  • WAL sync integration for MP3 files
  • Automatic device detection and connection

Backend:

  • New /v1/pocket/upload-mp3 endpoint
  • MP3→WAV conversion using ffmpeg
  • VAD segmentation and transcription (fal_whisperx)
  • Added pocket to ConversationSource enum

Bug Fix 🐛

Fixed: Pocket recordings being discarded

  • Pocket recordings are user-initiated, so the LLM discard check is now skipped for ConversationSource.pocket
  • Ensures all Pocket recordings appear as conversations in the app

How It Works

  1. User connects to Pocket device via BLE
  2. App downloads MP3 recordings and creates WAL files
  3. Backend converts MP3→WAV, segments with VAD, and transcribes
  4. Conversations appear in main feed with "Pocket" source tag

Files Changed

21 files changed, 1741 insertions(+), 18 deletions(-)

Key new files:

  • app/lib/pages/pocket/pocket_device_page.dart - Pocket recordings UI
  • app/lib/services/devices/pocket_connection.dart - BLE protocol
  • backend/routers/pocket.py - MP3 processing endpoint

Testing

✅ Fully tested end-to-end with physical Pocket device (PKT01_BLUE)

Test: Connect Pocket device → Download recordings → Verify conversations appear in main feed

Breaking Changes

None - purely additive feature

@beastoin
Copy link
Collaborator

if the raw codec of pocket is mp3, i’d like to support it on the backend side.

currently, we have supported: opus, lc3, aac, pcm fyi.

- Add PocketDeviceConnection with battery polling and storage info
- Implement Pocket recordings UI with download functionality
- Add device type detection for Pocket devices (PKT01 prefix)
- Fix device type persistence for Pocket devices
- Add null safety improvements for device locator
- Display storage in GB and battery level correctly
- Sequential loading: device info then recordings list
- Add PocketWalService to create WAL files from Pocket MP3 recordings
- Implement download and sync flow in PocketDevicePage
- Add 'pocket' to ConversationSource enum for tagging
- Add MP3 converter service (prepared for future client-side conversion)
- Add audioplayers dependency
- Fix WAL storage to use disk storage instead of sdcard
- Add initializeWals() public method to reload WALs after saving
- Force reload WALs in phone sync service after adding Pocket recordings
- Add DeviceType.pocket case to device image switch
- WALs now appear correctly in Sync page after download
- Add complete Pocket device integration with BLE communication
- Add Pocket MP3 download and WAL sync service
- Add Pocket recordings UI page
- Add ConversationSource.pocket enum value
- Fix: Skip discard check for Pocket recordings (user-initiated)
- Add pocket router endpoint for MP3 uploads
- Add Pocket device models and connection handling
- Update device detection and provider for Pocket support
@yconst yconst changed the title Add Pocket Recordings Download and WAL Sync Integration Add Pocket Device Support Nov 12, 2025
@aaravgarg
Copy link
Collaborator

@yconst is this ready?

@yconst
Copy link
Author

yconst commented Nov 17, 2025

@yconst is this ready?

Yeap, it is ready

@yconst
Copy link
Author

yconst commented Nov 17, 2025

if the raw codec of pocket is mp3, i’d like to support it on the backend side.

currently, we have supported: opus, lc3, aac, pcm fyi.

I added backend support for mp3 codec

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.

3 participants