Saturday, 14 February 2015

Retro Pie

Not really about Linux mint but I thought I would add my notes here from setting up Retropie on my Raspberry Pi 256m. Just for my benefit incase I lose my tomboy note pad somehow.

Notes are grabbed from various sources. If I need to remove them or credit please tell me.







RetroPie Notes

Note from 2015-02-02 20:22:15.304

First Set-up change memory split from root file system : $ sudo raspi-config
also expand file system to fit card size

----------------------------------------------------------------------------------------------------------------------------------------------------
SETUP SCREEN

$ cd RetroPie-Setup
$ sudo ./retropie_setup.sh

----------------------------------------------------------------------------------------------------------------------------------------------------

If screen goes black ALT F2 then ALT F1 may work

Exit Emulation Station F4

When upgrading anything exit Emulation Station

Easy file copy Filezilla - use sFTP

Game Boy Advance - gba_bios.bin is stored in /opt/retropie/emulators/gpsp/

-------------------------------------------------------------------------------------------------------------------------------------------------------

Emulation Station config files for Joysticks info

top level config is for main emulation station controller and to control the main front end screen only. Start Em Stn 1st time it detects and asks.
To reset it up use console option or from terminal to delete file and make a new one
rm /home/pi/.emulationstation/es_input.cfg

To have controllers also work on the emulators edit the main emulator configuration file with the controller’s button information.

Basic way to start from scratch Use ‘retroarch-joyconfig’
find it (in case its been moved).

sudo find / -name retroarch-joyconfig

Maybe its here : /opt/retropie/emulators/RetroArch/tools
To store keymaps create a folder in the pi’s home directory with: mkdir /home/pi/keymaps
go to that directory: cd /home/pi/keymaps (one controller plugged in at a time when doing this)
/opt/retropie/emulators/retroarch/retroarch-joyconfig > /home/pi/keymaps/SNES_1.txt

View this file with Cat
pi@raspberrypi ~/keymaps $ cat SNES_1.txt
input_player1_joypad_index = “0”
input_player1_b_btn = “2”
input_player1_y_btn = “3”
input_player1_select_btn = “8”
input_player1_start_btn = “9”
input_player1_up_axis = “-1″
input_player1_down_axis = “+1″
input_player1_left_axis = “-0″
input_player1_right_axis = “+0″
input_player1_a_btn = “1”
input_player1_x_btn = “0”
input_player1_l_btn = “4”
input_player1_r_btn = “5”
input_player1_l2_btn = “9”
input_player1_r2_btn = “9”
input_player1_l3_btn = “9”
input_player1_r3_btn = “9”
input_player1_l_x_plus_btn = “9”
input_player1_l_x_minus_btn = “9”
input_player1_l_y_plus_btn = “9”
input_player1_l_y_minus_btn = “9”
input_player1_r_x_plus_btn = “9”
input_player1_r_x_minus_btn = “9”
input_player1_r_y_plus_btn = “9”
input_player1_r_y_minus_btn = “9”

Start button for all the other unused buttons is used here i.e.(9)

Now use RetroArch (the main configuration for all emulators). To find these (example)

pi@raspberrypi ~ $ sudo find / -name retroarch.cfg

RESULT
/etc/retroarch.cfg/opt/retropie/emulators/RetroArch/pandora/retroarch/retroarch.cfg/opt/retropie/emulators/RetroArch/retroarch.cfg/opt/retropie/configs/nes/retroarch.cfg/opt/retropie/configs/atari2600/retroarch.cfg/opt/retropie/configs/segacd/retroarch.cfg/opt/retropie/configs/megadrive/retroarch.cfg/opt/retropie/configs/mame/retroarch.cfg/opt/retropie/configs/mastersystem/retroarch.cfg/opt/retropie/configs/gamegear/retroarch.cfg/opt/retropie/configs/psx/retroarch.cfg/opt/retropie/configs/snes/retroarch.cfg/opt/retropie/configs/gb/retroarch.cfg/opt/retropie/configs/all/retroarch.cfg/opt/retropie/configs/gbc/retroarch.cfg/opt/retropie/configs/doom/retroarch.cfg/opt/retropie/configs/fbs/retroarch.cfg/opt/retropie/configs/pcengine/retroarch.cfg/opt/retropie/configs/cavestory/retroarch.cfg/opt/retropie/configs/sega32x/retroarch.cfg

The one that controls all of them is :
The others over-ride this file for individualisation, so you can amend the controller set-up for individual systems so
the right buttons cause the correct effect such as fire always being the same button on each emulator. REMEMBER this file will only effect all the emulators that work with RetroArch, the main frontend control.

----------------------------------------------------------------------------------------------------------------------------------------------------------------

To change the main config file in the "all" folder use nano from Terminal: /opt/retropie/configs/all $ nano retroarch.cfg

# Joypad buttons.
# Figure these out by using RetroArch-Phoenix or retroarch-joyconfig.
# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction.
# E.g. “h0up”
# input_player1_a_btn =
# input_player1_b_btn =
# input_player1_y_btn =
# input_player1_x_btn =
# input_player1_start_btn =
# input_player1_select_btn =
# input_player1_l_btn =
# input_player1_r_btn =
# input_player1_left_btn =
# input_player1_right_btn =
# input_player1_up_btn =
# input_player1_down_btn =
# input_player1_l2_btn =
# input_player1_r2_btn =
# input_player1_l3_btn =
# input_player1_r3_btn =
/p
# Axis for RetroArch D-Pad.
# Needs to be either ‘+’ or ‘-‘ in the first character signaling either positive or negative direction of the axis, then the axis number.
# Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity.
# input_player1_left_axis =
# input_player1_right_axis =
# input_player1_up_axis =
# input_player1_down_axis =

Uncomment input lines (remove #) and refer to your previous results found in the SNES_1.txt you made earlier and stored in /home/pi/keymaps
Add the button numbers including quotes "" to match.
input_player1_a_btn = "1" for example.
Change the axis's to match also. these are for the D-Pad.

----------------------------------------------------------------------------------------------------------------------------------------------------------------

Now enable Hot Keys (multi-button presses for other functions such as exiting). The example below uses double key presses to Select, Start,menu,save games and audio up/down.

input_enable_hotkey_btn = 8 #Select
input_exit_emulator_btn = 9 #Start
input_save_state_btn = 1 #A button
input_load_state_btn = 2 #B button
input_state_slot_increase_btn = 5 #R button
input_state_slot_decrease_btn = 4 #L button
input_reset_btn = 0 #X button
input_menu_toggle_btn = 3 #Y button
input_state_slot_increase_axis = +0 #Right on D pad
input_state_slot_decrease_axis = -0 #Left on D pad
input_reset_axis = -1 #Up on D pad
input_audio_mute_axis = +1 #Down on D pad

Save this in nano CTRL + X
Y
Enter

---------------------------------------------------------------------------------------------------------------------------------------------------------------

Saving Game States (i.e. part way through). To do this you can give permission to your "Pi" user account to save in the folder normally only available to the "root" user where all saves are made. Failure to save is caused by you not having permission to write to the root folder.
sudo chown -R pi /home/pi/RetroPie

--------------------------------------------------------------------------------------------------------------------------------------------------

Wireless XBOX 360 controller set-up

-----------------------------------------------------------------------------------------------------------------------------------------------------

Duke 3D Install Issues

original DUKE3D.GRP must be in /home/pi/RetroPie/roms/duke3d
Joystick needs setting up and checking in the options

-------------------------------------------------------------------------------------------------------------------------------------------------------

Set up wireless network from terminal

sudo nano /etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0


iface wlan0 inet dhcp
wpa-ssid "ssid"
wpa-psk "password"

change ssid and password to yours

-------------------------------------------------------------------------------------------------------------------------------------------------------

BACKUP Pi SD CARD

Place card in Linux PC
Go to ROOT : $ sudo sh

find out what device the card is : $ fdisk -l
check by seeing what size card is e.g. 15.8 G

My card usually under /dev/SDC
dd is the copy image program, if (input file), of (output file), bs (baud speed, K,KB or M is multiplier speed of writing)

Use dd (execute it in folder you are saving to) : $ dd if=/dev/sdc of=THIS_IS_WHAT_IM_CALLING_IT.img bs=4M
Check it is there : $ ls -l -h
Compress file (minus 1 least compressed to minus 9 highest compression) : $ gzip -9 MY_CARD.img

------------------------------------------------------------------------------------------------------------------------------------------------------------

SOUND ISSUES

Set for HDMI or Audio Jack ?
Not using HDMI to DVI converter ? (DVI no sound throughput)

test from Terminal if sound using aplay : $ aplay /usr/share/sounds/alsa/Front_Center.wav

----------------------------------------------------------------------------------------------------------------------------------------------------------

Thursday, 12 February 2015

Wow, been some time and rzip

Wow, forgot how long it's been on here. My little place I keep my hints for myself and any others who get the same issues as me.
Obviously there are less issues with Linux Mint and I've not broken anything enough yet.

Anyway needed to do some compression on files today. Did a search, read a bit and it looks like rzip, from the repository was the one for me. Apparently lrzip is slightly better but I'd started encoding by the time I looked at that and it's just an upgrade to rzip.

So first I install it.

do a : rzip --help   for the info.

 -0            fastest (worst) compression
 -6            default compression
 -9            slowest (best) compression
 -d            decompress
 -o filename   specify the output file name
 -S suffix     specify compressed suffix (default '.rz')
 -f            force overwrite of any existing files
 -k            keep existing files
 -P            show compression progress
 -V            show version

Important notes being without the "-k" it deletes the original file after compression. I may not want that sometimes.

Friday, 25 April 2014

Major Fail ...bios corruption...keyboard not working

Well last night I installed some software, well a few pieces of software actually and I didn't check them out just expected them to work and trusted the recommendations from a website. The articles name was something about "Things to install after a new install of Mint Petra" or something like that.
I was really tired and didn't switch the PC off that night just fell asleep on the sofa till this morning. i headed back to the PC and was just sorting e-mail and messaging friends when....Shutdown. The PC just crashed.

I have been messing about with help from the Mint forum's, changing my bios memory settings as Mint seems not to recognise both my memory chips on my ASROCK 960GM motherboard. I thought maybe this was it.

Or the problems I've had with USB 3.0 connections also. Maybe this was all connected to my current troubles in hindsight.

Anyway on boot up again, my keyboard was not recognised and I was unable to get into bios to check things there. I got the GRUB menu but with no keyboard I couldn't access my Desktop either.
I disconnected all my USB connections and tried the keyboard and mouse in other USB ports first (I've heard some motherboards will only recognise the first USB port), no luck, then up to the loft for an old style keyboard and mouse. plugged them in to the Din sockets. nothing again. The PC was still not working just hitting GRUB and staying there waiting for  input from the non existent keyboard.

I needed help from the internet.

No computer ....

Up to the loft again and I pulled out one of my old PC's (I never seem to get around to getting rid of them) and 3 hours later after searching through several Hard disks to find a working one I know have a running Intel 2Core E8400 with 1mb ram and 160gig hard disk. I loaded the Mint Live CD I always keep around up. It had Nadia on it so just used that to download Petra and burnt over that copy (it's on a re-writeable). I know I could have updated in other ways but it just seemed the simplest.

Anyway I now have second PC to play with and this one has a floppy disk on it so i can check out those dozens of really old floppy disks I have lying about that I've meant to check for anything interesting I may have put on them years ago.

Back to my immediate problem. After some forum searches I decided to replace the Bios battery in the faulty PC. This didn't work to get the keyboard running again but now I had access to my cloud storage (where I keep PDF manuals of all the stuff I have) I could check out the Motherboard manual and reset the Bios jumpers.

Well this has worked, I have my Keyboard working again.
My first thing to do now is what is happening this second. Back-up... I've loaded the Mint Petra disk on the faulty PC and I am copying all the files in the home folder to a second Hard drive. There's a lot and really this has not been done for a while so it also gives me a chance to sort the trash in there out as well.

***USEFUL BIT***
It seems when you use the LIVE CD it will not let you copy files from one drive to another. It says permission denied. To bypass this a quick search told me I needed to be administrator to do this, which makes sense. To be able to do this on the Desktop all you need to do is right click on the folder you want to copy from and open as root then right click on the folder you will be sending to and open that as root also. you can then pull files and folders over. Use go up one folder on the folder menu to access that folder to open it's child.

I'm thinking I may just do a re-install as I can't find any answers yet on how to remove a program from a broken installation from the terminal in a Live CD. I assume it may be possible but being root and checking the dependencies in where-ever the list of programs are kept by the package manager.
I'm thinking this just because Windows kept things in the Registry. I may be wrong but this is all a learning process eh.
At least I've got a spare PC out of this mess to use to sort things out with.

Saturday, 5 April 2014

Opening a graphical program from Terminal

One thing I have had to work out myself as it may seem obvious to many or it may be stated somewhere I've never looked is sudo and gksudo

I've come across errors many times in Terminal such as

IBUS-WARNING

Gtk-WARNING

This I now know is because I was trying to open a programme with a graphical front end from within the Terminal.

I now know if I try to open it as root using the sudo command I need to do it as gksudo. This is to warn the system it is opening a graphical programme which may have other environmental variables it needs to set up which would not be otherwise.


So for example in Terminal and wanting to use gedit (the editing programme) I use from the command line:

$ gksudo gedit

and not

$ sudo gedit


Sunday, 12 January 2014

Fixing Channel 4OD & Demand5 Video playback

So, I've always had a problem playing back 4OD streaming content. I've tried lots of fixes and none worked. I've finally found a fix that does work on this link.

http://forums.linuxmint.com/viewtopic.php?f=90&t=146676

Just in case it disappears the  process is:

Remove the adobe cache

Terminal
rm ~/.adobe -rf

Install hal and hal-info (hardware abstraction layer)

Terminal
sudo apt-get install hal hal-info

Then link (ln) hal between /usr/share and /etc/ (make sure of the space between hal/ And /etc/)

Terminal
sudo ln -sn /usr/share/hal/ /etc/hal

I then went to the adobe folder

Terminal
cd ~/.adobe/Flash_Player

and removed the three files NativeCache, AssetCache, APSPrivateData2

Terminal
rm -rf NativeCache AssetCache APSPrivateData2


I don't know if all the steps are needed but it seemed to work so I'm happy !

UPDATE:

Well since I upgraded to Mint 16 Petra, which uses Ubuntu Saucy
 13.10 Demand5 stopped working.
Found a fix here though:

http://www.omgubuntu.co.uk/2013/10/fixing-amazon-prime-streaming-drm-protected-flash-13-10

Quick note, close down chromium fully when in terminal, I cut and pasted the notes into Tomboy first. The Chromium icon is next to the time on the right side of the lower menu bar. Right click and exit fully closing the browser down. On next restart it should work using the ppa version fix I used.

Saturday, 2 November 2013

Old forgotten encripted files

Dear me, I've just found some old embarrassing poetry from the 1990's. Well I know that's what it is but I encrypted it to stop nosey family members from looking when I lived with my family and used their computer.
It looks like to find out what I wrote I'm going to have to decrypt it but I forgot the password. I better try  "Rarcrack-0.2"

make sure I have libxml2-dev build-essential on my system if not

Terminal

apt-get install libxml2-dev build-essential


Download Rarcrack from the Internet. Sourceforge.

place rarcrack-0.2.tar.bz2 in the home folder along with poetry.rar

unpack rarcrack

Terminal
tar -xjf rarcrack-0.2.tar.bz2

got to the folder

Terminal
cd rarcrack-0.2

then build the program

Terminal
make

then as root install it.

Terminal
sudo make install

Now all I have to do is use it as a command in Terminal for anything I want to try and decrypt. Hope I didn't put too long a password on this thing.

Terminal
rarcrack poetry.rar

Sunday, 13 October 2013

Non-existent Drive Mounting on boot

I've had this problem before once and recently it happened again.

When I start the computer it hangs during the Mint load-up screen with the message:
Key: Disk not mounted. Press S to skip or M to manually mount (or something like this anyway)

Sometimes I use software like PhotoRec and GParted to check friends damaged hard drives and recover their files for them. I use my external Hard disk Caddy to do this. I back-up the drive first and then start messing with it sometimes booting to a windows partition to use CHKDSK the windows disk tool along with other things such as Hyrons boot disk etc.

Somehow I seem to on occasion reboot to Linux Mint without removing the damaged drive, I think I've done it when I have been tired or frustrated but the end result is Mint automatically adds the drive to my start up. This is probably the Automount programme (I need to read up more on that one).

Result, on a boot up the computer expects to find a disk that is not there after I have removed it from the caddy.

To fix this, once booted into Mint and after the message (Press S to skip the mounting) I need to go into Terminal and change the fstab script which controls the disks expected to be found.

Terminal
sudo fdisk -l

As Root. This lists the drives. Check the ones available. sda (first physical disc), sda1 (first physical disc, partition 1), sdb2 (second physical disk, partition 2) for examples.

Terminal
gksudo gedit /etc/fstab

As Root. Use "gedit" text editor to view contents of file "fstab" located in folder "etc".

Once this is up and viewable I can see the instructions and options for each partition to be mounted. There is a  description above each instruction with a hash (#) symbol in front of it  which is used like the old REM comment tag in Basic's.

Anyway I use this hash (#) tag to comment out the instruction which loads the now no longer existent drive. I save the file to make the changes and use menu to reboot the machine.

The computer now loads as normal without searching for a non-existent drive.