Fix: Immich Audio Bug On Firefox

by Kenji Nakamura 33 views

Introduction

Hey guys! Having trouble with your Immich video playback in Firefox? You're not alone! This article dives into a specific bug where audio fails to play for videos within the Immich web interface when using Firefox or Zen Browser. We'll explore the issue, its symptoms, and potential causes, and hopefully, this will help shed light on the problem and find solutions. So, letโ€™s get started and figure out why your videos are playing silently in Firefox!

The Bug: No Audio in Firefox for Immich Videos

The main issue reported is that audio from videos doesn't play when accessed through the Immich web interface on Firefox and Zen Browser. The videos themselves play fine, but there's no sound. This is particularly frustrating since the same videos play with audio on other browsers like Chrome, and the audio works when playing the files directly from the file explorer.

Symptoms

  • Videos play in Firefox and Zen Browser, but there's no audio.
  • The volume button in the player interface is grayed out and not clickable, indicating that audio is not being detected or enabled for the video.
  • The same videos play with sound in Chrome (including mobile versions).
  • Playing the video files directly from the file system (e.g., using a media player) results in normal audio playback.
  • Audio works fine in Firefox and Zen Browser for other sources, such as music or videos from other websites.
  • The issue seems specific to Immich, suggesting a problem with how Immich handles audio playback in these browsers.
  • Not all videos are affected; some videos do play with sound, adding to the mystery.

Potential Causes

Several factors could contribute to this no audio in Firefox bug. These can include:

  1. Codec Incompatibility: Firefox might not support the audio codec used in some of the video files. While Immich transcodes videos, there might be edge cases or specific codec combinations that aren't handled correctly. This is a common culprit when dealing with video playback issues across different browsers.
  2. Browser-Specific Issues: There could be specific settings or configurations within Firefox that interfere with audio playback from Immich. This could include privacy settings, content blocking features, or extensions that are inadvertently blocking audio.
  3. Immich Configuration: While the user mentioned that videos are properly transcoded, there might be specific Immich settings related to transcoding profiles or audio handling that need to be adjusted. Incorrect settings could lead to audio streams not being properly processed for Firefox.
  4. Content Delivery Issues: In some cases, the way Immich serves the video content to the browser could be the issue. If the audio stream isn't being delivered correctly, Firefox won't be able to play it. This could be due to server-side configurations or how the video player within Immich is set up.
  5. JavaScript Errors: The Immich web interface relies heavily on JavaScript for video playback. Errors in the JavaScript code could prevent the audio from being initialized or played correctly. Checking the browser's developer console for JavaScript errors can sometimes provide clues.
  6. Hardware Acceleration: Although less likely, hardware acceleration settings in Firefox could sometimes cause issues with video playback. Disabling hardware acceleration can be a troubleshooting step to see if it resolves the audio problem.

User Environment

The user provided valuable information about their setup, which helps in narrowing down the potential causes:

  • Operating System: Truenas ElectricEel-24.10.2.1 is the OS running the Immich server.
  • Immich Server Version: v1.137.3
  • Immich Mobile App Version: v1.137.3
  • Platform: The issue is occurring on the web platform.
  • Docker Compose: The user provided their docker-compose.yml file, which is crucial for understanding how Immich is set up and configured. This file helps in identifying potential network issues, volume mappings, and other configuration details.
  • .env Content: The user also shared their .env file, which contains sensitive information like database credentials and user IDs. This information is useful for debugging but should be handled carefully to avoid security risks.

Docker Compose Configuration

The provided docker-compose.yml file gives us a detailed look at the user's setup. Here are some key observations:

  • Services: The setup includes immich-server, immich-machine-learning, redis, and database services, which is a standard Immich deployment.
  • Networking: The services are connected via the immich network, and the immich-server is also connected to a reverse-proxy network. This indicates that the user is using a reverse proxy (likely Traefik) to manage external access to Immich.
  • Traefik Configuration: The immich-server service has labels for Traefik, indicating that Traefik is used as a reverse proxy. This setup includes both public and private routes (immich.example.com and immich.example.net), suggesting the user has different access rules for different networks.
  • Volumes: The immich-server service mounts several volumes, including ./library:/usr/src/app/upload and /mnt/media/drive/thomas/media/photos:/usr/src/app/upload/library/thomas. This shows where the user's media files are stored and how they are accessed by Immich.
  • Hardware Acceleration: The hwaccel.transcoding.yml file is commented out, suggesting that hardware acceleration for transcoding is not currently enabled. This could be a factor in performance but is less likely to directly cause audio issues.
  • Database: The database service uses tensorchord/pgvecto-rs:pg14-v0.2.0, which is a PostgreSQL image with vector support. This is a common setup for Immich.

.env Configuration

The .env file contains environment variables used by the Immich services. Key configurations include:

  • IMMICH_PUID and IMMICH_PGID: These are the user and group IDs for the Immich user, which are important for file permissions.
  • Database Credentials: DB_USERNAME, DB_DATABASE_NAME, and DB_PASSWORD are used to connect to the PostgreSQL database.
  • IMMICH_PROCESS_INVALID_IMAGES='true': This setting ensures that Immich attempts to process even potentially invalid images.
  • IMMICH_LOG_LEVEL='debug': This is helpful for troubleshooting, as it enables more detailed logging.

Reproduction Steps

The user provided clear steps to reproduce the issue:

  1. Click on a video with sound.
  2. Observe that the volume button is not clickable, and there is no audio.

This straightforward reproduction process makes it easier to test potential solutions and verify if the issue is resolved.

Log Output

Interestingly, the user reported no relevant log output. This could mean that the issue is occurring at a level where it's not being logged, such as within the browser's media player or in the JavaScript code. It also suggests that the problem might not be server-side.

Troubleshooting Steps

Given the information provided, here are several troubleshooting steps that can be taken to diagnose and potentially fix the audio issue:

  1. Check Firefox Settings:

    • Volume Mixer: Ensure that Firefox isn't muted in the system's volume mixer. Sometimes, a browser can be muted at the system level without the user realizing it.
    • Permissions: Verify that Firefox has permission to play audio. Check Firefox's settings for site-specific permissions and ensure that Immich is allowed to play sound.
    • Content Blocking: Disable any content blocking features or extensions that might be interfering with audio playback. This includes privacy extensions, ad blockers, and script blockers. Try testing in a private browsing window, which typically disables extensions by default.
  2. Inspect Browser Console:

    • Open the browser's developer console (usually by pressing F12) and check for any JavaScript errors or warnings. Errors in the JavaScript code could be preventing the audio from playing correctly.
    • Look for any messages related to media playback or audio initialization. These messages might provide clues about what's going wrong.
  3. Test Different Video Files:

    • Try playing a variety of video files with different codecs and formats. This can help determine if the issue is specific to certain types of videos or if it affects all videos.
    • Check the video file's metadata to see what audio codec is being used. Compare this to the codecs supported by Firefox.
  4. Transcoding Profiles:

    • Review the Immich transcoding settings to ensure that the audio streams are being properly transcoded for web playback. Consider experimenting with different transcoding profiles to see if one works better with Firefox.
    • Ensure that the audio codec used in the transcoded videos is compatible with Firefox. Common codecs like AAC or MP3 are generally well-supported.
  5. Network Issues:

    • Although less likely, there could be network-related issues affecting the delivery of audio streams. Check the browser's network tab in the developer console to see if the audio streams are being requested and delivered correctly.
    • Ensure that there are no firewall rules or network configurations that might be blocking audio traffic.
  6. Update Immich and Firefox:

    • Make sure that both Immich and Firefox are running the latest versions. Software updates often include bug fixes and performance improvements that could resolve the audio issue.
    • Check for any known issues or bug reports related to audio playback in Immich or Firefox.
  7. Hardware Acceleration:

    • Try disabling hardware acceleration in Firefox settings. Sometimes, hardware acceleration can cause issues with media playback on certain systems.
    • Restart Firefox after changing this setting to ensure it takes effect.
  8. Docker Configuration:

    • Review the docker-compose.yml file and .env file for any misconfigurations. Pay close attention to volume mappings, network settings, and environment variables related to media processing.
    • Check the Immich server logs for any errors or warnings related to media processing or transcoding.
  9. Direct File Access:

    • Try accessing the video files directly from the Immich server's file system (e.g., using a file share or SSH). If the audio plays correctly when accessed directly, this suggests that the issue is specific to the Immich web interface.

Next Steps and Community Support

If you're still encountering the Immich Firefox audio bug, don't worry! There are more avenues to explore:

  • Immich Community: Engage with the Immich community forums or discussion boards. Other users might have encountered the same issue and found a solution. Sharing your experience and troubleshooting steps can help others and potentially lead to a fix.
  • GitHub Issues: If the problem persists and you've gathered enough information, consider opening a new issue on the Immich GitHub repository. Provide detailed information about your setup, the steps to reproduce the issue, and any error messages or logs you've collected. This helps the Immich developers investigate and address the bug.
  • Professional Help: If you're comfortable with it, you might also seek help from a professional who specializes in Docker, web servers, or media streaming. They may be able to identify the root cause and provide a solution tailored to your environment.

Conclusion

The Immich no audio in Firefox bug can be frustrating, but with a systematic approach to troubleshooting, it can often be resolved. By checking browser settings, inspecting the console, testing different video files, and reviewing Immich configurations, you can narrow down the cause and find a solution. Remember to engage with the Immich community and provide detailed information when seeking help. Hopefully, this guide has provided you with the knowledge and steps needed to get your videos playing with sound in Firefox! Good luck, and happy viewing!