Fixed major issues with dependencies, camera controller, speedtest not working#3
Open
JugglerMaster wants to merge 3 commits into
Open
Fixed major issues with dependencies, camera controller, speedtest not working#3JugglerMaster wants to merge 3 commits into
JugglerMaster wants to merge 3 commits into
Conversation
added 3 commits
July 2, 2026 13:38
- Enable camera at startup with error handling (was never called) - Add missing return in camera.get_frame() success path (was returning None, causing black screen) - Wrap PyAudio init in whitenoise with try/except to prevent hangs - Add 15s timeout to quick_speed_test() to prevent startup blockage - Fix whitenoise __close method (recursion and attribute bugs) - Create media/audio directory if missing
pip install pyaudio from source requires portaudio.h (from portaudio19-dev). Also add python3-dev for build tools and enable --system-site-packages in the venv so system-installed packages (picamera2, etc.) are accessible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes camera not showing live feed, startup hangs on headless systems, and missing build dependencies for ARM64.
Changes
🎥 Camera: Enable at startup + fix black screen
Files:
src/main.py,src/controllers/camera.pyCameraControllerwas instantiated butenable()was never called —get_frame()always returned a noise/black fallback frame. Addedcamera.enable()with error handling at startup.get_frame()had noreturnin the success path of the try/except block. Whencapture_array()succeeded, the function returnedNoneimplicitly, causing a black screen in the WebRTC video track.🔊 WhiteNoisePlayer: Handle missing audio hardware
File:
src/controllers/whitenoise.pypyaudio.PyAudio()called without error handling hangs indefinitely on systems without working audio (e.g. headless Raspberry Pi). Wrapped in try/except soself.pisNoneon failure.hasattr(self, 'stream')guards to preventAttributeErrorwhen__openSpeaker()was never called or failed.__close()method that had infinite recursion (stop()→__close()→stop()) and accessedself.streamafter closing.⏱ Speed test: Add timeout to prevent startup hang
File:
src/utils.pyquick_speed_test()usesspeedtest-cliwhich can hang indefinitely on networks with no internet or poor connectivity. Wrapped the test in aThreadPoolExecutorwith a 15-second timeout so the server starts regardless.📦 packages.txt: Add build deps for ARM64
File:
src/packages.txtpyaudiofails topip installon aarch64 becauseportaudio.his missing. Addedportaudio19-dev(headers) andpython3-dev(build tools) so the C extension compiles successfully.