cover photo

Roelofpieter

roelofpieter@z.huttiesroow.nl

Roelofpieter
 Deventer 
Damn! Due to a wound on my foot I am unable to run (or walk) today. My wife did go. And this is what she saw along the way. Wish I could go :-(

Image/photo
 balloo  sport  weer
De langste tokkelbaan van de wereld

Roelofpieter
 Deventer 
De langste tokkelbaan van de wereld is 2,8 km lang

Image/photo

De tocht start op de top van de Jebel Jais-berg in de Verenigde Arabische Emiraten, die op 1680 meter boven zeeniveau ligt.
Bekertjesmos

Roelofpieter
 Deventer last edited: Tue, 26 Dec 2017 15:02:12 +0100  
So, instead of going to the American dream at the Drents museum  (which is closed of course on christmas day :-| ) we decided to go geocaching in the direct vicinity of my parent's house. On the Balloërveld near #Balloo we came across this "bekertjesmos". In full bloom in December. Pretty...

Image/photo
Roelofpieter
 Deventer last edited: Sat, 09 Dec 2017 00:05:18 +0100  
Compulsory first snow picture #netherlands #deventer

Image/photo
Roelofpieter
 Deventer 
While waiting for the computer to boot, I noticed a great #sunrise after a cold and wet night. #weather #amersfoort #netherlands

Image/photo
Het is niet altijd makkelijk, maar ga er voor.

Roelofpieter
 Deventer last edited: Sun, 26 Nov 2017 23:27:18 +0100  
Another great commercial from a German DIY store in the Netherlands. #hornbach #commercial


Het is niet altijd makkelijk, maar ga er voor. - extended
by NLHornbach on YouTube
Glow lights festival Eindhoven

Roelofpieter
 Deventer last edited: Sat, 18 Nov 2017 01:08:33 +0100  
Image/photo
A projection on the Catharina church.
Running Super Nintendo (SNES) games through Pisnes on my OSMC equipped Raspberry Pi media center.

Roelofpieter
 Deventer last edited: Fri, 24 Nov 2017 20:34:08 +0100  
I have a Raspberry Pi 2 mediacenter running OSMC. I have spent quite some time in getting the SNES emulator Pisnes to work on it. An "easy" solution to this would be to install Retrosmc. But this installs so much more than needed. When I tried this installing took a few hours on my Raspberry Pi 2. It also makes the whole install much more complex with installing: Retropie, Emulationstation, lots of emulators etc... . Overkill for me. But getting just Pisnes to run wasn't easy (for me). I tried a lot of different combinations of settings but ran in trouble all the time. Pisnes wouldn't start or there was no sound or the buttons of my game controller didn't react (the control-sticks and the d-pad did though. Huh?!). Installing Retrosmc did learn me that it could work. So with new hope I started again and finally got it running.

In the end I managed to get it to work. For this I used some scripts supplied by retrosmc and molded them for my needs. Finally I am able now to start my media center, browse to the game in question and fire it up. It basically works as follows:

  • I use Advanced Emulator Launcher to start the game. Advanced Emulator Launcher calls the first script.
  • The first script (pisnes.1.sh) is begins with stopping several services. At least the mediacenter (Kodi) service. And in my case also some services for the web server I am running. This frees up CPU cycles, needed for the emulator.
  • Then it calls another script (pisnes.watchdog.sh) that keeps checking in the background whether Pisnes ('snes9x' process) is still running. When not (so when I stopped playing) it will start those services again.
  • After starting the watchdog script it will then launch pisnes in an openvt session. This helps against problems with sound and the controller I believe.
  • The actual start of pisnes is done through another script: pisnes.2.sh. Combining the first and the second scripts have been fruitless for me, so I'll just keep it this way. This second script starts Pisnes with the requested ROM file, so I can play the game. It also redirects ALSA sound from the 3,5mm-jack output to HDMI output.


I normally use the 3,5mm-jack output to listen to internet radio (Studio Brussel) on my connected stereo through MPD. This can also be done in Kodi alone, but now I don't have to start the TV only to listen to some radio.

pisnes.1.sh :
This is the script that is first called from Advanced emulator launcher. I am not really sure what everything does exactly or why, but hey: It works. In this and the following scripts I mainly searched and replaced "emulationstation" for "pisnes" in the original scripts. And I cleaned up stuff that didn't seem relevant.

#!/bin/bash
# This scripts starts the pisnes watchdog deamon and
# pisnes itself while stopping KODI mediacenter and some
# other "heavy" services afterwards.
# Script by mcobit, edited by roelofpieter

# clear the virtaul terminal 7 screen
sudo openvt -c 7 -s -f clear

# start the watchdog script
sudo su osmc -c "sh /opt/pisnes/pisnes.watchdog.sh &" &

# start pisnes on virtual terminal 7 and detach it
sudo su osmc -c "nohup openvt -c 7 -f -s /opt/pisnes/pisnes.2.sh $1 >/dev/null 2>&1"

# clear the screen again
sudo openvt -c 7 -s -f clear

# wait a bit to make sure pisnes is running detached from kodi
sleep 0.5

# stop kodi and other "heavy" services to free cpu and input
# devices for pisnes. And mpd becasue of the sound output
sudo su -c "systemctl stop mediacenter &" &
sudo su -c "systemctl stop nginx &" &
sudo su -c "systemctl stop php5-fpm &" &
sudo su -c "systemctl stop mysql &" &
sudo su -c "systemctl stop mpd &" &

exit


pisnes.watchdog.sh :
This script keeps running in the background and will restart Kodi (and other services in my case) when pisnes is stopped.
#!/bin/bash

# Script by mcobit, edited by roelofpieter

# give pisnes time to start up
sleep 8

# check for pisnes (snes9x) running
while [ true ]; do
    VAR1="$(pgrep snes9x)"

# if pisnes (snes9x) is quit, clear the screen of virtual terminal 7 and show a message
    if [ ! "$VAR1" ]; then
        sudo openvt -c 7 -s -f clear

# restart kodi and other "heavy" services. And mpd...
    sudo su -c "sudo systemctl restart mediacenter &" &
    sudo su -c "sudo systemctl restart mpd &" &
    sudo su -c "sudo systemctl restart mysql &" &
    sudo su -c "sudo systemctl restart php5-fpm &" &
    sudo su -c "sudo systemctl restart nginx &" &

# exit script
    exit
else

# if pisnes is still running, wait 2 seconds and check again (could probably be longer, but doesn't seem to impact performance by much)
    sleep 2

fi
done
exit


pisnes.2.sh :
And this script will start the actual game. Additionally it will create a backup of the save file. Should I accidentally overwrite it (with a single button press, namely the right "shoulder" button) I always have a copy of the file.


#!/bin/sh

#redirect the sound to the television
amixer cset numid=3 2

# Make a backup copy of the save file. Pisnes runs as root, hence the savefile location.
fullromfile=$(basename "$1")
romfile="${fullromfile%.*}"
sudo cp /root/.snes96_snapshots/$romfile.000  /root/.snes96_snapshots/$romfile.000.$(date +%Y%m%d%H%M%S)


# Start the actual game
sudo /opt/pisnes/snes9x $1

#redirect the sound back to external output
amixer cset numid=3 1


Advanced emulator launcher
I don't find the Advanced emulator launcher very intuitive. This is how I set it up the basics. First I created a new launcher of the type "ROM launcher (Emulator). Since I installed pisnes and it's roms in /opt/pisnes the launcher application is /opt/pisnes/pisnes.1.sh on the SD card. The roms path is (for me) /opt/pisnes/roms/. The file extension is "smc". I could tell this by looking at the rom files ;-) . Application argument is the default "$ROM$", but I have no idea if this matters. I gave it a name and for platform I obviously choose Nintendo SNES. The scraped artwork goes into /opt/pisnes/roms/artwork. Then I added ROMs by choosing " Add ROMs > Scan for new ROMs". From there on I could select a ROM and launch it.

Phew. And now: Zelda!

Image/photo
Investeerdersfeest Davo 2017

Roelofpieter
 Deventer 
Met blijk van waardering...


Image/photo
Mpm 2017, mpm26

Roelofpieter
 Deventer 
T was weer mooi #mpm26

Image/photo
 Roeien
Roelofpieter
 Deventer 
A steamtrain passed the office the other day. Right behind the raindrops

Image/photo
Refreshing in Spain...

Roelofpieter
 Deventer 
Immensly enjoyed this fountain in #Seville, #Spain, where a mild wind created a fine spray for me to cool down. And it is not nearly the hottest time of year!


Image/photo
 spanje  Uit
It's autumn allright...

Roelofpieter
 Deventer 
Image/photo
Roelofpieter
 Deventer 
Just recieved the first copy of my subscription of the VPRO "tv guide". And already picked the first fruits of it. Started watching The leftovers (in dutch) because of linked article. Very good so far...


Image/photo
Roelofpieter
 Deventer 
3rd time Hotel Skarrildhus, near Herning, DK. Love it here...

Image/photo
"West" at night

Roelofpieter
 Deventer 
Image/photo
Out with the old...

Roelofpieter
 Deventer 
Getting rid of a large part of my carefully collected collection of beer glasses :-)

Image/photo
NS wandeling Hierdense poort

Roelofpieter
 Deventer last edited: Mon, 11 Sep 2017 22:40:26 +0200  
Nunspeet - Harderwijk (20 km) zondag 30 juli 2017. Shattered showers... (and some software filters on my phone for added drama...)
Image/photo
 uit
After rowing practice

Roelofpieter
 Deventer 
Image/photo
 Roeien
Daifuku mochi

Roelofpieter
 Deventer last edited: Sat, 17 Jun 2017 17:26:24 +0200  
Leren kennen in Japan, nu eens zelf gemaakt: Daifuku mochi. Dat viel allerzins mee. Volgende keer maak ik ook de anko zelf.

Image/photo
Roelofpieter
  
Let er op; maximaal twee dagen houdbaar! (Ook in de koelkast). Ze drogen uit...