A crazy man's guide to Citra on Android and Raspberry Pi


#1

#DISCLAIMER

I’m not responsible for anything that happens to you or your devices as a result of your actions, whether you’re following my instructions or not. Also I cannot provide support if you try any of this, only suggestions. Same disclaimer applies to anything I say, unless you are paying me money for tech support.


#Q&A

Q: Why is this “A crazy man’s guide?”

A: Because I often come up with solutions that cause more problems than they solve. This definitely qualifies.

Q: So what’s the overview of how this works on Android?

A: Start with an Android device, install Debian on it, download and build Citra from source, run Citra on Debian on Android.

Q: And Raspberry Pi?

A: Start with a RPi with Linux installed, download and build Citra, run Citra.

Q: What does text that looks like this mean?

A: That text is formatted as code on reddit. I formatted it that way to indicate terminal commands.

Q: Can you include instructions for Arch, Unix, Linux From Scratch, etc.?

A: I could. But this guide is mainly aimed at Debian and Debian based Linux flavors (Debian, Raspbian, Ubuntu, Linux Mint, etc) so I won’t. If you ask nicely, I might come up with a Google search for you, but I won’t find answers for you.

Q: How do I know my device is capable?

A: I don’t guarantee capability. But you can try this: Google your device’s CPU. Dig around to see if it’s 64-bit. An easy indicator is if your device says it’s core architecture is ARM Cortex-A35 or higher.

Q: Will this even work?

A: I’ll be honest. I have no clue. I’m guessing it won’t even run and if it does, it won’t run properly. I could be wrong. YMMV.

Q: If you don’t know if it will work, why post a guide?

A: Because people are asking about Citra on Android, and people keep saying it won’t work. With this post, I’ve explained how it might work, if it can even work at all.

Q: Your guide is too advanced, can you make it any simpler to understand?

A: This is a bad idea in the first place. Hence why I set the bar where I did. If you don’t understand what’s going on, DO NOT PROCEED! I can’t stress that enough. I can’t save you from stupidity if you insist on being stupid.

Q: Too many links! Put it all in your post!

A: That’s not a question. It sounds like a demand. There’s a couple reasons why I can’t/won’t. 1) I did that on purpose, to encourage you digging for you own information. 2) I think it might blow the 40000 character limit of reddit text posts if I include everything and I’m not willing/too lazy to find out.


Required: A 64-bit device running Android, or a Raspberry Pi (or a competing board such as the Pine64) with a 64-bit CPU running either Android or Linux (Linux is preferred)

Highly suggested: Skills in Android, Linux, compiling programs from source, and Google-Fu.

Anything else: Having an uncluttered Android environment helps, if you have MultiROM or a device you don’t use, find a stripped down custom ROM so Debian has as many free system resources to use as possible. Or you can try running Debian bare metal on your device. If you get it working, that would help with the resource problem immensely.


#Step 0 (Android devices not already running Linux in some fashion, start here)

Find a way to run Debian on Android. If you’re rooted, you can look for a method using chroot. I haven’t gotten any of those working on my Shield Tablet (non-K1, rooted stock Android 7.0). What I have gotten working is GNURoot Debian by following this guide. You don’t need root to use GNURoot Debian.

#Step 1 (All other devices, start here)

Make sure you have git installed. sudo is also a great thing to have installed so you don’t have to use su (and if you don’t know why, use your Google-Fu)

#Step 2

Check your OpenGL version. You may need to install the Mesa utilities. If you need to, install OpenGL. If you’re OpenGL version is lower than 3.3, update it if possible. Google-Fu may be required. If updating to or past OpenGL 3.3 is not possible, unfortunately, you cannot run Citra.

#Step 3

Find a folder to clone Citra into. On my laptop, I have a folder named git in the root of my /home partition. You can put yours wherever. You can make a directory with mkdir [FOLDER_NAME] and move into it with cd [FOLDER_NAME]

#Step 4

Clone Cirta in git. git clone --recursive https://github.com/citra-emu/citra This will make a folder named citra. Once the cloning operation is done, move into the citra folder cd citra

#Step 5

Build Citra, install it if you want, and run it (or attempt to). The instructions are here.


#Closing words

The only ARM based devices I can imagine running Citra are ones that use the Tegra X1 chipset, including the Nintendo Switch, assuming someone put a custom OS on the Switch and overclocked it’s X1 processor. Out of the 3 consumer available devices (Shield TV, Pixel C, and Switch), the Shield TV has the best shot at running Citra since it can push it’s CPU harder for longer.

Feel free to ask questions. I’ll probably be responding while on mobile so your questions won’t be added to the Q&A section until I can edit it on my laptop.

I posted this on the Citra subreddit as well. reddit.com/r/Citra/comments/5zwj34/a_crazy_mans_guide_to_citra_on_android/

The link to the reddit post is in code because the 2 I already have are essential and I needed 3. My reddit post has more links. I seriously suggest using that one since the links explain a few things.


#2

citra hardly runs at any good speeds on high end pc hardware, i wonder what type of speeds you will get running it on a smartphone or even a pi provided it even works on it in the first place


#3

Sorry, this post might sound a bit harsh - I’m just trying to be factual here. Please put on your flamesuit :slight_smile:
Please don’t take this personally. No beef intended :wink:


This is not true. Citra also works on 32-Bit devices (not officially supported!) with a handful of patches.
The problem is that our JIT only works on x64 (which is mostly found in desktop PCs). Other CPUs (including, but not limited to ARM CPUs) are not supported.

You can also get Citra to work on those with the mentioned patches, but you’ll be limited to the CPU interpreter and software vertex processing which will already drop performance to a level where everything is not enjoyable anymore (as it happens even on high end PCs when doing this)

Sorry, but this is not exactly possible. A chroot is not equivalent of running a different kernel / OS.

This is also not true.

OpenGL 3.3 on Android is not present and even if your device has a custom implementation / extension for it, chances are that your drivers will be very poor in comparison to desktop graphics drivers.
You can probably add MESA in a VM or possibly even a chroot (very tricky probably) but you wouldn’t have hardware supported OpenGL probably. So, at best you’ll be stuck with poor performance.

Also, if you consider running without the JITs an option, you should also consider running without hardware rendering an option.
Again, this needs custom patches (which haven’t actually been written yet, but it’s easy). However, your performance would probably be far less than 5 frames per second so it’s not recommended at all. You couldn’t even enjoy round-based games.

This is just pulled out of thin air to be honest. Switch doesn’t even have homebrew yet. None of these devices are supported by Citra.

You can’t just conclude that Citra will work on some kind of device. By saying this you might cause people (kids mostly) to spend their hard earned money on hardware that can’t do what you promise / consider realistic.
Please do not buy any devices and expect Citra to work on it now, or the future.


To conclude: Combining slow software rendering and no-JIT = horrible performance.

There is also a lack of a frontend for Android so you’d have problems fitting the emulator on your screen and input methods would be even worse.

There is some actual work by @Kloen towards Android support. However, that will probably still take another couple of years to get anywhere.
This will involve probably 10 or more developers (who’ve studied / done this for at least 5 years each to gain the necessary skills) and lots and lots of work.

Even if Android support finally arrives, it will be very poorly working for the first couple of months / years and not be considered usable. Also, by that time, market could have shifted to another smartphone OS or Android could become severly locked down until then which would make emulation impossible.
As such, any work towards Android should be considered “testing the waters” for any kind of alternative non-PC platform.

Do not expect any kind of mobile / phone support before 2020. Thanks!
(Note that I’m not saying: “it will happen 2020!” but “it won’t happen before 2020” only)

Your best bet for “playing” on phones is to use a streaming solution where your PC emulates the 3DS and the video is sent to a phone & the input is send to the PC.
However, the best alternative for playing 3DS games is, you guessed it: using your Nintendo 3DS.


This is clearly not a guide. It’s wishful thinking at best.


#4

You’re absolutely right. People have this unrealistic (for now) wish that Citra can run on Android. So I provided an unrealistic, unreasonable, and ridiculous method of attempting to get it to work. Of course, over on reddit, someone smarter than me actually figured out a way to change the code to get Citra to run (horribly) with my method… sort of. And the fact that people are actually working on getting it working on Android (I didn’t know about that so thanks for the heads up) is pretty cool.

I pulled those out of the air because, at the moment, the Tegra X1 chipset is the most powerful ARM based mobile CPU/GPU available to consumers. The Snapdragon 820 does “match” it, but only on paper and only when compared to the Pixel C. If you look at the X1’s specs you’ll see that it has everything necessary to run Citra (poorly if at all) assuming you have Linux running on it and assuming it will run on ARM architecture instead of x86_64. And realistically the only way you’ll have a shot at that is by running Linux bare metal on a Shield TV, Pixel C, or Switch followed up by rewriting the JIT compilers to run on ARM.

I never said I promise or consider this to be realistic. The point of my “guide” isn’t to show people how to run Citra on Android. It’s to show that if you want to try getting it running, it’s not nearly as easy as you think it might be. And if anyone follows my guide thinking they can get it to work, I can only hope they learn a few things about Android and Linux in the process.


#5

My point is that your point is pointless. This post only create more “hope” and confusion for those who want to use Citra on android, this entire thread is misleading and I don’t know why you’ve wasted your time in something that:

  1. Don’t work
  2. Confuse the “common user” (as if they’re not confused enough),

Most users of Citra DON’T know how to use computers beyond installing games and double-clicking shortcuts. Let’s just wait until the code is more mature to even think about porting it to android in some useful way


#6

I had way to much caffeine yesterday. A side effect of that was my brain wouldn’t let go of the idea of running Citra on Android. I figured I might as well post it and see if someone smarter than me can take it and make something useful.

I left all sorts of red flags all over the place and even explicitly said not to continue if you don’t understand. On the flipside, if someone learns something from this and eventually starts contributing in some helpful way, then that’s awesome. I won’t keep my hopes up for that but you never know.

All in all, I recognize I took a bad idea and threw it onto the internet. Having bad ideas is pretty normal for me, actually. This is one of the rare ones that has a slim chance of being useful.


#7

i agree with everyone else, just leave it to time. citra will be finished eventually and mobile platforms will be targeted eventually as well. your solution of do this and this then pray and gamble on your luck that it works does not seem very convenient and requires a bit of technology knowledge to do it, let alone what horrible performance you will get anyway.


#8

#9

Locked this topic, as this “guide” is completely unrealistic.
Following this guide will not result in you running Citra on Android.