Black Mesa

Black Mesa

Black Mesa: Blue Shift
 This topic has been pinned, so it's probably important
Cyvo  [developer] Dec 19, 2022 @ 4:44am
Linux Support
Anything regarding Linux Support
-Launcher
-Installation
-Execution
-QtUI
-Troubleshooting
-Workarounds
can be posted here.
< >
Showing 1-15 of 72 comments
xdshot Jul 19, 2021 @ 6:04am 
Something odd with wav encoding
Mind if you share how did you edit audio files?

Something strange happens. While audio files are clearly here, the game tells some audio file are missing.

After messing around with vpk, extracting sound, etc. I found this:
When unaltered, new sounds are not played. When unmout sound vpk, old hl2/bm audios are played. When extract sounds, it's "missing" now. I copied another wav, it plays...
UnstoppableGiant  [developer] Jul 26, 2021 @ 7:51am 
Well the answer is simple: You messed with the files and now they're broken. You might've installed it the incorrect way or have conflicting files.
xdshot Jul 26, 2021 @ 8:34am 
I tried symlinking initially, the way it meant from bat files. That's how I did stumble. Tried copying bshift instead with same result.

Forgot to mention, i played on linux.
Spacefish Jul 26, 2021 @ 3:15pm 
I have the same issue on linux, just copied over the bshift folder, but some sounds are missing.. I guess the linux binary cant either decode some of the WAV because its missing en encoder for that bitrate / frequency or something is wrong with the VPK file..
xdshot Jul 26, 2021 @ 4:10pm 
I researched wav format, tried to figure out it's structure. It appears it just contains RIFF header and... data? I installed software to dump wav info and fix wav if possible. It says everything is ok so i gave up on it.
Spacefish Jul 26, 2021 @ 4:32pm 
i just unpacked the vpk into bshift/sound and added
game+mod bshift/sound
to the gameinfo.txt file.. Worked like a charm, sounds are now playing.

Guess there is some issue with parsing the .vpks for some unknown reason.. Strange that it works for all the other ones with models and such but not for the bshift_sound.vpk

This is not a real solution as this uses hundred of files on your disk instead of the vpks, it works but depending on file system performance it might slow loading / exhaust number of open files.

B.t.w. congratulations on the great mod! It is really well made! I especially like the detailed maps and all the little eastereggs / small activities in them :D
Last edited by Spacefish; Jul 26, 2021 @ 4:35pm
xdshot Jul 26, 2021 @ 4:37pm 
Originally posted by Mike Pence:
i just unpacked the vpk into bshift/sound and added
game+mod bshift/sound
to the gameinfo.txt file.. Worked like a charm, sounds are now playing.

Guess there is some issue with parsing the .vpks for some unknown reason.. Strange that it works for all the other ones with models and such but not for the bshift_sound.vpk

This is not a real solution as this uses hundred of files on your disk instead of the vpks, it works but depending on file system performance it might slow loading / exhaust number of open files.

B.t.w. congratulations on the great mod! It is really well made! I especially like the detailed maps and all the little eastereggs / small activities in them :D
Thanks for figuring out. Will try next time.

Very strange that it works this way...
Spacefish Jul 26, 2021 @ 4:48pm 
Originally posted by xdshot:
Very strange that it works this way...

Not at all, this seems to be some issue where the linux binary isn´t able to parse the .vpk not an issue with the wav sounds.. Probably be readding them to the vpk you somehow change the name/key of that file in the vpk and the binary is able to parse it.

The .wav files are ok / the engine is able to play them like they are.

I thought maybe there is a difference on upper / lowercase, as for example black mesa tries to load UI/button_rollover.wav but it´s ui/button_rollover.wav in the VPK, but it doesn´t work for other sounds as well so probably that´s not the issue.

.VPK file format changed in the past multiple times, there is a v1 version and a v2.
The sound.vpk is v2. However there are some modes, which skip some parts of the path of a file if they are a repeat of the previous files path.. This is indicated by encoding a \0 instead of a \0\0 at the start of the path or something like that. This was introduced in the v1 format but only later used in v2.. The files in bshift are encoded with this "skipping" maybe this is not supported in the version of source they are using for the linux binary or something like that.. Not sure though.. As materials.vpk has skipping as well..

See https://developer.valvesoftware.com/wiki/VPK_File_Format#VPK_2 "Notes" section for details.
mTUX Aug 14, 2021 @ 1:30pm 
Workaround: Not all the sounds and voices are played under Linux.
Some of the sounds/voice overs are not played under Linux. This is already being discussed in topic "Something odd with wav encoding" where Mike Pence found a workaround, here I'm just merely transforming the workaround to a step-by-step guide.

In order to work around this problem the following steps must be taken:
0: To make our life easier let us set this variable containing the path to the steam directory, then change to the mod directory. Execute all the commands in this directory. The dollar sign "$" indicates the command prompt, and the command should be executed as a regular user, but not part of any of the commands.
$ STEAM_COMMON_DIR="/path/to/steam/dir/steamapps/common/" $ cd "$STEAM_COMMON_DIR/Black Mesa/bshift/"

1: Concatenate the sound vpk fragments
The vpk tool which will be used in the next step cannot handle multipart vpk files, so it is need to be concatenated together:
$ cat bshift_sound_dir.vpk bshift_sound_000.vpk bshift_sound_001.vpk > bshift_sound.vpk
This command will create the file "bshift_sound.vpk" which we use in the next step.

2: Unpack the VPK file
The vpk files can be extracted using the vpk tool which is shipped with many source-based games. Unfortunately Black Mesa does not have this tool, therefore you need to install another game to get the vpk tool. I suggest "Synergy" since this is a free mod, and it have a relatively recent version of the vpk tool.
Once you installed Synergy you will have the vpk tool at "$STEAM_COMMON_DIR/Synergy/bin/vpk_linux32". Use the following command to extract the prepared vpk file.
$ LD_LIBRARY_PATH="$STEAM_COMMON_DIR/Synergy/bin" "$STEAM_COMMON_DIR/Synergy/bin/vpk_linux32" bshift_sound.vpk

3: Move the sound files to the proper directory, and delete the temporary/unneeded files:
$ mv bshift_sound./sound/*/ sound/; rm -rf bshift_sound. bshift_sound.vpk

4: Add the sound directory to gameinfo.txt
Open the gameinfo.txt using any texteditor
$ editor gameinfo.txt
Add the following line after the "game+mod bshift" line
"game+mod bshift/sound"
Save the file, and start the game.
Last edited by mTUX; Aug 14, 2021 @ 1:33pm
timvisee 🐧 Aug 17, 2021 @ 1:08pm 
Fantastic finding @Mike.

Had to do the same on Linux to get audio working.

I had trouble with VPK extraction using `vpk_linux32`, so I used a Python implementation instead: https://github.com/ValvePython/vpk



1. `pip3 install vpk`
2. Change to bshift directory in terminal
3. `vpk bshift_sound_dir.vpk -x .`
Humanoid Nov 26, 2021 @ 2:14pm 
Thanks. It works for me.
In topic "Something odd with wav encoding" user with nick "timvisee [Linux]" sugested using "vpk" utility from pip3. It's easier than vpk_linux32.
Payne Dec 1, 2021 @ 11:15am 
It works like a charm!!! Except for the last step (step number 4), which makes no sense and can be skipped.
Payne Dec 1, 2021 @ 1:49pm 
Linux: Install script
!!!ATTENTION, NOT TESTED!!!
It would be good if someone would test the steps and describe the broken one.

#!/usr/bin/env bash STEAMAPPS=~/.steam/steam/steamapps VPK=`find $STEAMAPPS -name "vpk_linux32" | head -n 1` test -z "$VPK" && echo "Error: Missing 'vpk_linux32' - Install Synergy for Half-Life" && exit 1 # A. Install mod from workshop # B. Create symlink pushd "${STEAMAPPS}/common/Black Mesa" ## B.1 Remove old Blue Shift test -h bshift && rm bshift ## B.2 Create new symlink ln -s ./ $STEAMAPPS/workshop/content/362890/2424633574/bshift # C. Fix audio pushd bshift ## C.1 Prepare sound file cat bshift_sound_dir.vpk bshift_sound_000.vpk bshift_sound_001.vpk > bshift_sound.vpk ## C.2 Use `vpk_linux32` to convert sound file LD_LIBRARY_PATH="${VPK%vpk_linux32}" $VPK bshift_sound.vpk ## C.3 Move and clear mv bshift_sound./sound/*/ sound/; rm -rf bshift_sound. bshift_sound.vpk # D. Create desktop shortcut cat <<- EOF > ~/.local/share/applications/black_mesa_blue_shift.desktop [Desktop Entry] Name=Black Mesa: Blue Shift Comment=Play this game on Steam Exec=steam steam://rungameid/362890//"-game bshift"/ Icon=$STEAMAPPS/workshop/content/362890/2424633574/bshift_icon.ico Terminal=false Type=Application Categories=Game; EOF
Last edited by Payne; Dec 1, 2021 @ 2:01pm
TAW|REA Dec 6, 2021 @ 10:27pm 
Originally posted by Payne:
It would be good if someone would test the steps and describe the broken one.

Valve's vpk_linux32 is broken, thankfully ValvePython's vpk works fine without needing `cat` command. I prepared an installation guide, feel free to make a script of it;

https://www.reddit.com/r/linux_gaming/comments/rasla9/black_mesa_blue_shifts_halflife_blue_shift_remake/
Payne Dec 6, 2021 @ 10:42pm 
I was able to convert the sound files using `vpk_linux32` (as mentioned in the script), but it's possible I have a bug in the script ?? Python might be good alternative...
< >
Showing 1-15 of 72 comments
Per page: 1530 50