Skip to content
ย 
ย 

Latest commit

ย 

History

240 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Chrome Audio Control Platform (CACP)

Universal Chrome Extension for Audio Control in DeskThing

๐ŸŽ‰ Latest Update: Enhanced CACP with robust image processing and comprehensive logging system (v0.1.3 app / v0.3.26 extension)


๐Ÿ“ Repository Structure

๐ŸŽต Current Working Apps (SoundCloud)

  • soundcloud-app/ - Working SoundCloud DeskThing app (v1.0.1 beta)
  • soundcloud-extension/ - Working Chrome extension for SoundCloud

๐ŸŽฏ Next Generation (CACP Development)

  • cacp-app/ - Universal DeskThing app (v0.1.3) - Enhanced with image processing & comprehensive logging
  • cacp-extension/ - Multi-site Chrome extension (v0.3.26) - 90%+ complete

๐Ÿ› ๏ธ Shared Infrastructure

  • scripts/ - Build tools and utilities
  • docs/ - Organized project documentation
    • docs/cacp/ - CACP architecture and development guides
    • docs/soundcloud/ - Historical SoundCloud implementation docs

๐Ÿš€ CACP Testing & Development Guide

๐Ÿ”ง Building & Version Management

Version Bumping Protocol

Always bump versions when making changes to ensure you're working with the right build:

# CACP App (cacp-app/)
# Edit package.json and deskthing/manifest.json - increment version
# Example: 0.1.3 โ†’ 0.1.4

# CACP Extension (cacp-extension/)  
# Edit manifest.json - increment version
# Example: 0.3.26 โ†’ 0.3.27

# Rebuild both after version changes

Building CACP App

cd cacp-app
npm run build
# Output: dist/cacp-v[VERSION].zip

Building CACP Extension

cd cacp-extension  
npm run build
# Output: dist/ folder for Chrome extension loading

๐ŸŽฏ Installation & Testing

1. Install CACP App in DeskThing

  1. Build the CACP app: cd cacp-app && npm run build
  2. Open DeskThing Desktop App
  3. Navigate to Apps โ†’ Install App โ†’ Local Installation
  4. Select cacp-app/dist/cacp-v[VERSION].zip
  5. Install and start the CACP app

2. Load CACP Extension in Chrome

  1. Build the extension: cd cacp-extension && npm run build
  2. Open Chrome โ†’ Extensions โ†’ Developer Mode (ON)
  3. Load Unpacked โ†’ Select cacp-extension/dist/ folder
  4. Pin the CACP extension to toolbar for easy access

3. Test Integration

  1. Start CACP app in DeskThing (should show "Ready for Chrome extension connections")
  2. Navigate to SoundCloud or YouTube in Chrome
  3. Open CACP extension popup (should show site detection)
  4. Play music and test controls from DeskThing device

๐Ÿ“Š Logging & Debugging

๐Ÿ” Finding Logs

DeskThing App Logs

Primary Location (macOS):

/Users/[username]/Library/Application Support/DeskThing/logs/readable.log

Alternative Locations:

  • Desktop (macOS): /Users/[username]/Library/Application Support/DeskThing/
  • Device (Linux): ~/.config/DeskThing/logs/ or /var/log/deskthing/
  • Per-app logs: /Users/[username]/Library/Application Support/DeskThing/apps/cacp/logs/

CACP App Log Patterns

Look for these log entries in DeskThing logs:

# Startup logs
๐Ÿš€ [CACP-Server] Starting enhanced CACP app v0.1.3 with comprehensive logging and image processing
โœ… [CACP-Server] CACP App v0.1.3 Started Successfully - Ready for Chrome extension connections

# Connection logs  
๐Ÿ”Œ [CACP-Server] Chrome extension connected from: 127.0.0.1
๐Ÿ“จ [CACP-Server] Received from extension: mediaData (soundcloud)

# Image processing logs
๐Ÿ–ผ๏ธ [CACP-MediaStore] New artwork detected: https://i1.sndcdn.com/...
โœ… [CACP-MediaStore] Artwork cached: /resource/image/cacp/track-artist.jpg

# Media control logs
๐Ÿ“ก [CACP-Server] DeskThing NEXT event received
๐ŸŽฎ [CACP-MediaStore] Sending command to extension: nexttrack

Chrome Extension Logs

Browser Console:

  1. Open Chrome DevTools (F12)
  2. Console tab โ†’ Filter by "CACP"
  3. Look for: Extension version, site detection, WebSocket status

Extension Popup Logs:

  1. Click CACP extension icon
  2. View real-time connection status and logs
  3. Copy logs for debugging (copy button in popup)

๐ŸŽฏ Version Verification

Confirm Correct Versions

# CACP App - Check DeskThing logs for:
๐Ÿš€ [CACP-Server] Starting enhanced CACP app v0.1.3

# CACP Extension - Check popup or console for:
CACP Extension v0.3.26 initialized

# Extension Popup - Shows version in bottom corner
v0.3.26

๐Ÿ› Common Issues & Solutions

No Image Display

  • Check logs for: ๐Ÿ–ผ๏ธ [CACP-MediaStore] New artwork detected
  • Verify: Image processing completes with โœ… [CACP-MediaStore] Artwork cached
  • Path format: Should be /resource/image/cacp/filename.jpg

No Extension Connection

  • Check: ๐Ÿ”Œ [CACP-Server] Chrome extension connected in DeskThing logs
  • Verify: WebSocket server started on port 8081
  • Test: Extension popup shows "Connected" status

No Site Detection

  • Check: Extension popup shows current site
  • Verify: Content script loaded on supported sites
  • Supported: SoundCloud, YouTube (not YouTube Music yet)

๐ŸŽฏ What is CACP?

CACP is a universal Chrome audio control platform that provides seamless music control integration between web-based audio services and DeskThing. Instead of being limited to just SoundCloud, CACP supports multiple music streaming platforms through a modular, contributor-friendly architecture.

๐ŸŽต Supported Sites

โœ… Currently Working (SoundCloud Apps)

  • SoundCloud - Complete implementation with real-time control via soundcloud-extension/

๐Ÿšง CACP Development Status

  • SoundCloud - โœ… Fully migrated to modular architecture (v0.3.26)
  • YouTube - โœ… Handler implementation complete (testing phase)
  • Spotify Web - ๐Ÿ”„ Framework ready, selectors need updates
  • Apple Music Web - ๐Ÿ”„ Basic selectors implemented
  • YouTube Music - ๐Ÿ”„ Framework ready for implementation

๐Ÿ—๏ธ Architecture

Current SoundCloud Architecture

SoundCloud โ†’ Chrome Extension โ†’ SoundCloud App WebSocket (port 8081) โ†’ DeskThing โ†’ Car Thing

CACP Architecture (Enhanced)

Multiple Sites โ†’ Universal Chrome Extension โ†’ CACP App WebSocket (port 8081) โ†’ DeskThing โ†’ Car Thing
                 โ”œโ”€โ”€ Site Detection & Priority
                 โ”œโ”€โ”€ Modular Site Handlers  
                 โ”œโ”€โ”€ Image Processing Pipeline
                 โ”œโ”€โ”€ Comprehensive Logging
                 โ””โ”€โ”€ User Settings UI

Communication: Single WebSocket connection with site identification in messages
Image Processing: Downloads and caches artwork locally at /resource/image/cacp/
Logging: Comprehensive debugging with DeskThing.sendLog throughout all components

๐Ÿ“š Documentation

๐ŸŽฏ CACP Development

๐ŸŽต SoundCloud Legacy


๐Ÿ”„ Current Status & Recent Updates

Current Phase: ๐ŸŽ‰ Enhanced Testing Phase

  • CACP App v0.1.3: Production-ready with image processing & comprehensive logging
  • CACP Extension v0.3.26: 90%+ complete with SoundCloud + YouTube handlers
  • Image Processing: โœ… Fixed - downloads and serves artwork locally
  • Logging System: โœ… Complete - comprehensive debugging throughout

Recent Enhancements (v0.1.3):

  • โœ… Image Processing Pipeline - Borrowed from SoundCloud app, fixes artwork display
  • โœ… Comprehensive Logging - DeskThing.sendLog throughout all components
  • โœ… Enhanced MediaStore - Robust state management and error handling
  • โœ… Dynamic Version Logging - Version numbers in all log outputs
  • โœ… Production Architecture - Proper lifecycle management and resource cleanup

Next Phase: ๐ŸŽฏ Multi-Site Validation

  • Complete extension testing across SoundCloud + YouTube
  • Performance optimization and error recovery
  • Community contribution pipeline

โšก Quick Development Workflow

# 1. Make changes to CACP app or extension
# 2. Bump version numbers in manifests/package.json
# 3. Rebuild both components
cd cacp-app && npm run build
cd ../cacp-extension && npm run build

# 4. Reload in DeskThing and Chrome
# 5. Test with SoundCloud/YouTube
# 6. Check logs for version confirmation and debugging

# 7. Look for version logs:
# ๐Ÿš€ [CACP-Server] Starting enhanced CACP app v0.1.3
# CACP Extension v0.3.26 initialized

Evolution Path: SoundCloud App โ†’ Chrome Audio Control Platform (CACP)
Current Focus: Extension validation and multi-site testing with comprehensive logging
Image Processing: โœ… RESOLVED - Local artwork caching working reliably

About

Chrome Audio Control Platform (CACP) - Universal Chrome extension for audio control in DeskThing, featuring SoundCloud and multi-site support

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages