Question on video resolution

Thinking about getting a RaspberryJAMMA, or have just purchased one and have a newbie question? Walls here are padded, come on in and bounce your question off of them!

Moderator: dee2eR

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 1:01 am

Update:

Some games work, some don't. Seems most don't. Once it goes to the screen that is above with the garbled video there is no way back. Have to shut down and reboot.

dee2eR
Inventor
Inventor
Posts: 1857
Joined: Tue Aug 22, 2017 2:07 pm

Re: Question on video resolution

Post by dee2eR » Wed Aug 08, 2018 1:33 am

Odd, it looks like it's still changing resolution, maybe just for some stuff. The current resSwitch script won't change resolutions when the Pi is in high res mode so I'd hoped all you would need to edit was config.txt

From the look of the config file I thought you had a late enough version of the software that just editing the config would be enough to change it but you may need to edit the file /boot/launchers/servMenu.sh to uncomment the high res options so you can reconfigure the system from the menu. Not knowing exactly which software version you have I can't be sure which version of the servMenu.sh file you will have, the current version has the commented section at the top like this (older versions it's further down the file and a lot more lines):

## High res is disabled here by default for safety, uncomment lines 5 through 21 to use.
# if [ $1 == hrh ]; then
# #set Pi to High Res 480p horizontal
# cd /boot/config-updater
# sudo cp config.txt.hrh /boot/config.txt
#
# # Reboot to make changes take effect
# sudo reboot
# fi
#
# if [ $1 == hrv ]; then
# #set Pi to High Res 480p vertical
# cd /boot/config-updater
# sudo cp config.txt.hrv /boot/config.txt
#
# # Reboot to make changes take effect
# sudo reboot
# fi

which you would want to change to:

# High res is disabled here by default for safety, uncomment lines 5 through 21 to use.
if [ $1 == hrh ]; then
#set Pi to High Res 480p horizontal
cd /boot/config-updater
sudo cp config.txt.hrh /boot/config.txt

# Reboot to make changes take effect
sudo reboot
fi

if [ $1 == hrv ]; then
#set Pi to High Res 480p vertical
cd /boot/config-updater
sudo cp config.txt.hrv /boot/config.txt

# Reboot to make changes take effect
sudo reboot
fi

Please note any line that had more than one hash is still (and needs to be) hashed out after removing the hashes from everything.

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 1:43 am

I will try this. Shouldn't I have the latest since I just received it yesterday?

dee2eR
Inventor
Inventor
Posts: 1857
Joined: Tue Aug 22, 2017 2:07 pm

Re: Question on video resolution

Post by dee2eR » Wed Aug 08, 2018 1:47 am

I would have thought so, but as I said, I'm pretty sure I didn't directly sell you anything so I can't be sure what you have.

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 1:54 am

Oh. Gotcha. You made the equipment and manage it? Anyway, what do I need to do after I make the changes to the script within Arpicade?

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 1:55 am

And should I find out what software I have and update if needed? By the way, THANK YOU!

dee2eR
Inventor
Inventor
Posts: 1857
Joined: Tue Aug 22, 2017 2:07 pm

Re: Question on video resolution

Post by dee2eR » Wed Aug 08, 2018 2:39 am

Once the high res options are uncommented you can select them from the service menu to reconfigure the system in the same way you accidentally reconfigured it into 240p mode originally.

I'm curious what version of the software you have too, unfortunately I have not put a version file in yet. The next ARpiCADE release will have a version file to help in this sort of situation. Do you have the folder /boot/roms/mame4all? Mame4all got removed at 3.82 so wouldn't be there on current builds.

If it's not too much of a pain I'd love to see the contents of your /boot/launchers/resSwitch.sh (or find out you don't have it and the software is old enough that each launcher controlled it's own resolutions). It's also possible the problem was just one emulator launcher doing something it shouldn't, hard to say without checking it out further.

---
to "update" (cannot directly update to 3.82 as it's a full image, not knowing exactly which version you have would have made that tricky anyway) you will need to copy the roms, previews and attract-layouts folders from your current build to your PC. Download the newest ARpiCADE (currently 3.82): https://arpicade.com/forums/viewtopic.php?f=12&t=530 and image your SD card, then resize the partitions: http://aha-forums.com/wp/2018/02/02/how ... ory-cards/ (this is FrizzleFrieds guide, not something I wrote - it's better). Once you have the latest software on the card and resized you can put all the stuff you backed up off the other card back onto the card.

The first boot after the "update" the roms will be scanned automatically, if you're not changing up the roms at all I strongly recommend commenting out the 3 lines in /boot/run.sh that do the auto rom scan at startup once you have run it once (it will speed up booting and reduce SD card wear).

---
as for what I do, it's a bit of everything on this one. PCB design, assembly (some have been assembled by other people but over 90% have been built by me) & testing as well as ARpiCADE development (although most of the coding I do is just bash scripts - mostly ARpiCADE is made up of other bits of free software, I stand on the shoulders of giants and am not talented enough to make a Linux or MAME or Attract-Mode if they weren't already available thanks to their own dedicated people/teams).

Things I haven't done myself include this website & forum which was made by @Happswitch (huge thanks Happswitch) and some of the better guides to various aspects of the software have been written by people like @FrizzleFried and @g5k (thanks to anyone writing help guides or just helping answer some of the questions that come up).

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 3:10 am

Wow. That’s a lot. I will see what I can do. I am computer savvy and mess around with this stuff a bit so will give it a go. I appreciate your help on this one. I really do. Going to bed. Will reconvene tomorrow.

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 2:13 pm

BTW I do not have a Mame4all folder in the roms folder.

mtcawirtz
Contributing Member
Contributing Member
Posts: 36
Joined: Tue Aug 07, 2018 12:55 am

Re: Question on video resolution

Post by mtcawirtz » Wed Aug 08, 2018 2:15 pm

#!/bin/bash

# resolution switching script for ARpiCADE
# WARNING use at your own risk!

# default behaviour if run without an extension is to switch to 240p@60
# when run without an extension errors are expected, pass 240p instead
# eg. "/boot/launchers/./switchRes.sh 240p" (no quotes)

function lessThan() {
awk -v n1="$1" -v n2="$2" 'BEGIN {printf (n1<n2?"y":"n"), n1, n2}'
}

hdmimode=`grep "^[^#;]*hdmi_mode=" /boot/config.txt`
monitorMount=`grep "#monitor_mount=" /boot/config.txt`

## Basic sanity check - very limited, only intended to be used with hdmi_group=1
## Exit without changing res if in high res mode
if [ $hdmimode == hdmi_mode=1 ] || [ $hdmimode == hdmi_mode=2 ] || [ $hdmimode == hdmi_mode=3 ] || [ $hdmimode == hdmi_mode=4 ] || [ $hdmimode == hdmi_mode=16 ]; then
echo "Resolution changing disabled in high res mode"
## read mameinfo for arcade game launchers
if [ $1 == 240p ] || [ $1 == defaultres ]; then
exit
else
list=/boot/launchers/mameinfo.txt
less $list | while read i
do
echo | grep -A5 -P -w "rom=$1" $list > /var/cache/apt/tmp.txt
exit
done
fi
exit

else

## Return to original boot resololution
## only works with 240p and 480i
if [ $1 == defaultres ]; then
## Return to 480i # resolution to 720x480i
if [ $hdmimode == hdmi_mode=6 ]; then
tvservice -e "CEA 6 HDMI" & sleep 3
fbset -depth 8 && fbset -depth 16
fbset -g 720 480 720 480 16
else
## Return to 240p # resolution to 720x240p
if [ $hdmimode == hdmi_mode=8 ]; then
tvservice -e "CEA 8 HDMI" & sleep 3
fbset -depth 8 && fbset -depth 16
fbset -g 720 240 720 240 16
else
exit
fi
fi
else

## Set resolution for game
## if no gameinfo is found the script will produce errors but still switch to 240p
list=/boot/launchers/mameinfo.txt
less $list | while read i
do
echo | grep -A5 -P -w "rom=$1" $list > /var/cache/apt/tmp.txt
type=`echo | grep -A0 -P "type" /var/cache/apt/tmp.txt`
screen=`echo ${type:6:-1}`
rotate=`echo | grep -A0 -P "rotate" /var/cache/apt/tmp.txt`
rot=`echo ${rotate:8:-1}`
height=`echo | grep -A0 -P "height" /var/cache/apt/tmp.txt`
h=`echo ${height:8:-1}`
refresh=`echo | grep -A0 -P "refresh" /var/cache/apt/tmp.txt`
r=`echo ${refresh:9:-1}`

if [ $monitorMount == "#monitor_mount=1" ]; then
if [ $rot == 0 ] || [ $rot == 180 ] || [ $screen == vector ] || [ $h -gt 288 ]; then
echo rotated, vector or med/high res game -- exiting
exit
fi
elif [ $rot == 90 ] || [ $rot == 270 ] || [ $screen == vector ] || [ $h -gt 288 ]; then
echo rotated, vector or med/high res game -- exiting
exit
fi
if [ $h -gt 264 ]; then
echo switching to 288p
## tvservice -e "CEA 23 HDMI" & sleep 3
# Use custom 288p mode instead of CEA 23 as it better matches the 240p mode on Scart TV
vcgencmd hdmi_timings 1920 1 8 192 280 288 1 6 3 16 0 0 2 50 0 37560000 1
tvservice -e "CEA 65 HDMI" & sleep 3
fbset -depth 8 && fbset -depth 16
fbset -g 960 288 960 288 16
else
if [ $h -gt 248 ]; then
# if [ $r == 54.706840 ]; then
# echo switching to 256p@54.7
# vcgencmd hdmi_timings 1920 1 113 192 175 256 1 6 3 16 0 0 2 54.706840 0 37560000 1
# tvservice -e "CEA 65 HDMI" & sleep 3
# fbset -depth 8 && fbset -depth 16
# fbset -g 960 256 960 256 16
# else
echo switching to 256p
# vcgencmd hdmi_timings 1920 1 113 192 175 256 1 6 3 16 0 0 2 56 0 37560000 1
vcgencmd hdmi_timings 1920 1 113 192 175 256 1 6 3 16 0 0 2 55.017606 0 37560000 1
tvservice -e "CEA 65 HDMI" & sleep 3
fbset -depth 8 && fbset -depth 16
fbset -g 960 256 960 256 16
# fi
else
# if [ $r == 57.500000 ]; then
#### is refresh rate between range of 57 - 58 fps
if [ $(lessThan $r 57.00) == n ] && [ $(lessThan $r 58.00) == y ]; then
echo switching to 240p@57.5
vcgencmd hdmi_timings 1920 1 113 192 175 240 1 6 3 16 0 0 2 57.500 0 37560000 1
tvservice -e "CEA 65 HDMI" & sleep 3
fbset -depth 8 && fbset -depth 16
fbset -g 960 240 960 240 16
else
echo switching to 240p@60
tvservice -e "CEA 8 HDMI" & sleep 3
fbset -depth 8 && fbset -depth 16
fbset -g 720 240 720 240 16

fi
fi
fi

exit
done

fi
fi

Post Reply