Skip to content

daryljones/DLI-TEA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DLI-TEA: Digital Loggers Inc. 16-Channel Audio Streamer

A Python application for streaming 16-channel communications audio from Digital Loggers Inc. devices to Icecast servers on Linux.

Information about the Digital Loggers Inc. device is available at https://dlidirect.com/products/16-channel-usb-call-logger. It is an excellent product. If this software doesn't work properly, it is not the fault of the DLI product.

🎯 Overview

DLI-TEA interfaces with Digital Loggers Inc. 16-channel audio recording devices to provide real-time streaming to Icecast servers. Perfect for emergency services, public safety communications, and professional audio monitoring.

πŸ”§ Hardware Requirements

  • Device: Digital Loggers Inc. 16-channel communications audio recorder
  • Controller: XILINX XC95144 CPLD with 16x WM8510G Audio Codecs
  • USB Interface: FTDI FT2232H Dual Channel (VID: 0403, PID: 6010)
  • Serial Number: FTWIQIS4 (device-specific)
  • Platform: Linux (tested on Ubuntu 20.04+) and macOS
  • USB: USB 2.0/3.0 port for device connection

✨ Features

  • 16-Channel Audio Streaming: Real-time streaming of all 16 audio channels (16x WM8510G codecs)
  • Sample Rate: 3049 Hz per channel with 16-bit depth
  • WAV Recording: Simultaneous streaming and multi-channel WAV file recording
  • LCD Status Monitoring: Enhanced terminal-based status monitoring (LCD protocol proprietary)
  • Configuration-Driven: JSON-based device and streaming configuration
  • Icecast Integration: Professional streaming server integration
  • Production Ready: Robust error handling, logging, and graceful LCD timeout handling
  • FTDI Interface: High-speed USB data transfer via pyftdi (FT2232H)
  • Hardware Verified: Configuration based on actual hardware disassembly and analysis

πŸš€ Quick Start

Prerequisites

# Linux (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install libusb-1.0-0-dev python3-dev icecast2

# Audio format conversion dependencies
sudo apt-get install ffmpeg lame

# Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh

Note: FFmpeg and LAME are required for audio format conversion (MP3, OGG, etc.)

Installation

# Clone and setup
git clone <repository-url>
cd DLI-TEA
uv sync

# Configure your device and Icecast settings
cp config.json.example config.json
# Edit config.json with your device serial and Icecast credentials
# See CONFIG_SETUP.md for detailed instructions

Basic Usage

# Test 16-channel configuration
uv run python test_16ch_config.py

# Enhanced streaming with status monitoring
uv run python dli_enhanced_streamer.py

# Streaming with WAV recording
uv run python dli_streamer_with_recording.py

# Production streaming
uv run python dli_production_streamer.py

# Record 16-channel sample
uv run python record_16ch_sample.py

# Test LCD functionality (timeouts expected)
uv run python test_lcd_display.py

πŸ“ Project Structure

DLI-TEA/
β”œβ”€β”€ dli_streamer.py              # Core 16-channel device interface
β”œβ”€β”€ dli_enhanced_streamer.py     # Enhanced streaming with status monitoring
β”œβ”€β”€ dli_streamer_with_recording.py # Streaming + WAV recording
β”œβ”€β”€ dli_production_streamer.py   # Production-ready streamer
β”œβ”€β”€ dli_status_monitor.py        # Real-time status monitoring
β”œβ”€β”€ dli_lcd_controller.py        # LCD control framework (protocol unknown)
β”œβ”€β”€ dli_lcd_research.py          # LCD protocol analysis
β”œβ”€β”€ config.json                  # 16-channel device configuration (not in git)
β”œβ”€β”€ config.json.example          # Template configuration (safe to commit)
β”œβ”€β”€ CONFIG_SETUP.md              # Configuration setup instructions
β”œβ”€β”€ test_16ch_config.py          # 16-channel configuration test
β”œβ”€β”€ test_lcd_display.py          # LCD functionality test
β”œβ”€β”€ record_16ch_sample.py        # 16-channel sample recording
β”œβ”€β”€ dli_16ch_hardware_verified.wav # Verified 16-channel sample
β”œβ”€β”€ recordings/                  # Output WAV files directory
β”œβ”€β”€ docs/                        # Documentation
└── examples/                    # Usage examples

βš™οΈ Configuration

Device Configuration (config.json)

The 16-channel DLI device configuration:

{
  "device": {
    "name": "Digital Loggers Inc. 16-Channel Audio Recorder",
    "serial_number": "FTWIQIS4",
    "vendor_id": "0x0403",
    "product_id": "0x6010",
    "description": "FT2232H Dual Channel - 16x WM8510G Codecs",
    "sample_rate": 3049,
    "bits_per_sample": 16,
    "total_channels": 16
  },
  "global_settings": {
    "enable_lcd_control": false,
    "logging_level": "INFO",
    "chunk_size": 2048,
    "buffer_size": 65536
  },
  "icecast": {
    "server": "localhost",
    "port": 8000,
    "password": "hackme",
    "mount": "/dli_audio.mp3"
  }
}

Hardware Specifications

Audio Codec Details

  • Controller: XILINX XC95144 CPLD (main controller)
  • Audio Codecs: 16x WM8510G (Wolfson/Cirrus Logic)
  • Channel Count: 16 (one codec per channel)
  • Sample Rate: 3049 Hz per channel
  • Bit Depth: 16-bit
  • Interface: FTDI FT2232H (dual channel USB)

Device Identification

  • USB VID:PID: 0403:6010 (FTDI FT2232H)
  • Serial Number: FTWIQIS4
  • Description: "USB <-> Serial Converter"

LCD Display Status

Hardware Limitation:

  • Front Panel LCD: Shows "Waiting for PC" (proprietary protocol)
  • Protocol: DLI-specific commands (documentation not available)
  • Timeout Behavior: Standard LCD commands result in USB timeouts
  • Solution: Enhanced terminal-based status monitoring

Status Monitoring Features:

🎧 DLI DEVICE STATUS MONITOR
=====================================
πŸ”Œ Device Status: CONNECTED (2m 45s)
🎡 Streaming Status: ACTIVE (2m 30s)
πŸ“Š Active Channels: 16/16
πŸ“ˆ Total Samples: 487,235
⚑ Data Flow: 🟒 LIVE  
πŸ’š Device Health: 🟒 EXCELLENT

Available Streaming Options

  • Enhanced Streaming: dli_enhanced_streamer.py - Real-time status monitoring
  • Recording Mode: dli_streamer_with_recording.py - Stream + WAV recording
  • Production Mode: dli_production_streamer.py - Production-ready operation
  • Sample Recording: record_16ch_sample.py - Create 16-channel WAV samples

πŸ”§ Advanced Usage

Device Connection Testing

# Check FTDI device detection
uv run python -c "
from pyftdi.ftdi import Ftdi
devices = Ftdi.list_devices()
print('Available FTDI devices:')
for device in devices:
    print(f'  {device}')
"

# Test 16-channel configuration
uv run python test_16ch_config.py

# Verify hardware with sample recording
uv run python record_16ch_sample.py

LCD Control Configuration

# Disable LCD initialization (recommended)
# In config.json:
"global_settings": {
  "enable_lcd_control": false
}

# Enable LCD attempts (will timeout with proprietary protocol)
"global_settings": {
  "enable_lcd_control": true
}

Production Deployment

# Create systemd service
sudo cp scripts/dli-streamer.service /etc/systemd/system/
sudo systemctl enable dli-streamer
sudo systemctl start dli-streamer

# Monitor logs
journalctl -u dli-streamer -f

πŸ§ͺ Testing

# Test 16-channel device configuration
uv run python test_16ch_config.py

# Test LCD timeout handling
uv run python test_lcd_graceful.py

# Verify LCD is disabled
uv run python test_lcd_disabled.py

# Record verification sample
uv run python record_16ch_sample.py

# Test enhanced streaming
uv run python dli_enhanced_streamer.py

πŸ“Š Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Digital Loggers Device  β”‚ ← 16-channel audio input
β”‚ XILINX XC95144 + 16x    β”‚ ← CPLD + WM8510G codecs
β”‚ WM8510G Audio Codecs    β”‚
β”‚ (FTDI FT2232H USB)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚ USB data stream (3049Hz Γ— 16ch)
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   DLIAudioDevice        β”‚ ← pyftdi interface
β”‚ β€’ FTDI FT2232H comm     β”‚
β”‚ β€’ Device detection      β”‚  
β”‚ β€’ 16-channel parsing    β”‚
β”‚ β€’ Sample rate: 3049Hz   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚ 16-channel audio data
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Enhanced Streaming     β”‚ ← Status monitoring
β”‚ β€’ Real-time monitoring  β”‚
β”‚ β€’ WAV recording         β”‚
β”‚ β€’ Terminal status       β”‚
β”‚ β€’ LCD timeout handling  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚ Processed streams
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Icecast Integration    β”‚ ← Audio distribution
β”‚ β€’ MP3 streaming         β”‚
β”‚ β€’ Multi-channel WAV     β”‚
β”‚ β€’ Status monitoring     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Audio Quality & Troubleshooting

Pulsing Noise Fix

DLI-TEA includes advanced audio processing to eliminate pulsing noise and artifacts:

  • Consistent Chunking: Fixed 800-sample chunks (~100ms) for stable encoding
  • DC Offset Removal: Eliminates low-frequency pulsing from DC bias
  • Soft Clipping: Prevents harsh digital artifacts from audio peaks
  • Smooth Streaming: Thread-safe buffering with consistent timing
  • Optimized Encoding: Efficient MP3/audio format conversion

Diagnostic Tools

# Test audio format conversion quality
uv run python test_audio_formats.py

# Diagnose audio quality issues
uv run python diagnose_audio.py

# Verify pulsing noise fixes
uv run python test_pulsing_fix.py

Common Audio Issues

Issue Cause Solution
Pulsing noise Inconsistent chunks, DC offset Use smooth streaming (automatic)
Clipping artifacts Audio levels too high Enable soft clipping in config
Low volume Gain settings Adjust audio.gain in config.json
Format errors Codec issues Check FFmpeg/LAME installation

Audio Configuration Tips

{
  "audio_format": {
    "output_format": "mp3",    // Use mp3 for best compatibility
    "quality": "high",         // Use high for clear audio
    "sample_rate": 8000,       // Match DLI device rate
    "channels": 1              // Communications audio is mono
  },
  "audio": {
    "gain": 1.0,              // 1.0 = no change, >1.0 = boost
    "high_pass_filter": true, // Remove low frequency noise
    "noise_gate": true        // Reduce background noise
  }
}

οΏ½ Hardware Analysis

Physical Disassembly Results

Based on hardware disassembly, the DLI device contains:

  • 1x XILINX XC95144 TQ100AEM0017: CPLD controller chip
  • 16x WM8510G Audio Codecs: Wolfson/Cirrus Logic audio ICs
  • FTDI FT2232H Interface: Dual-channel USB-to-serial converter
  • Configuration: One audio codec per channel = 16 total channels

Hardware Verification

# Verify 16-channel configuration
uv run python test_16ch_config.py

# Record hardware-verified 16-channel sample
uv run python record_16ch_sample.py

# Check generated WAV file
file dli_16ch_hardware_verified.wav
# Output: WAVE audio, Microsoft PCM, 16 bit, 16 channels 3049 Hz

οΏ½πŸ› οΈ Development

# Install development dependencies
uv sync --dev

# Test device connection
uv run python test_16ch_config.py

# Test streaming functionality
uv run python dli_enhanced_streamer.py

πŸ“ Dependencies

Core Dependencies

  • pyftdi>=0.54.0 - FTDI device communication
  • pyusb>=1.2.1 - USB device interface

System Dependencies

  • libusb-1.0-0-dev - USB library
  • icecast2 - Streaming server
  • python3-dev - Python development headers

πŸ”§ Troubleshooting

Device Not Found

# Check USB connection (correct VID:PID for FT2232H)
lsusb | grep "0403:6010"

# Check for specific serial number
lsusb -v | grep -A 10 -B 10 "FTWIQIS4"

# Test FTDI device detection
uv run python -c "from pyftdi.ftdi import Ftdi; print(Ftdi.list_devices())"

# Check permissions
groups | grep dialout

# Reset USB
sudo udevadm control --reload-rules

Icecast Connection Issues

# Check Icecast status
sudo systemctl status icecast2

# Test connection
curl http://localhost:8000/admin/

# Check mount limits in /etc/icecast2/icecast.xml

LCD Display Issues

# LCD shows "Waiting for PC" - this is normal
# The device uses proprietary LCD protocol

# Disable LCD timeout attempts
# Set "enable_lcd_control": false in config.json

# Test that LCD timeouts are handled gracefully
uv run python test_lcd_graceful.py

# Use terminal status monitoring instead
uv run python dli_enhanced_streamer.py

πŸ“„ License

This project is open source. See LICENSE file for details.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Run tests: uv run pytest
  4. Submit a pull request

Professional Communications Audio Streaming Solution

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages