Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions docs/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,30 @@ profile. To select the `performance` profile:
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
```

## Switchroot
## Switchroot/Jetson setup

If you are running switchroot Linux on your Nintendo Switch, you can install
xemu from the PPA as described in in the [Download](download.md) page. However,
when running xemu you may see the following error:
If you are running Switchroot/L4T Ubuntu on your Nintendo Switch or Jetson device, you can install
xemu from the PPA as described in in the [Download](download.md) page. However, this is generally **not recommended** for performance reasons.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I don't really want to push the official ppa as being "not recommended" and instead suggesting people use something that's marked as use at own discretion. xemu generally is to be used at your own discretion anyway.
  • Where are the data behind the "slight speed boost" claim?
  • Performance is pretty bad on switch generally... which games in xemu are actually playable when building with platform tuning?
  • We can suggest your alternative build script that builds with tuning flags for the platform, but let's at least make it a separate subsection.
    • Also you can build a deb for the platform instead of duplicating the debian install behavior, which is preferable for updates, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I don't really want to push the official ppa as being "not recommended" and instead suggesting people use something that's marked as use at own discretion. xemu generally is to be used at your own discretion anyway.
  • We can suggest your alternative build script that builds with tuning flags for the platform, but let's at least make it a separate subsection.

Sounds good, I'll rewrite that when I get the chance.

  • Where are the data behind the "slight speed boost" claim?
  • Performance is pretty bad on switch generally... which games in xemu are actually playable when building with platform tuning?

I don't have a message link, but I remember Marco Loves 360#3902 confirming last year in the Discord server that there was a small bump in FPS when manually compiling. Unfortunately I haven't been able to test this myself, but I'm hoping the gap in performance between the PPA and source building increases long term as the emulator gets more ARM optimizations... the CPU is a massive bottleneck for Tegra hardware like the Switch.

  • Also you can build a deb for the platform instead of duplicating the debian install behavior, which is preferable for updates, etc.

That's an option, but this approach is more hands off - updates are rebuilt with the Megascript itself by selecting the Auto Updater option in the GUI.

Relevant bits:

XemuUserInput="no" #set this variable to a default response
if test -f /usr/local/bin/xemu; then #check if Xemu's been compiled on the device
        description="Do you want to update Xemu? (May take 5 minutes to 2 hours)"
        table=("yes" "no")
        userinput_func "$description" "${table[@]}"
	XemuUserInput="$output"
fi #create a GUI (or a RetroPie-style terminal menu if connecting over SSH) to ask the user whether they want to update Xemu

# ... running other stuff

if [[ $XemuUserInput == "yes" ]]; then
	echo "Updating Xemu..."
	sleep 5
	bash -c "$(curl -s https://raw.githubusercontent.com/$repository_username/L4T-Megascript/$repository_branch/scripts/games_and_emulators/xemu.sh)" || exit $?
else
	echo "Skipping Xemu update..."
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can attest that manually compiling xemu on switch hardware does net better performance, which in a situation where the switch is already power limited, every little bit of perf you can get helps

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big of a difference is there? In the test I mentioned above I remember he only said it was about 1-4 FPS faster on Halo 1.

Instead of using the PPA, it's recommended to install xemu via the [L4T Megascript](https://github.com/cobalt2727/L4T-Megascript/wiki)'s build script (use Option A for Switch users, or Option B for Jetson Nano/other users).
During their "initial setup" script, you'll be prompted to install SDL2 - choose yes to upgrade to newer SDL2 binaries. Afterwards, you can install xemu itself from the menu.
The Megascript's [build script](https://github.com/cobalt2727/L4T-Megascript/blob/master/scripts/games_and_emulators/xemu.sh) has been confirmed to result in a slight speed boost over the PPA, but it is not packaged by the xemu developers. Use at your own discretion.

```
If you see the following error, this is a [bug](https://github.com/mborgerson/xemu-website/commit/b6b8227a0b986176ae7d1d57e506751628ecceaf#commitcomment-63959699) from older releases of Switchroot's L4T Ubuntu:
```bash
dbus[12047]: arguments to dbus_message_new_method_call() were incorrect, assertion "path != NULL" failed in file ../../../dbus/dbus-message.c line 1362.
This is normally a bug in some application using the D-Bus library.

D-Bus not built with -rdynamic so unable to print a backtrace
```

To fix this you can build and install SDL from source:

This can be fixed by building a newer SDL2 from source or pasting the following into a terminal:
```bash
sudo apt install cmake build-essential
git clone https://github.com/libsdl-org/SDL && cd SDL
mkdir build && cd build
cmake ..
make -j4
sudo make install
# check for bad machine-id from 3.0.0 L4T Ubuntu image and fix if necessary
# also generate if user has somehow deleted their machine-id as well
if [[ $(cat /var/lib/dbus/machine-id) == "52e66c64e2624539b94b31f8412c6a7d" ]]; then
sudo rm /var/lib/dbus/machine-id && dbus-uuidgen | sudo tee /var/lib/dbus/machine-id
elif [[ ! -f /var/lib/dbus/machine-id ]]; then
dbus-uuidgen | sudo tee /var/lib/dbus/machine-id
fi
```

Then launch xemu `LD_LIBRARY_PATH=/usr/local/lib xemu`
Then launch xemu by typing `./xemu` from a "dist" folder inside the git folder at `xemu/dist/` after successfully building (or if using the Megascript, simply launch Xemu from your app list).