ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
650 stars 76 forks source link

The Use of MP3's in a L4D2 Campaign May Cause a Client to Crash #3445

Open buckwangs opened 3 years ago

buckwangs commented 3 years ago

Your system information

OS: Manjaro Linux x86_64
Host: X570 AORUS PRO WIFI -CF
Kernel: 5.8.18-1-MANJARO
Uptime: 11 hours, 54 mins
Packages: 1410 (pacman)
Shell: zsh 5.8
Resolution: 3840x2160, 2160x3840
DE: Plasma 5.20.3
WM: KWin
Theme: Breeze [Plasma], Adwaita [GTK2], Default [GTK3]
Icons: breath2-dark [Plasma], breath2-dark [GTK2/3]
CPU: AMD Ryzen 9 3900X (24) @ 3.800GHz
GPU: NVIDIA GeForce GTX 980
GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590
Memory: 15125MiB / 64264MiB

Please describe your issue in as much detail as possible:

An excellent campaign just recently appeared on the workshop Buried Deep and this campaign used to crash me on intro and on outro. I reached out to the author who was interested in solving the issue, and working together, we figured it out. It seems like an easy trap most authors may unintentionally fall into which may possibly ruin the game for any client playing on Linux.

Before I go posting the very little I know (the author has all the details and fix for the issue), I'd like to confirm this would be the best place to post this type of bug report for a possible fix. The gist of the bug is the use of mp3's can cause a Linux client to crash. Should I invite the author to explain the details?

Yetoo1 commented 3 years ago

Yes.

Zanieon commented 3 years ago

Hello, i'm the creator of the Buried Deep campaign, and buckwangs notified me about the issue being tracked in here.

So from what i discovered, mp3 files being played specifically in the music channel of the game can instantly cause a crash.

This is what i used previously to define the intro cinematic music of my campaign (i used the vanilla campaigns definitions as base), this one and the outro music were the only ones which was mp3 files, due to their lenght, i've opted to compress them as mp3 to save space in the vpk.

"Event.MissionStart_BuriedDeep"
{
    "channel"       "CHAN_STATIC"
    "volume"        "1.0"
    "soundlevel"    "SNDLVL_NONE"

    "rndwave"
    {
        "wave"          "@#music/stmusic/bdp_hellgateintro.mp3"
    }
    GameData
    {
        "MusicTrack"            "checkpoint"
        "MusicAutoQueue"        "Event.MissionStart_BaseLoop_BuriedDeep"
        "MusicPriority"         "MEDIUM"
        "MusicParameters"       "AFTER_DEATH"
        "MusicMaster"           "PLAY_TO_END"   
        "MusicMasterTags"
        {
            "loopStart" "116.0"
        }
    }
}

Also playing mp3 files from the _ambientmusic entity can cause the same issue, all what the file needs to be is mp3 and playing in the music channel. Mp3 files played in the regular audio channel through _ambientgeneric entity seems to get ignored and don't even play. The specifications of the mp3 files i used are: Bitrate: 128kbps CBR Sample quality: 44.1Khz Channels: Stereo

I don't have any short example to provide right now. But if needed i think i can prepare a test vpk with a simple map and mp3 file to help debugging this.

yxnan commented 2 years ago

Mp3 never works on me. Any custom campaigns with mp3 as the audio format are just silent. It seems the linux build of l4d2 doesn't have a proper mp3 support because even the valve's stock sound won't play (there are only two mp3 files tho, located in sound/music/l4d2/).

I searched valve's articles saying they are using Miles library for mp3 support, and I actually find libmiles.so in the bin folder, but I have no idea why it won't work.

For some really good custom campaigns, I have to patch the bsp file and convert those mp3 to wav to get them work, which is a subpar workaround since by altering the stringtables I can then only play it in singleplayer.