audio ampli now started/stopped at the right times, bug corrections in snap, remount of mnt in case of error no more in ro

This commit is contained in:
Vincent-FK 2021-01-11 10:14:12 +01:00
parent a0b6d3f8e8
commit a77c5e67d9
14 changed files with 31 additions and 29 deletions

View File

@ -8,4 +8,4 @@ tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
/dev/mmcblk0p3 none swap sw 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
/dev/mmcblk0p4 /mnt vfat rw,relatime,fmask=0022,dmask=0022,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/mmcblk0p4 /mnt vfat rw,relatime,fmask=0022,dmask=0022,iocharset=iso8859-1,shortname=mixed 0 0

View File

@ -41,11 +41,9 @@ resize() {
}
# Start ampli if necessary
echo "Start audio amplifier if necessary"
if [[ "$(volume_get)" -ne "0" ]]; then
start_audio_amp 1 >/dev/null 2>&1
fi
# Start ampli
echo "Start audio amplifier"
start_audio_amp 1 >/dev/null 2>&1
# Force unmute sound card and reset volume
echo "Force unmute sound card and reset volume"

View File

@ -1,5 +1,5 @@
#!/bin/sh
notif_set 0 "Getting system stats..."
notif_set 0 " Getting system stats..."
killall -s USR1 system_stats
exit 0

View File

@ -12,19 +12,20 @@ fi
# Lock file (necessary since fbgrab must run in bg not to block the buttons while gaming)
LOCK_FILE="/var/lock/snap.lock"
if [ -f "${LOCK_FILE}" ]; then
#echo "${LOCK_FILE} already exists"
echo "${LOCK_FILE} already exists"
exit 1
fi
touch "${LOCK_FILE}"
# Increment name and save snapshot
SNAPSHOT_DIR=/mnt/funkey/snapshots
SNAPSHOT_EXT=PNG
mkdir -p "${SNAPSHOT_DIR}"
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.PNG 2> /dev/null | tail -1 | sed 's/^IMG_0*\([0-9]\+\)\.PNG$/\1/')
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.${SNAPSHOT_EXT} 2> /dev/null | tail -1 | sed 's/^IMG_0*\([0-9]\+\)\.'${SNAPSHOT_EXT}'$/\1/')
let last=${last}+1
snapshot_file=$(printf "IMG_%04d.PNG" $last)
notif_set 2 " NEW SCREEENSHOT ${snapshot_file}"
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" &
snapshot_file=$(printf "IMG_%04d.${SNAPSHOT_EXT}" $last)
notif_set 2 " SCREEENSHOT ${snapshot_file}"
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" >/dev/null 2>&1 &
# Remove lock file
rm -f "${LOCK_FILE}"

View File

@ -6,10 +6,16 @@ if [ ${#} -ne 1 ]; then
exit 1
fi
# Check Enable arg
# Check enable arg
enable=${1}
if [ ${enable} -eq 1 ]; then
echo "Turning audio amplifier ON"
# Turn ON only if volume is not null
if [ "$(volume_get)" -ne "0" ]; then
echo "Turning audio amplifier ON"
else
exit 0
fi
elif [ ${enable} -eq 0 ]; then
echo "Turning audio amplifier OFF"
else

View File

@ -39,9 +39,6 @@ while true; do
else
if [ -f "${GMENU2X_FILE}" ]; then
# Force stop ampli (no sound in gmenu2x)
start_audio_amp 0
# Launch gmenu2x
gmenu2x&
else

View File

@ -20,9 +20,9 @@ while true; do
if [ ${perform} -eq 1 ]; then
# Compute stats
cpu=$(printf "%.1f\n" $(mpstat -P ALL $UPDATE_PERIOD 1 | tail -1 | awk '{print 100-$12}'))
ram_mem=$(printf "%.1f\n" $(free | grep Mem | awk '{print $3/$2 * 100.0}'))
ram_swap=$(printf "%.1f\n" $(free | grep Swap | awk '{print $3/$2 * 100.0}'))
cpu=$(printf "%.0f\n" $(mpstat -P ALL $UPDATE_PERIOD 1 | tail -1 | awk '{print 100-$12}'))
ram_mem=$(printf "%.0f\n" $(free | grep Mem | awk '{print $3/$2 * 100.0}'))
ram_swap=$(printf "%.0f\n" $(free | grep Swap | awk '{print $3/$2 * 100.0}'))
ip_addr=$(ifconfig usb0 | grep "inet " | awk -F'[: ]+' '{ print $4 }')
# Notif
@ -31,9 +31,9 @@ while true; do
notif_dirty=0
else
if [ "x${ip_addr}" != "x" ]; then
notif_set 0 "CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%^IP:${ip_addr}"
notif_set 0 " CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%^IP:${ip_addr}"
else
notif_set 0 "CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%"
notif_set 0 " CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%"
fi
fi
else

View File

@ -4,7 +4,7 @@
#
################################################################################
FCEUX_VERSION = addf9a3
FCEUX_VERSION = dd70596
FCEUX_SITE_METHOD = git
FCEUX_SITE = https://github.com/FunKey-Project/fceux.git
FCEUX_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
PCSX_REARMED_VERSION = 048e75a
PCSX_REARMED_VERSION = 65524b1
PCSX_REARMED_SITE_METHOD = git
PCSX_REARMED_SITE = https://github.com/FunKey-Project/pcsx_rearmed.git
PCSX_REARMED_LICENSE = GPL-2.0

View File

@ -3,7 +3,7 @@
# gmenu2x
#
#############################################################
GMENU2X_VERSION = 4220f3a
GMENU2X_VERSION = 85402aa
GMENU2X_SITE_METHOD = git
GMENU2X_SITE = https://github.com/FunKey-Project/gmenu2x.git
GMENU2X_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
GNUBOY_VERSION = 63fcd82
GNUBOY_VERSION = 739c975
GNUBOY_SITE_METHOD = git
GNUBOY_SITE = https://github.com/FunKey-Project/gnuboy.git
GNUBOY_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
GPSP_VERSION = fd81d8a
GPSP_VERSION = f0728b4
GPSP_SITE_METHOD = git
GPSP_SITE = https://github.com/FunKey-Project/gpsp.git
GPSP_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
MEDNAFEN_VERSION =f4755e3
MEDNAFEN_VERSION = f873a3b
MEDNAFEN_SITE_METHOD = git
MEDNAFEN_SITE = https://github.com/FunKey-Project/mednafen-git.git
MEDNAFEN_LICENSE = GPL-2.0+

View File

@ -4,7 +4,7 @@
#
################################################################################
PICODRIVE_VERSION = e37c0fa
PICODRIVE_VERSION = f3d4a3a
PICODRIVE_SITE_METHOD = git
PICODRIVE_SITE = https://github.com/FunKey-Project/picodrive.git
PICODRIVE_LICENSE = MAME