Black Mesa

Black Mesa

Black Mesa: Blue Shift
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
Cyvo  [udvikler] 19. dec. 2022 kl. 4:44
Linux Support
Anything regarding Linux Support
-Launcher
-Installation
-Execution
-QtUI
-Troubleshooting
-Workarounds
can be posted here.
< >
Viser 1-15 af 72 kommentarer
xdshot 19. juli 2021 kl. 6:04 
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  [udvikler] 26. juli 2021 kl. 7:51 
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 26. juli 2021 kl. 8:34 
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 26. juli 2021 kl. 15:15 
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 26. juli 2021 kl. 16:10 
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 26. juli 2021 kl. 16:32 
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
Sidst redigeret af Spacefish; 26. juli 2021 kl. 16:35
xdshot 26. juli 2021 kl. 16:37 
Oprindeligt skrevet af 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 26. juli 2021 kl. 16:48 
Oprindeligt skrevet af 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 14. aug. 2021 kl. 13:30 
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.
Sidst redigeret af mTUX; 14. aug. 2021 kl. 13:33
timvisee 🐧 17. aug. 2021 kl. 13:08 
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 26. nov. 2021 kl. 14:14 
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 1. dec. 2021 kl. 11:15 
It works like a charm!!! Except for the last step (step number 4), which makes no sense and can be skipped.
Payne 1. dec. 2021 kl. 13:49 
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
Sidst redigeret af Payne; 1. dec. 2021 kl. 14:01
TAW|REA 6. dec. 2021 kl. 22:27 
Oprindeligt skrevet af 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 6. dec. 2021 kl. 22:42 
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...
< >
Viser 1-15 af 72 kommentarer
Per side: 1530 50