Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Use the sound settings from the configuration file #667

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Bumped virtualgamepads version - virtualkeyboard now available
- Add usb encoder 3H-Dual-Arcade, Mayflash dreamcast adapter
- Add support for smb and upnp protocols in Kodi
- Use the sound settings from the configuration file for the splash screen at boot


## [4.0.0-beta5] - 2016-08-13hs the ratio issue in mame.
Expand Down
26 changes: 26 additions & 0 deletions board/recalbox/fsoverlay/etc/init.d/K99cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our init uses the stop parameter, not K-prefixed scripts


CONFIG=/boot/recalbox-boot.conf

function set_config(){

oldvalue=`grep $1= $CONFIG | cut -d "=" -f 2`
if [ -z $oldvalue ]; then
echo $1=$2 >> $CONFIG
else
cat $CONFIG | sed "s/^\($1\s*=\s*\).*\$/\1$2/" >$CONFIG.new
cp $CONFIG.new $CONFIG
rm $CONFIG.new
fi
}

audiovolume=`grep audio.volume= /recalbox/share/system/recalbox.conf | cut -d "=" -f 2`
audiodevice=`grep audio.device= /recalbox/share/system/recalbox.conf | cut -d "=" -f 2`

if [ ! -z $audiovolume ]; then
set_config audio.volume ${audiovolume}
fi

if [ ! -z $audiodevice ]; then
set_config audio.device ${audiodevice}
fi
19 changes: 18 additions & 1 deletion board/recalbox/fsoverlay/etc/init.d/S02splash
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,24 @@ do_start ()
omx_fnt=""
omx_opt="--no-keys --layer=10000 --aspect-mode=fill"
omx_srt="--no-ghost-box --lines=1 --align=left $omx_fnt --font-size=20 --subtitles=/recalbox/system/resources/splash/recalboxintro.srt"
/usr/bin/omxplayer.bin $omx_opt $omx_srt $video &

# Use the sound settings from the configuration file
audiovolume=`grep audio.volume= /boot/recalbox-boot.conf | cut -d "=" -f 2`
audiodevice=`grep audio.device= /boot/recalbox-boot.conf | cut -d "=" -f 2`

if [ "$audiodevice" == "jack" ]; then
omx_opt=$omx_opt" --adev local"
fi

if [ "$audiodevice" == "hdmi" ]; then
omx_opt=$omx_opt" --adev hdmi"
fi

if [ ! -z $audiovolume ]; then
omx_opt=$omx_opt" --vol $audiovolume"
fi

/usr/bin/omxplayer.bin $omx_opt $omx_srt $video &
PID=$!

# Stop the video when ready
Expand Down