Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
[Linux] Fix Main menu Audio not playing & custom campaigns
By Mono
This solves a long-hauting issue regarding the MP3 audio not properly played on Linux.
   
Award
Favorite
Favorited
Unfavorite
Tl;dr
Symptom

This game should greet you immediately with some ambient music when you login to the Main menu, while on Linux, it's completely silence. Also, when playing some custom campaigns, I also noticed my friends (who play on windows) could hear some music/voice that I can't hear.

Before we proceed, let's confirm that we are talking about the same problem. Open your game, press tilde key (~), and type this command in console, hit enter:

play #music/l4d2/l4d2_c1_pc.mp3

If you hear nothing, while seeing this output, then we are heading in the same direction:


----

Solution

L4D2 ships a broken version of the Miles sound library for MP3 decoding, which we can do nothing about. However, if you happen to own Portal 2, you can substitute L4D2's libMiles.so with Portal 2's, and it should work properly now:



More
How to download Portal 2 with only Files of interest

DepotDownloader

We can use DepotDownloader[github.com] to download the Portal 2's linux binary depot with a custom file list:

echo "bin/libMiles.so" > downloadlist.txt DepotDownloader -username xxx -app 620 -depot 661 -filelist downloadlist.txt

The username here is your account login name, not the display name.

Use Steam's built-in console

  1. Launch steam with -console argument.
  2. Navigate to the console panel, type download_depot 620 661 5328988903387195448
  3. (You can omit the last arg (the manifest ID) to always download the newest one, but it could subject to future changes.)

Wait for it to finish:


Navigate to that directory (beware the silly backslash in the path)

Bang! It's inside the bin directory:



Some rambling
I discovered this issue tracker in [L4D2 Beta/Linux] Missing music in main menu[github.com]

Scrolling through the threads, someone proposed a solution[github.com], suggesting renaming libmiles.so to libMiles.so should fix this.


Seemed like a resonable mistake :)

But when I looked at the directory (in 2022), I only found the filename had already been renamed to the correct case. So looks like Valve tried to fix this, while breaking it in another way :)

I later stumbled upon another thread about a similar issue but in CS:GO, and found their solution also applied to L4D2, so I replied the newest solution[github.com] in the original issue.

Disclaimer

I only tried Portal 2, but I guess any newer Source engine game could do the job as well.
2 Comments
yrro° 24 Feb @ 12:17pm 
Confirming that this works with build ID 17255556 - thank you!
Olik 20 Nov, 2024 @ 4:08pm 
Apparently newer versions of L4D2 need libmiles.so to be written with lowercase letters