Skip to content

Commit

Permalink
rebuild src
Browse files Browse the repository at this point in the history
made src way easier to understand.
  • Loading branch information
Your Name committed Nov 8, 2024
1 parent 8b1ab02 commit c7065c1
Show file tree
Hide file tree
Showing 106 changed files with 158 additions and 497 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ Then there's the way of routing the audio through JACK -> wineASIO -> RS_ASIO, w
**Recent Proton versions:**
If you don't use pipewire, choose the native JACK guide.
* If you don't use pipewire, choose the native JACK guide.
* If you use pipewire, you can choose either one.
Also see ["Which guide should I choose?"](/guides/which-guide-should-i-choose.md)
[Need help deciding? You can read this.](/guides/which-guide-should-i-choose.md)
|| pipewire-jack | native JACK |
|---|---|---|
Expand Down
2 changes: 1 addition & 1 deletion guides/setup/deb-native.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JACK to ASIO on Debian-based distros

Last tested on Debian Bookworm.
Last tested on Linux Mint 22.

## Table of contents

Expand Down
10 changes: 10 additions & 0 deletions guides/which-guide-should-i-choose.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[Yo dawg.](/img/yo-dawg.webp)

# What are the differences between the approaches?

## Native JACK vs. pipewire-jack
Expand Down Expand Up @@ -46,6 +48,14 @@ Native JACK with LD_PRELOAD.

Native JACK with either one of the launch methods.

## "I want to play multiplayer"

There's a way to use multiple devices with native JACK, but I haven't looked into it too much.

If you have an audio interface with multiple inputs, you can use either one.

If you don't, I recommend pipewire-jack.

## "I don't want my device to be exclusive."

pipewire-jack.
Expand Down
Binary file added img/yo-dawg.webp
Binary file not shown.
23 changes: 0 additions & 23 deletions src/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions src/arch-base-devel-note/deck

This file was deleted.

44 changes: 18 additions & 26 deletions src/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

(I recommend `wine-staging` if your distro has it, but usual `wine` works as well.)

000-install-part-000
000-install-necessary-000
# the groups should already exist, but just in case
sudo groupadd audio
sudo groupadd realtime
sudo usermod -aG audio $USER
sudo usermod -aG realtime $USER
```
Log out and back in. Or reboot, if that doesn't work.
000-install-necessary-post-000
<details><summary> How to check if this worked correctly</summary>
000-install-check-000
> For the packages, do `000-list-inst-000 <package-name>`. (You can do multiple packages at once) Should output the names and versions without errors.
>
> For the groups, run `groups`. This will give you a list, which should contain "audio" and "realtime".
</details>
Expand All @@ -44,27 +44,25 @@ The rest will be set up later.
# wineasio
000-install-wineasio-system-000
&nbsp;
000-wineasio-install-000
To make Proton use wineasio, we need to copy these files into the appropriate locations.
**STOP!** If you haven't set the environment variables yet, please follow [this part](/README.md#common-paths) of the prerequisites, then continue.
```
cp 000-x32unix-000/wineasio32.dll.so "$PROTON/lib/wine/i386-unix/wineasio32.dll.so"
cp 000-x64unix-000/wineasio64.dll.so "$PROTON/lib64/wine/x86_64-unix/wineasio64.dll.so"
cp 000-x32windows-000/wineasio32.dll "$PROTON/lib/wine/i386-windows/wineasio32.dll"
cp 000-x64windows-000/wineasio64.dll "$PROTON/lib64/wine/x86_64-windows/wineasio64.dll"
cp 000-lib32unix-000/wineasio32.dll.so "$PROTON/lib/wine/i386-unix/wineasio32.dll.so"
cp 000-lib64unix-000/wineasio64.dll.so "$PROTON/lib64/wine/x86_64-unix/wineasio64.dll.so"
cp 000-lib32windows-000/wineasio32.dll "$PROTON/lib/wine/i386-windows/wineasio32.dll"
cp 000-lib64windows-000/wineasio64.dll "$PROTON/lib64/wine/x86_64-windows/wineasio64.dll"
```
In theory, this should also work with Lutris runners (located in `$HOME/.local/share/lutris/runners/wine/`)
To register wineasio (so that it can be used in the prefix), run the `wineasio-register` script that comes in the wineasio zip and set the `WINEPREFIX` to Rocksmiths.
```
000-wineasio-register-000
env WINEPREFIX=$STEAMLIBRARY/steamapps/compatdata/221680/pfx 000-wineasio-register-000
```
<details><summary> How to check if this worked correctly</summary>
Expand All @@ -85,19 +83,19 @@ To register wineasio (so that it can be used in the prefix), run the `wineasio-r
1. [Download](https://github.com/mdias/rs_asio/releases) the newest release, unpack everything to the root of your Rocksmith installation (`$STEAMLIBRARY/steamapps/common/Rocksmith2014/`)
1. Edit RS_ASIO.ini: fill in `wineasio-rsasio` where it says `Driver=`. Do this for every Output and Input section.
And you're done with RS_ASIO. But in case you want to configure the inputs further, see [this](/guides/setup-rs-asio.md).
And you're done with RS_ASIO. But in case you want to configure the inputs further (relevant for multiplayer), see [this](/guides/setup-rs-asio.md).
## Set up JACK
000-jack-setup-000
000-set-up-jack-000
# Starting the game
![](/img/3-start-button.webp)
Delete the `Rocksmith.ini` inside your Rocksmith installation. It will auto-generate with the correct values. The only important part is the `LatencyBuffer=`, which has to match the Buffer Periods.
000-steam-running-required-000
000-steam-running-000
If we start the game from the button that says "Play" in Steam, the game can't connect to wineasio (you won't have sound and will get an error message). This is an issue with Steam and pipewire-jack. There are two ways to go about this. You can apply both at the same time, they don't break each other.
Expand All @@ -108,18 +106,14 @@ If we start the game from the button that says "Play" in Steam, the game can't c
Add these launch options to Rocksmith:
```
LD_PRELOAD=000-libjack-path-000/libjack.so PIPEWIRE_LATENCY=256/48000 %command%
000-ldpreload-command-000
```
You can launch the game from Steam now. For the first few boot-ups, you have to remove window focus from Rocksmith (typically done with Alt+Tab) as soon as the window shows up. If it doesn't crash, continue with instructions.
Rocksmith might not have audio, however, if you don't get a message saying that there's no output device, RS_ASIO and JACK are working fine.
Open qpwgraph or a different JACK patchbay software of your choice. We want to connect microphones to the inputs of Rocksmith and two outputs to our actual output device. Rocksmith will sometimes crash when messing with the patchbay, so this is how you want to go about it:
If there is NO message saying "No output device found, RS_ASIO is working fine. If you can hear sound, everything works fine.
1. Connect one device to Rocksmith
1. Window focus to Rocksmith
1. Go to step one, until you have connected everything
000-connect-sound-000
---
Expand All @@ -137,13 +131,13 @@ Please select the Proton Version you use (Rocksmith has been working fine since
* [Proton 9 or higher](/guides/start-script/proton-9.md) (newer versions)
* [Proton 8 or lower](/guides/start-script/proton-8.md) (slightly easier)
We can start the game via this script now: `PIPEWIRE_LATENCY="256/48000" path/to/rocksmith-launcher.sh`
We can start the game via this script now: `000-start-via-script-000`
If you want the Steam overlay to work, you need to launch the script via Steam, see the next step.
### Making it nice via Steam entry (optional, but recommended)
With recent Proton versions can't start Rocksmith directly from the Steam Library. But we can use the Steam Library to start the script that starts the game in a way that Steam recognizes.
With Proton's runtime, we can't start Rocksmith directly from the Steam Library just like that (excluding LD_PRELOAD). But we can use the Steam Library to start the script that starts the game in a way that Steam recognizes.
<details><summary>Fitting meme format</summary>
Expand All @@ -168,9 +162,7 @@ Important Settings:
* Runner: Linux
* Working Directory: The folder where your script is.
* Disable Lutris Runtime: true
* Environment Variables:
* Name: PIPEWIRE_LATENCY
* Value: 256/48000
000-lutris-env-000
</details>
### Beautification (even more optional, but recommended)
Expand Down
1 change: 1 addition & 0 deletions src/connect-sound/native
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If you can't hear sound, open QjackCtl and go to "Graph". We want to connect microphones to the inputs of Rocksmith and two outputs to our actual output device. Rocksmith will sometimes crash when messing with the patchbay. I recommend connecting everything before entering a profile.
6 changes: 6 additions & 0 deletions src/connect-sound/pipewire
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
If you can't hear sound, open qpwgraph or a different JACK patchbay software of your choice. We want to connect microphones to the inputs of Rocksmith and two outputs to our actual output device. Rocksmith will sometimes crash when messing with the patchbay, so this is how you want to go about it:

1. Ideally do it while the game starts up (logo screens appear). The Rocksmit logo is still safe, anything after that is not recommended.
1. Connect one device to Rocksmith
1. Window focus to Rocksmith
1. Go to step one, until you have connected everything
21 changes: 0 additions & 21 deletions src/diagram.txt

This file was deleted.

104 changes: 2 additions & 102 deletions src/generate.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,104 +1,4 @@
#!/bin/bash
trap "exit" INT

# number echos are meant for debugging purposes, to find the point where it doeesn't behave properly
# basically, it's a bunch of replacements for parts with a specific name. the name in 000-<name>-000 and the folder names match.
# The order of the subfolders is determined by need. This has the advantage that I don't need as much empty files.
# paths to the wineasio files are handled in a seperate .sh, because calling them like that makes sed want to run whatever is at those paths.
# Also, it's seperate so you can adjust them if needed, without having to work on this script.

path=../guides/setup

echo -1
rm $path/*.md # clean first
# for every variation
for dist in arch deb deck fed; do
for sound in non-pipewire pipewire; do
echo 0
echo "$dist; $sound" # print out, which file is worked on, so it's easier to debug.
# deck with non-pipewire is N/A, so we'll skip that.
if [ "$dist" = "deck" ] && [ "$sound" = "non-pipewire" ]; then
echo "recognized deck-non-pipewire loop, skipping."
continue
fi
if [ "$dist" = "fed" ] && [ "$sound" = "non-pipewire" ]; then
echo "recognized fed-non-pipewire loop, skipping."
continue
fi
filename=$path/$dist-$sound.md
cp base.md $filename # BASE SHOULD NEVER BE CHANGED BY THIS SCRIPT

echo 01
sed -i "s/000-title-000/cat title\/${dist}\/${sound}/e" $filename
sed -i "s/000-title-note-000/cat title\/${dist}\/note/e" $filename

echo 02
sed -i "s/000-install-part-000/cat install-part\/${dist}\/${sound}/e" $filename #needs fixing

echo 03
sed -i "s/000-install-check-000/cat install-check\/${dist}/e" $filename # "deck" here is a symlink to "arch" here

echo 04
#sed -i "s/000-arch-base-devel-note-000/cat arch-base-devel-note\/${dist}/e" $filename # not used anymore
echo 06
# sed -i "s/000-install-wineasio-system-000/cat install-wineasio-system\/${dist}/e" $filename
# sed -i "s/000-all-in-1-000/cat install-wineasio-system\/all-in-1/e" $filename
# sed -i "s/000-install-wineasio-system-1-000/cat install-wineasio-system\/${sound}/e" $filename
# sed -i "s/000-wineasio-source-000/cat install-wineasio-system\/wineasio-source/e" $filename
# sed -i "s/000-download-wineasio-000/cat install-wineasio-system\/download-wineasio\/${dist}/e" $filename
# sed -i "s/000-clone-wineasio-000/cat install-wineasio-system\/download-wineasio\/clone/e" $filename
#sed -i "s/000-wineasio-installed-note-000/cat install-wineasio-system\/wineasio-installed-note/e" $filename

echo 06-1
sed -i "s/000-install-wineasio-system-000/cat install-wineasio-system\/${dist}/e" $filename
sed -i "s/000-base-devel-000/cat install-wineasio-system\/stuff\/base-devel\/${dist}/e" $filename
if [ "$dist" = "arch" ] && [ "$sound" = "non-pipewire" ]; then
sed -i "s/000-line-before-download-000/cat install-wineasio-system\/stuff\/line-before-download\/arch-non-pipewire/e" $filename
sed -i "s/000-after-wineasio-install-000/cat install-wineasio-system\/stuff\/after-wineasio-install\/arch-non-pipewire/e" $filename
elif [ "$dist" = "deck" ]; then
sed -i "s/000-after-wineasio-install-000/cat install-wineasio-system\/stuff\/after-wineasio-install\/deck/e" $filename
fi
sed -i "s/000-line-before-download-000//g" $filename
sed -i 's/000-after-wineasio-install-000//g' $filename
sed -i "s/000-deck-additional-packages-000/cat install-wineasio-system\/stuff\/deck-additional-packages\/${dist}/e" $filename
sed -i "s/000-fed-makefile-000/cat install-wineasio-system\/stuff\/fed-makefile\/${dist}/e" $filename
sed -i "s/000-wineasio-register-000/cat wineasio-register\/${dist}/e" $filename


echo 07
sed -i "s/000-old-000/cat install-wineasio-runner\/old/e" $filename

echo 08
sed -i "s/000-jack-setup-000/cat jack-setup\/${sound}/e" $filename

echo 09
sed -i "s/000-steam-running-required-000/cat steam-running-required\/${sound}/e" $filename

echo 10
sed -i "s/000-pipewire-note-000/cat pipewire-note\/${sound}/e" $filename
echo 10.1
#sed -i "s/000-pipewire-bootup-000/cat pipewire-bootup\/${sound}/e" $filename # using "start" in the regex gave the following error message (I don't know why): sh: line 1: Save: command not found

echo 11
./replace-paths.sh $dist $filename
# those lines cause issues, for some reason. Write a seperate script with the lines in it; quick fix.
#echo 11
# insert paths
#sed -i 's/000-x64unix-000/'"`cat paths/$dist-x64unix`"'/' $filename # why does this thing ask for sudo?
#echo 11.1
#sed -i "s/000-x64windows-000/cat paths\/${dist}-x64windows/e" $filename
#echo 11.2
#sed -i "s/000-x32unix-000/cat paths\/${dist}-x32unix)e" $filename
#echo 11.3
#sed -i "s/000-x32windows-000/cat paths\/${dist}-x32windows/e" $filename
echo 12
done
done

# This will list all the file names, regardless of missing something, or not. If there's a tag that's not replaced, it will appear below the according filename.
echo 13
echo "missing replacements, by file:"
for file in $(ls $path); do
echo $file
cat $path/$file | grep -P "000-"
done
# list all used variables with: grep -oiP "000-.*-000" base.md
# the only more complicated part is install wineasio, which has a couple variables more.
1 change: 0 additions & 1 deletion src/install-check/arch

This file was deleted.

1 change: 0 additions & 1 deletion src/install-check/deb

This file was deleted.

1 change: 0 additions & 1 deletion src/install-check/fed

This file was deleted.

1 change: 1 addition & 0 deletions src/install-necessary-post/base
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Log out and back in. Or reboot, if that doesn't work.
1 change: 1 addition & 0 deletions src/install-necessary-post/deck-native
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please reboot.
6 changes: 6 additions & 0 deletions src/install-necessary/arch-native
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
If asked, replace `jack`.

```
# If you use pipewire, I also recommend to install: pipewire-jack-client
# If you use pulseaudio, I also recommend to install: pulseaudio-jack
sudo pacman -S cadence carla jack2 lib32-jack2 realtime-privileges
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ Install the kxstudio repo according to these instructions: https://kx.studio/Rep
When asked about realtime privileges, select yes with the arrow keys and confirm with enter.

```
# If you use pulseaudio, I also recommend to install: pulseaudio-module-jack pulseaudio-module-jack:i386
sudo apt update
sudo apt install cadence carla wineasio jackd2
sudo apt install wineasio jackd2 qjackctl libjack-dev libjack-dev:i386
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Install the kxstudio repo according to these instructions: https://kx.studio/Repositories

```
dpkg --add-architecture i386
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install wine pipewire-alsa pipewire-pulse pipewire-jack pipewire-jack:i386 qpwgraph pavucontrol wineasio
10 changes: 10 additions & 0 deletions src/install-necessary/deck-native
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```
# disable readonly mode
sudo steamos-readonly disable

sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --populate holo

# I also recommend to install: pipewire-jack-client
sudo pacman -S realtime-privileges wine-staging base-devel glibc linux-headers linux-api-headers libtool binutils lib32-glibc lib32-jack2 jack2 qjackctl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sudo steamos-readonly disable

sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --populate holo

sudo pacman -S realtime-privileges wine-staging
# These packages are already on SteamOS so I did not install them:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**This guide will use the Steam package from "RPM Fusion nonfree". This is to avoid sandboxing being an issue for now.**
**This guide will use the Steam package from "RPM Fusion nonfree". This is to avoid sandboxing being complicated for now.**

An alternative way to do this via Flatpak is described [here](https://github.com/theNizo/linux_rocksmith/issues/31) Please note that the maintainer (theNizo) has no experience with Flatpak.

Expand Down
4 changes: 0 additions & 4 deletions src/install-part/arch/non-pipewire

This file was deleted.

Loading

0 comments on commit c7065c1

Please sign in to comment.