Commit Graph

40 Commits

Author SHA1 Message Date
ComputerTech 0ec02507b3 fix: check both _ffmpeg_proc and _srt_ffmpeg_proc in stream.mp3 route 2026-04-04 14:35:35 +01:00
ComputerTech 20bedad639 fix: log ffmpeg stderr in SRT reader to expose connection errors 2026-04-04 14:19:35 +01:00
ComputerTech 0e0be1069b fix: remove publisher_ip NameError; replace eventlet.tpool with direct IO 2026-04-04 14:08:34 +01:00
ComputerTech 9150d3cc83 feat: remove SRT IP allowlist 2026-04-04 13:59:25 +01:00
ComputerTech 1174b65b7d feat: add gunicorn production server with start/stop/restart manager 2026-04-04 13:21:05 +01:00
ComputerTech 075deff7bd fix: remove HLS video player from listener page 2026-04-04 13:12:24 +01:00
ComputerTech c4d9fad60f fix: change SRT port default from 5005 to 8890 (MediaMTX default) 2026-04-04 13:00:41 +01:00
ComputerTech effb52c5df fix: revert listener port to 5001; set SRT port to 5005 via mediamtx_srt_port config 2026-04-04 12:39:03 +01:00
ComputerTech 498832bdcb chore: change listener port from 5001 to 5005 2026-04-04 12:36:37 +01:00
ComputerTech 3c0174ff31 feat: MediaMTX SRT integration, IP allowlist, pre-roll bugfixes 2026-04-04 12:33:45 +01:00
ComputerTech 80a4286bc0 fix: defer broadcast_started for Qt MP3-direct mode until first audio chunk
Previously, start_broadcast immediately emitted broadcast_started and
stream_status: active to listeners, even before the DJ pressed play.
Listeners would connect to /stream.mp3, wait 60s with no data, then
disconnect — so music never reached them from the PyQt client.

The web DJ panel was unaffected because it only sends audio_chunk while
music is actively playing, so start_broadcast and data arrive together.

Fix: in MP3-direct mode (Qt client, format=mp3), hold back broadcast_started
and stream_status: active until the very first audio_chunk arrives. The
first chunk guarantees the preroll buffer has data and listeners will
immediately receive audio when they connect.

- _mp3_broadcast_announced flag tracks whether the deferred announcement
  has been sent in the current session
- Resets on stop_broadcast, grace-period auto-stop, and fresh start_broadcast
- Browser (webm/opus) mode is unaffected — announces immediately as before
2026-04-03 13:44:09 +01:00
ComputerTech 35adfa7feb Tauri v2 migration: asset protocol, desktop CSS polish, absolutePath in library 2026-03-28 11:49:00 +00:00
ComputerTech eb3e66ba61 Implement Duplicate Upload Prevention
- Server: /upload rejects existing files with 409 Conflict
- Web: handleFileUpload skips duplicates with toast feedback
- Qt: upload_track blocks duplicate imports and uploads with dialog alert
2026-03-12 19:12:07 +00:00
ComputerTech 2e64870daa UI improvements: glow effects, deck colors, listener count, remove black bar, mobile header fix 2026-03-11 19:34:32 +00:00
ComputerTech 6027f2e973 Fix streaming: bypass ffmpeg for MP3 input, fix PyQt latency, fix routing bugs
- server.py: Add _distribute_mp3() to route MP3 chunks directly to listener
  queues without a second ffmpeg passthrough (halves pipeline latency, removes
  the eventlet/subprocess blocking read that caused the Qt client to fail)
- server.py: dj_start no longer starts ffmpeg for is_mp3_input=True
- server.py: dj_audio routes to _distribute_mp3 vs _feed_transcoder based on format
- server.py: _transcoder_watchdog skips MP3-direct mode
- server.py: stream_mp3 endpoint no longer waits for ffmpeg proc when MP3 direct
- techdj_qt.py: Add -fflags nobuffer + -flush_packets 1 to reduce source latency
- techdj_qt.py: bufsize=0 and read(4096) instead of read(8192) for ~260ms chunks
- listener.js: Reduce broadcast_started connect delay 800ms -> 300ms
2026-03-10 19:54:06 +00:00
ComputerTech af109381c1 Reduce buffering: 250ms DJ chunks, 1024-chunk preroll, X-Accel-Buffering header 2026-03-10 19:32:24 +00:00
ComputerTech 1fa6887efd Fix stream URL detection for custom domains; add listener_url config 2026-03-10 19:07:04 +00:00
ComputerTech dfccec2b48 Stability fixes: loop end-of-track guard, DJ disconnect grace period, StreamingWorker race condition fix, various audit cleanups 2026-03-10 18:53:17 +00:00
ComputerTech 8c3c2613b1 Fix broadcast broken: reconnect loop, listener stuck on waiting
- server.py: Increase ping_timeout 10->60, ping_interval 5->25 to prevent
  frequent socket disconnects during audio streaming
- server.py: Guard dj_start() against reconnect loops - only clear pre-roll
  and emit broadcast_started on a fresh broadcast, not on DJ reconnects
- listener.js: Add polling fallback to transports (websocket-only caused
  silent failure on upgrade error), set reconnectionAttempts to Infinity
- script.js: Same transport fallback fix for DJ panel socket
- techdj_qt.py: Add _broadcast_started flag to StreamingWorker.on_connect
  so streaming_started signal only fires once; reconnects resume silently.
  Reset flag in stop_streaming() for clean next session.
2026-03-09 20:47:52 +00:00
ComputerTech abf907ddfb Fix 6 bugs: remove dead listener code from DJ panel, fix StreamingWorker socket reuse, fix GUI-blocking time.sleep, fix abort import
- script.js: Remove ~500 lines of dead listener mode code (initListenerMode, enableListenerAudio, setListenerVolume, startListenerVUMeter, getMp3FallbackUrl, listener variables). Listener page now uses listener.js exclusively.
- script.js: Remove ?listen=true detection from DOMContentLoaded that could activate broken listener UI on DJ panel.
- script.js: Clean up initSocket() to remove dead listener mode detection logic.
- index.html: Remove dead #listener-mode div (now served by listener.html).
- server.py: Move 'abort' import to top-level Flask import instead of per-request import.
- techdj_qt.py: Fix StreamingWorker to create fresh socketio.Client on each streaming session, preventing stale socket state on reconnect.
- techdj_qt.py: Fix time.sleep(0.2) blocking GUI thread in stop_streaming() by removing it and using try/except for clean disconnect.
2026-03-09 19:16:42 +00:00
ComputerTech 7c33c678aa Fix listener serving DJ panel instead of listener page
- Block DJ-only files (index.html, script.js, style.css) on listener server
- Disable Flask built-in static handler on listener (static_folder=None)
  to prevent it from serving index.html before custom routes
- Add Cache-Control no-store headers to index route to prevent
  nginx/browser from caching stale index.html for listener URL
2026-03-09 19:01:42 +00:00
ComputerTech 5a7f4e81a4 Separate listener page from DJ panel
- Created standalone listener.html, listener.js, listener.css
- Listener server now serves listener.html instead of index.html
- Eliminates flash of DJ panel when loading listener page
- setup_shared_routes() accepts index_file parameter
2026-03-09 18:50:04 +00:00
ComputerTech df283498eb Add config.json system; fix bugs across server.py, script.js, techdj_qt.py
- Add config.example.json with all options: host, dj_port, listener_port,
  dj_panel_password, secret_key, music_folder, stream_bitrate, max_upload_mb,
  cors_origins, debug (copy to config.json to use)
- server.py: drive host/ports/secrets/CORS/upload limit from config.json;
  fix serve_static to use allowlist only; move re import to top-level;
  fix inconsistent indentation in login/logout/before_request handlers
- script.js: fix undefined decks.crossfader in updateUIFromMixerStatus;
  declare mediaRecorder as a proper let variable
- techdj_qt.py: replace blocking time.sleep poll in YTDownloadWorker with
  non-blocking QTimer; fix fragile or-chained lambda in recording reset
2026-03-09 18:02:47 +00:00
ComputerTech b5ea9e8d01 Final bug sweep: fix event param, remove dead code, dedupe CSS; add .gitignore recordings/ 2026-03-05 14:28:17 +00:00
ComputerTech 02f72e2372 Fix buffering issue and app bugs: improve stream delivery, fixed reset UI desync, and EQ naming 2026-01-20 18:14:50 +00:00
ComputerTech 6fc538336a Add remote server support with configurable ports and auto-refresh settings UI 2026-01-20 16:57:01 +00:00
ComputerTech 1606a3a83c Implement native PyQt5 DJ app with ultra-low latency broadcasting and stability fixes 2026-01-19 14:27:06 +00:00
ComputerTech 405efb6472 Add custom keyboard mapping and remove remote stream relay 2026-01-18 14:57:10 +00:00
ComputerTech 508b93125d Optimize Stream: YouTube removal, Latency improvements, Hotel Wi-Fi kit, and Listener sync 2026-01-18 14:16:06 +00:00
3nd3r 81120ac7ea Add remote stream relay feature: relay remote DJ streams to listeners
- Server-side: Added remote URL support in ffmpeg transcoder
- UI: Added relay controls in streaming panel with URL input
- Client: Added start/stop relay functions with socket communication
- Listener: Shows remote relay status in stream indicator
2026-01-03 10:29:10 -06:00
3nd3r 95b01fd436 Add optional DJ panel password 2026-01-03 09:12:57 -06:00
3nd3r 2db40e4547 Switch listener streaming to MP3-only 2026-01-03 08:14:03 -06:00
3nd3r 269da2c569 Fix ffmpeg transcoder timestamp crash 2026-01-02 22:29:32 -06:00
3nd3r 249b1cb210 Add /stream_debug and improve MP3 transcoder startup 2026-01-02 22:27:04 -06:00
3nd3r da7e1b7276 Add MP3 fallback stream when Opus unsupported 2026-01-02 22:17:45 -06:00
3nd3r e8163fb9a2 Improve downloading with yt-dlp fallback and fix listener streaming 2026-01-02 21:20:32 -06:00
computertech312 0fb7bc6f9e moo 2026-01-02 20:00:10 +00:00
Colby Lipsett c32caaf052 Upload files to "/" 2026-01-02 19:38:04 +00:00
Colby Lipsett c835d51824 Delete server.py 2026-01-02 19:37:34 +00:00
Colby Lipsett ec1735b9e3 Upload files to "/" 2026-01-02 18:31:55 +00:00