Installing FUSE, the Spectrum emulator. Arch or Debian instructions wanted.


83 posts   Page 1 of 4   1, 2, 3, 4
by TopherBrink » Wed Apr 18, 2012 6:58 pm
Okay, I'm reasonably familiar with apt-get and pacman, but I cannot figure out how to get the Spectrum emulator FUSE to download and install on either Debian or Arch. The "fuse-emulator-common" doesn't appear to exist, and getting the Debian files just ends up with a dependancy headache where more and more pieces seem to be needed that I can't get installed.

Is there a tutorial anywhere for getting it to install? Arch or Debian. Arch preferred but I don't care. At this point I just want to get it to run!
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by jojopi » Wed Apr 18, 2012 7:10 pm
A fuse-emulator package does exist in the fedoremix, though I have not tried using it.
User avatar
Posts: 2122
Joined: Tue Oct 11, 2011 8:38 pm
by jfedor » Wed Apr 18, 2012 8:56 pm
I got Fuse to run on the Debian image by compiling it from source.
Posts: 7
Joined: Tue Apr 17, 2012 5:30 pm
by TonyD » Fri Apr 20, 2012 1:02 pm
Cool, can you post how you did it?
Tony
User avatar
Posts: 341
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
by TopherBrink » Fri Apr 20, 2012 5:02 pm
I just got FUSE to compile and run properly on Arch. Playing Skool Daze (with the classic 8-bit music and sounds!), very happy. May even write a `beginners guide` to compiling it if there's interest.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by Helpme1986 » Fri Apr 20, 2012 5:36 pm
Count me in for interest!
Posts: 121
Joined: Tue Jan 03, 2012 3:48 pm
by TopherBrink » Fri Apr 20, 2012 7:01 pm
I am hoping to have the first version finished up in a few hours time. All I will be assuming is that you have Arch written to the sdcard, have internet working, and to be logged in to the command prompt as root. It'll be a complete step by step covering installing LXDE, the build tools, obtaining the source you need, building it, and hopefully leave you with a working copy of FUSE. Naturally you can then use what you learn to build any other source code for Arch too.

I don't guarantee I'm doing everything the "correct" way for purists. Just a way that will work if you follow it to the letter.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by Helpme1986 » Fri Apr 20, 2012 7:31 pm
Excellent, not used arch yet but have a card ready with it on.

Shall test it tomorrow for you (I"m a total noob and not used arch before so I should be a good test!)
Posts: 121
Joined: Tue Jan 03, 2012 3:48 pm
by TopherBrink » Fri Apr 20, 2012 9:42 pm
Well... here we have a v 1.0 version. If any willing participants would test out and see if there are any points which are unclear (I've tried to cover some basic useful things to know along the way too) or just plain don't work, I'll adjust as needed so ALL feedback is welcome. This is provided "as is" and since I just went through it myself again from scratch, should work. Should. ;) Again it is intended for total beginners and although it looks long and scary, it really isn't that hard. Just follow along! :)

How to run FUSE (and do a bunch of other stuff) V1.0

Assumed: You are at the command prompt logged in as root, with internet connection working so that you can download the files needed.

1) How To Get A Shiny Desktop.

Okay, first thing first - let's get ourselves an updated system and a GUI installed shall we? For light resource usage most are using the LXDE desktop, which is what Debian also uses.

At your command prompt, type:

pacman -Syu

And hit enter. This will update your Arch install to the latest packages. If any prompt for a yes/no appears, just hit Y and enter. Generally this will take a very long few minutes and should just go by itself.

Now we're updated, it's time to install our LXDE desktop/GUI. At the command prompt type:

pacman -S lxde xorg-xinit xf86-video-fbdev

Again hitting enter at the end. This will install the LXDE desktop, and the correct video drivers for your Raspberry Pi.

Once this is done, you can start the LXDE desktop by typing:

xinit /usr/bin/lxsession

Here we are, your nice shiny new LXDE desktop with mouse/keyboard. Not too complicated.

Now, just for the sake of it, let's shut down now and make sure everything is okay. Click the bottom left corner of the screen to bring up the LXDE menu, and select LXTerminal from Accessories. Wait a few seconds for it to open, then simply type:

shutdown -ah -t 10 now

And hit enter.
After a little while your system will shut down. I will explain here that it is INCREDIBLY important that you use the shut down command and don't just turn off the power until it says "System Halted"... as Arch will fail to start up again if you don't shut down properly. Do NOT logout from the desktop menu either. You will be forced to rewrite the image to the sd card and start all over again. Now you know how to do it, so that shouldn't happen. (If you want to reboot ever, simply open the terminal as above, type reboot and hit enter instead. Simple.)

2) Let's Get Ready To Build!

Power your RPi back on, and soon you'll need to log back in to the command prompt. This time you can either start LXDE as earlier with the "xinit /usr/bin/lxsession" command and open LXTerminal again, or just stick on the command prompt for now.

Now... let's install our build tools for compiling, shall we?
Whether on the command prompt or LXTerminal simply type:

pacman -S kernel26-headers file base-devel abs

And hit enter. Allow everything to install (either hitting "Y", or enter if asked to pick default=all).

That's it. You have your own build tools for compiling source now. Fun! These can later be used to compile any PKGBUILD you want - but for now stick with FUSE.

3) Wait - We Need Source Code!

Start up LXDE at this point if you have not already and bring up the LXTerminal.
We need something to get our source with now of course - so, just for simplicity let's install the web browser Midori by typing (remember - enter at the end of all commands from now on!):

pacman -S midori

You know the deal by now - let it install. When it completes, go to the bottom left menu again and run Midori from the Internet menu. It'll take a little while to open.
Go to http://aur.archlinux.org/packa.....p?ID=10350 to get the fuse-emulator source. Save it by right-clicking on the "Tarbell" link from the page. Just hit "Save As" for now and this will save the tarbell in /root.

You will also need libspectrum which is linked to on the same page - go to the page (it's http://aur.archlinux.org/packa.....p?ID=10350 if you don't get where to click), and again hit Save As on the Tarbell link for libspec.

To make things easier here, we need an unarchiver. Bring up your trusty LXTerminal again and tell it:

pacman -S xarchiver

Which will install the lovely easy to use xarchiver program. Now go into the menu again and hit "File Manager" in Accessories. This will bring up the root folder where you should now see those files we just downloaded. Right click on either and select "Extract Here" from the menu that appears. You'll see the two extracted folders appear. We have to deal with libspectrum first, otherwise we cannot compile fuse-emulator as it depends on libspectrum and a few other things being there first. These are what is referred to as "dependancies" - simply, applications depend on them to run.
Now again at LXTerminal, type:

pacman -S alsa-utils audiofile bzip2 glib2 libgcrypt zlib xz

4) Time To Compile!
Now we can build our libspectrum! BUT... reboot first from the LXTerminal as you learned earlier. This will make sure we have plenty of memory free. Once we're rebooted and back to the command prompt, DO NOT start LXDE this time. We need all the memory we can get and it will not have enough with LXDE running - seriously, it will just error on you and fail to build. (This took a LONG time to figure out. Try to do everything below yourself from LXTerminal if you want to see for yourself.)
So, still logged in at the command prompt, it's time to compile our code!

So type:

cd libspectrum

This will get us into the libspectrum folder with the extracted source from the tarbell.
Now... type:

makepkg --asroot PKGBUILD

As you will see - it failed. Why? If we read the message we can see it is because the PKGBUILD file which tells the build tools how to deal with it doesn't work for ARM architecture (arch='arm') processors. So... we need to make it do so.
Type:

nano PKGBUILD

Be careful here. Use the down cursor key and the right cursor key to move the white cursor box down to the line which starts with "arch=". See how it only shows "i686" and "x86_64" for 32-bit or 64-bit processors and not ARM which the RPi uses, just as the error showed us? Well... move the cursor along to inside that first bracket and type 'arm' (with a space after it). The line will then read:

arch=('arm' 'i686' 'x86_64')

That's it. The PKGBUILD file will now compile for our ARM processor. Remember this trick as you will need it for future source compiles.

Now press CTRL and O at the same time and hit enter. This will save our changes. After that, press CTRL and X to close the nano editor. You're now back at the command line. Repeat our:

makepkg --asroot PKGBUILD

And as you'll see, the error is gone this time. Now wait for our compiler to do the job and make our libspectrum. A lot of scary text will scroll by, including a few warnings and such, you can just ignore it and wait. While waiting, note the fact that you have just started a PKGBUILD and source code compiling for ARM! You can now do it with any app, so long as you use pacman or PKGBUILD and tarbell archives to install those dependancies it lists on their pages too!

Finished building? Good work (zombie) ARM. Now we will install your newly built "libspectrum". Type:

pacman -U libspectrum-1.0.0-1-arm.pkg.tar.xz

5) Here We Go... Building FUSE At Last!

Now the last part... fuse-emulator itself! Type in:

cd ../

As usual hit enter. This will take us back to /root. We want to be in the fuse-emulator folder now, so type:

cd fuse-emulator

There is another PKGBUILD file in here. As with the last one we need to edit the line to add ARM support before we can compile it. So as before we'll type:

nano PKGBUILD

You will find the same line as we edited before to add ARM support in this file. As before, simply move the cursor and make it read:

arch=('arm' 'i686' 'x86_64')

And save and exit nano again as before.

Now... You know what's coming next? Let's get our FUSE compiled by typing:

makepkg --asroot PKGBUILD

This will take a VERY long time. Seriously. It is important that if the screensaver kicks in you do not type anything. Just move your mouse. At most, press a cursor key. It will eventually finish. Take the time to marvel on the fact that you've now learned how to install a GUI to Arch Linux (and if you want nicer looking fonts later then try pacman -S ttf-dejavu and see the difference), how to install your build tools and programs via pacman, and how to get PKGBUILD files to compile ARM code for your Raspberry Pi. Not bad at all!

Finished? Here it goes. Type:

pacman -U fuse-emulator-1.0.0.1a-2-arm.pkg.tar.xz

"Proceed with installation"? YES!

Now, start LXDE again. However, assuming you want sound enabled there's one last thing to do in LXTerminal:

cd /lib/modules/3.1.9-11+/kernel/sound/arm/

To start our audio drivers:

modprobe snd-bcm2835

You will find the FUSE emulator is now in the Other menu as ZX Spectrum Emulator. Go ahead and click. Go into the Options -> Sound menu and tick "Sound Enabled". Now you just need to get your games. Find for example "Skool Daze" or "Manic Miner" on http://www.worldofspectrum.org using Midori, and unarchive it as we did earlier. Go to Media -> Tape -> Open in the FUSE GUI and select your extracted game. Press J then CTRL+PP (which should appear as Load "") and hit enter. Wait and your game will load..!
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by pepedog » Fri Apr 20, 2012 11:52 pm
V good.
If you makepkg -Acs --asroot you don"t need to edit PKGBUILD
However, even quicker for building aur package is yaourt
http://wiki.archlinux.org and search for yaourt
If a package is popular, back on archlinuxarm.org it, it could be added as a built package, making it even easier
Posts: 979
Joined: Fri Oct 07, 2011 9:55 am
by TopherBrink » Sat Apr 21, 2012 10:09 am
Thanks. I am actually considering a few basic future tutorials for people since right now there are a lot of beginners around who just want to know how to get things running with no real experience, and it is not an easy job to pull all the needed info together from various places unless you already know a little about what you need to find.

I myself found out very late on that the PKGBUILD editing could be avoided, but I actually decided it might be an advantage at least for now to leave it in the way it is. Why? Because when I thought about it, it"ll give people at least a basic understanding of how to run and use nano to edit files (config files etc), saving changes and such. I tried very much to teach a few basic concepts like that by example as I went along – even something as handy as learning how to load up the sound module in Arch is in there, or simply how to extract archives, find source (and dependancies) on AUR, that are generally useful to know.

Of course if we have anywhere here or on the wiki where such a thing could be posted (this thread title is now… unhelpful on that score!) that people are more likely to find it, that would also be nice.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by tkp » Sat Apr 21, 2012 2:16 pm
TopherBrink - Thanks for this.

right now there are a lot of beginners around who just want to know how to get things running with no real experience, and it is not an easy job to pull all the needed info together from various places unless you already know a little about what you need to find.

You are absolutely correct with this.

This tutorial pulls it all together and by following it I and the other Linux beginners can learn from it.

Well done and keep up the good work.
Posts: 6
Joined: Thu Apr 12, 2012 6:32 pm
by TopherBrink » Sat Apr 21, 2012 3:32 pm
Thank you. Far as I'm concerned if it has helped even one person get a little further along then it was worth the time. I only have some minor experience with Linux myself and have always found it difficult to get things started, running into the attitude on several occasions of "if you can't figure it out all by yourself you don't deserve to use this` which pushes people away. For the RPi to succeed, this cannot happen.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by TopherBrink » Sat Apr 21, 2012 4:58 pm
Added warning: Don't bother attempting this on the new Arch image just released. For some reason installing the build tools throws up virtual memory errors and LXDE appears extremely prone to freezing up - taking the entire system out and meaning you need to rewrite Arch from scrach.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by Bollard » Sat Apr 21, 2012 5:09 pm
@TopherBrink that's a great guide! Thanks for that, I'll give it a go if I get a second SD card to put Arch on to. Really easy to follow, and hopefully I can apply it to other apps!
User avatar
Posts: 18
Joined: Tue Apr 17, 2012 8:11 pm
by TopherBrink » Sat Apr 21, 2012 8:33 pm
Thank you, I hope it works for you. There is one minor error where I have the page for libspectrum listed with the same page number as fuse-emulator (d'oh) and I can't edit the post.

The correct page for the libspectrum tarbell is https://aur.archlinux.org/packages.php?ID=10349

(For those wondering, I am attempting to work around the issue with the new Arch image asap. Shouldn't be too tricky - they split the RAM differently to what it used to be. Hopefully it'll only be a one-command fix!).
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by TopherBrink » Sat Apr 21, 2012 9:11 pm
Unfortunately not. This tutorial is for now only working on the 27-03-2012 Arch image then. Even tried using the 224Mb .elf, same errors.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by TopherBrink » Sun Apr 22, 2012 4:04 pm
A further useful tip; if you find yourself running into memory-related errors at all when building programs for Arch, first of all try doing it again without starting LXDE up. If that fails, type:

cd /boot

cp start.elf start.elf.backup

This will create a backup copy of the start.elf file Arch uses by default (which controls how the memory is split)

Then type:

cp arm224_start.elf start.elf

This will replace the default with an .elf that allocates more memory (224Mb) to Linux on startup than the GPU, so reboot.

Try to compile your program again. If it still fails you're out of luck for now sadly.

After you are done, simply put the default .elf back by typing:

cp start.elf.backup start.elf

And reboot. Works for some problem compiles anyway.
Posts: 25
Joined: Wed Apr 18, 2012 10:21 am
by shortc1 » Wed May 09, 2012 10:46 pm
Managed to get fuse working on Debian today.

1) Had to do the tip above for extending the memory for the compile.

2) do an "apt-get install libx11-dev".  This is for Xlib.h & Xutil.h

3) Download libspectrum and fuse source files (described in earlier post).

4) untar the packages "tar xvfz <filename>"

5) cd libspectrum-1.0.0

6) ./configure

7) make

8) sudo make install

9) cd ../fuse-1.0.0.1a

10) ./configure

11) make

12) sudo make install

13) for some reason it doesn't search the right location for libspectrum so "export LD_LIBRARY_PATH=/usr/local/lib".  I'm sure there should be an option on the configure to fix this

14) download games (previously described) and unzip

15) fuse --no-sound -t <somename.tzx> -g 2x

Hope this helps.

No sound though...   Any info on the sound issue would be good.  I have run a modprobe snd_bcm2835 so the Music Player works (of sorts).
Posts: 2
Joined: Tue Jan 17, 2012 6:23 pm
by shortc1 » Thu May 10, 2012 3:42 pm
One more thing.  Don't have X running when compiling fuse or it will fail when compiling z80.

OSS sound didn't work.  Will try ALSA tonight.
Posts: 2
Joined: Tue Jan 17, 2012 6:23 pm
by babaracus » Sat May 12, 2012 1:00 pm
I am following the Arch instructions, however whilst installing browser, my screen has gone blank and has stayed blank for a couple of hours. The OK led in the pi is flashing occasionally but nothing else. Should it take this long or has something gone wrong?
User avatar
Posts: 4
Joined: Thu Jan 26, 2012 1:08 pm
by babaracus » Sat May 12, 2012 2:12 pm
Resolved, I left it a bit longer and got an image back on screen. There were some problems with the downloads. will try again later.
User avatar
Posts: 4
Joined: Thu Jan 26, 2012 1:08 pm
by alexeames » Fri May 18, 2012 7:25 am
Thanks. This is a great tutorial. Is there still an issue with the latest Arch version?
I've got cards with both Arch and Debian on.

I got a Pi yesterday and want to show my son the kind of fun we used to have. I bought my speccy because of manic miner back in the days... :mrgreen:
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2078
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by alexeames » Fri May 18, 2012 9:42 pm
I've managed to download the 27/03/2012 arch version, so am building a card with that on to try your tutorial out. It's still on the download server, just have to change the date twice in the download link. :mrgreen:
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2078
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by hatman » Sat May 19, 2012 10:15 pm
I don't think you need the version from 27/03/2012, I downloaded the latest version of Arch on Thursday and was able to install FUSE fine using the excellent instructions in this thread. I have been able to introduce my 9 year old son to the delights (and frustrations) of Manic Miner!

Excellent Instructions!
Posts: 4
Joined: Sat May 19, 2012 10:09 pm