Merge branch 'main' into dev

This commit is contained in:
fewtarius 2022-02-11 05:55:25 -05:00
commit a45fcf4431
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
27 changed files with 69 additions and 589 deletions

View file

@ -90,14 +90,15 @@ post_install() {
# Split this up into other packages
cp ${PKG_DIR}/sources/autostart/autostart ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/lib/autostart/${DEVICE}
mkdir -p ${INSTALL}/usr/lib/autostart/common
mkdir -p ${INSTALL}/usr/lib/autostart/sounds
mkdir -p ${INSTALL}/usr/lib/autostart/daemons
cp ${PKG_DIR}/sources/autostart/sounds/* ${INSTALL}/usr/lib/autostart/sounds
cp ${PKG_DIR}/sources/autostart/common/* ${INSTALL}/usr/lib/autostart/common
cp ${PKG_DIR}/sources/autostart/daemons/* ${INSTALL}/usr/lib/autostart/daemons
cp ${PKG_DIR}/sources/autostart/${DEVICE}/* ${INSTALL}/usr/lib/autostart/${DEVICE}
if [ -d "${PKG_DIR}/sources/autostart/${DEVICE}" ]
then
mkdir -p ${INSTALL}/usr/lib/autostart/${DEVICE}
cp ${PKG_DIR}/sources/autostart/${DEVICE}/* ${INSTALL}/usr/lib/autostart/${DEVICE}
fi
chmod -R 0755 ${INSTALL}/usr/lib/autostart ${INSTALL}/usr/bin/autostart
enable_service jelos-autostart.service
@ -113,11 +114,10 @@ EOF
cp ${PKG_DIR}/sources/pico-8.sh ${INSTALL}/usr/bin
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
if [[ ${DEVICE} =~ RG351 ]]; then
cp ${PKG_DIR}/sources/asound/rg351/asound.conf ${INSTALL}/usr/config/
elif [[ ${DEVICE} =~ RG552 ]]; then
cp ${PKG_DIR}/sources/asound/rg552/asound.conf ${INSTALL}/usr/config/
cp ${PKG_DIR}/sources/asound/rg552/asound.state ${INSTALL}/usr/config/
if [ -d "${PKG_DIR}/sources/asound/${DEVICE}" ]
then
cp ${PKG_DIR}/sources/asound/${DEVICE}/* ${INSTALL}/usr/config/
fi
rm -f ${INSTALL}/usr/bin/{sh,bash,busybox,sort}

View file

@ -0,0 +1,20 @@
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}

View file

@ -1,24 +0,0 @@
pcm.!default {
type plug
slave.pcm "softvol"
}
pcm.softvol {
type softvol
slave {
pcm "dmix"
}
control {
name "Master"
card 0
}
}
ctl.!default {
type hw
card 0
}
ctl.softvol {
type hw
card 0
}

View file

@ -1,472 +0,0 @@
state.es8316 {
control.1 {
iface MIXER
name 'HP Playback Volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
range '0 - 0'
dbmin -4800
dbmax -4800
dbvalue.0 -4800
dbvalue.1 -4800
}
}
control.2 {
iface MIXER
name 'HPMixer Gain'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
range '0 - 7'
dbmin -1200
dbmax -150
dbvalue.0 -1200
dbvalue.1 -1200
}
}
control.3 {
iface MIXER
name 'DAC Playback Volume'
value.0 192
value.1 192
comment {
access 'read write'
type INTEGER
count 2
range '0 - 192'
dbmin -9999999
dbmax 0
dbvalue.0 0
dbvalue.1 0
}
}
control.4 {
iface MIXER
name 'Enable DAC Soft Ramp'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'DAC Soft Ramp Rate'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 4'
}
}
control.6 {
iface MIXER
name 'Playback Polarity'
value Normal
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Normal
item.1 'R Invert'
item.2 'L Invert'
item.3 'L + R Invert'
}
}
control.7 {
iface MIXER
name 'DAC Notch Filter'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.8 {
iface MIXER
name 'DAC Double Fs Mode'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.9 {
iface MIXER
name 'DAC Volume Control-LeR'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 1'
}
}
control.10 {
iface MIXER
name 'DAC Stereo Enhancement'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
control.11 {
iface MIXER
name 'MIC Boost'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.12 {
iface MIXER
name 'Input PGA'
value 6
comment {
access 'read write'
type INTEGER
count 1
range '0 - 8'
}
}
control.13 {
iface MIXER
name 'ADC Capture Volume'
value 192
comment {
access 'read write'
type INTEGER
count 1
range '0 - 192'
dbmin -9999999
dbmax 0
dbvalue.0 0
}
}
control.14 {
iface MIXER
name 'ADC Soft Ramp'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.15 {
iface MIXER
name 'Capture Polarity'
value Normal
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Normal
item.1 Invert
}
}
control.16 {
iface MIXER
name 'ADC Double FS Mode'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.17 {
iface MIXER
name 'ALC Capture Target Volume'
value 10
comment {
access 'read write'
type INTEGER
count 1
range '0 - 10'
}
}
control.18 {
iface MIXER
name 'ALC Capture Max PGA'
value 13
comment {
access 'read write'
type INTEGER
count 1
range '0 - 28'
}
}
control.19 {
iface MIXER
name 'ALC Capture Min PGA'
value 8
comment {
access 'read write'
type INTEGER
count 1
range '0 - 28'
}
}
control.20 {
iface MIXER
name 'ALC Capture Function'
value On
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Off
item.1 On
}
}
control.21 {
iface MIXER
name 'ALC Capture Hold Time'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 10'
}
}
control.22 {
iface MIXER
name 'ALC Capture Decay Time'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 10'
}
}
control.23 {
iface MIXER
name 'ALC Capture Attack Time'
value 5
comment {
access 'read write'
type INTEGER
count 1
range '0 - 10'
}
}
control.24 {
iface MIXER
name 'ALC Capture NG Threshold'
value 1
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
}
}
control.25 {
iface MIXER
name 'ALC Capture NG Type'
value 'Mute ADC Output'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Constant PGA Gain'
item.1 'Mute ADC Output'
}
}
control.26 {
iface MIXER
name 'ALC Capture NG Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.27 {
iface MIXER
name 'Differential Mux'
value lin1-rin1
comment {
access 'read write'
type ENUMERATED
count 1
item.0 lin1-rin1
item.1 lin2-rin2
item.2 'lin1-rin1 with 20db Boost'
item.3 'lin2-rin2 with 20db Boost'
}
}
control.28 {
iface MIXER
name 'Digital Mic Mux'
value 'dmic disable'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'dmic disable'
item.1 'dmic data at high level'
item.2 'dmic data at low level'
}
}
control.29 {
iface MIXER
name 'DAC SRC Mux'
value 'LDATA TO LDAC, RDATA TO RDAC'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'LDATA TO LDAC, RDATA TO RDAC'
item.1 'LDATA TO LDAC, LDATA TO RDAC'
item.2 'RDATA TO LDAC, RDATA TO RDAC'
item.3 'RDATA TO LDAC, LDATA TO RDAC'
}
}
control.30 {
iface MIXER
name 'Left Hp mux'
value lin1-rin1
comment {
access 'read write'
type ENUMERATED
count 1
item.0 lin1-rin1
item.1 lin2-rin2
item.2 'lin-rin with Boost'
item.3 'lin-rin with Boost and PGA'
}
}
control.31 {
iface MIXER
name 'Right Hp mux'
value lin1-rin1
comment {
access 'read write'
type ENUMERATED
count 1
item.0 lin1-rin1
item.1 lin2-rin2
item.2 'lin-rin with Boost'
item.3 'lin-rin with Boost and PGA'
}
}
control.32 {
iface MIXER
name 'LLIN Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.33 {
iface MIXER
name 'Left DAC Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.34 {
iface MIXER
name 'RLIN Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.35 {
iface MIXER
name 'Right DAC Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.36 {
iface MIXER
name Master
value.0 255
value.1 255
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '0000000100000008ffffec1400000014'
dbmin -5100
dbmax 0
dbvalue.0 0
dbvalue.1 0
}
}
}
state.HDMI {
control.1 {
iface PCM
name ELD
value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read volatile'
type BYTES
count 128
}
}
control.2 {
iface PCM
name 'AUDIO MODE'
value 0
comment {
access 'read write volatile'
type INTEGER
count 1
range '0 - 2'
}
}
control.3 {
iface PCM
name 'Playback Channel Map'
value.0 0
value.1 0
value.2 0
value.3 0
value.4 0
value.5 0
value.6 0
value.7 0
comment {
access read
type INTEGER
count 8
range '0 - 36'
}
}
}

View file

@ -0,0 +1 @@
RG351P

View file

@ -1,14 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
# Copy in the configuration
if [ ! -e "/storage/.config/asound.conf" ]
then
cp /usr/config/asound.conf /storage/.config
fi
VOL=$(get_setting "audio.volume" 2>/dev/null)
amixer set "${DEVICE_AUDIO_MIXER}" ${VOL}%

View file

@ -1,3 +1,4 @@
. /etc/profile
# Enable GPIO 77 for power LED manipulation
echo ${DEVICE_LED} > /sys/class/gpio/export 2>/dev/null

View file

@ -0,0 +1 @@
RG351P

View file

@ -1,14 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
# Copy in the configuration
if [ ! -e "/storage/.config/asound.conf" ]
then
cp /usr/config/asound.conf /storage/.config
fi
VOL=$(get_setting "audio.volume" 2>/dev/null)
amixer set "${DEVICE_AUDIO_MIXER}" ${VOL}%

View file

@ -1,31 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
# Copy in the configuration
if [ ! -e "/storage/.config/asound.conf" ]
then
cp /usr/config/asound.conf /storage/.config
fi
# Link Alsa state
if [ ! -e "/storage/.config/asound.state" ]
then
cp /usr/config/asound.state /storage/.config/
fi
if [ ! -e "/storage/.config/asound.state" ]
then
mkdir -p /var/lib/alsa
ln -s /storage/.config/asound.state /var/lib/alsa/asound.state
fi
alsactl --no-ucm init
alsactl --no-ucm restore -f /storage/.config/asound.state
aplay /usr/lib/autostart/sounds/silence.ogg
VOL=$(get_setting "audio.volume" 2>/dev/null)
alsactl --no-ucm store -f /storage/.config/asound.state
amixer set "${DEVICE_AUDIO_MIXER}" ${VOL}%

View file

@ -0,0 +1,11 @@
. /etc/profile
# Silence PWM
echo 0 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/export 2>/dev/null
echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period 2>/dev/null
echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable 2>/dev/null
echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle 2>/dev/null
# Enable WIFI
echo ${DEVICE_WIFI} > /sys/class/gpio/export 2>/dev/null
echo out > /sys/class/gpio/gpio${DEVICE_WIFI}/direction 2>/dev/null
echo 1 > /sys/class/gpio/gpio${DEVICE_WIFI}/value 2>/dev/null
fbset -g 1152 1920 1152 1920 32 2>/dev/null

View file

@ -10,15 +10,15 @@ maxperf 2>&1 >${BOOTLOG}
/usr/bin/show_splash intro 2>&1 >>${BOOTLOG}
### Run common start scripts
for script in /usr/lib/autostart/common/*
### Run device specific start scripts
for script in /usr/lib/autostart/${HW_DEVICE}/*
do
echo "Executing ${script}" 2>&1 >>${BOOTLOG}
${script} 2>&1 >>${BOOTLOG}
done
### Run device specific start scripts
for script in /usr/lib/autostart/${HW_DEVICE}/*
### Run common start scripts
for script in /usr/lib/autostart/common/*
do
echo "Executing ${script}" 2>&1 >>${BOOTLOG}
${script} 2>&1 >>${BOOTLOG}

View file

@ -220,9 +220,11 @@ makeinstall_init() {
cp $PKG_DIR/scripts/functions $INSTALL
cp $PKG_DIR/scripts/init $INSTALL
cp ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/device.config ${INSTALL}
cp ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/device.init ${INSTALL}
chmod 755 ${INSTALL}/device.config ${INSTALL}/device.init
if [ -e "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/device.init" ]
then
cp ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/device.init ${INSTALL}
chmod 755 ${INSTALL}/device.init
fi
sed -e "s/@DISTRONAME@/$DISTRONAME/g" \
-e "s/@KERNEL_NAME@/$KERNEL_NAME/g" \

View file

@ -56,7 +56,6 @@ TEE_PID=""
# common functions
. /functions 2>/dev/null
. /device.config 2>/dev/null
. /device.init 2>/dev/null
# Get a serial number if present (eg. RPi) otherwise use MAC address from eth0
@ -1103,6 +1102,11 @@ prepare_sysroot() {
fi
[ -f "/sysroot/usr/lib/systemd/systemd" ] || error "final_check" "Could not find systemd!"
if [ ! -f "/sysroot/storage/.configured" ]
then
echo -ne "\033[100H\033[2K==> Initializing system, please wait.." >/dev/console
fi
}
check_amlogic_dtb() {

View file

@ -16,7 +16,7 @@ PKG_SHORTDESC="Emulationstation emulator frontend"
PKG_BUILD_FLAGS="-gold"
GET_HANDLER_SUPPORT="git"
PKG_PATCH_DIRS="${DEVICE}"
PKG_PATCH_DIRS+="${DEVICE}"
# themes for Emulationstation
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} es-theme-art-book-next"
@ -56,7 +56,7 @@ makeinstall_target() {
if [ "${DEVICE}" == "RG552" ]
then
sed -i 's#<string name="AudioDevice" value="Playback" />#<string name="AudioDevice" value="Master" />#' $INSTALL/usr/config/emulationstation/es_settings.cfg
sed -i 's#<string name="AudioDevice" value="Playback" />#<string name="AudioDevice" value="DAC" />#' $INSTALL/usr/config/emulationstation/es_settings.cfg
fi
chmod +x $INSTALL/usr/config/emulationstation/scripts/*

View file

@ -4,7 +4,7 @@
DEVICE_HAS_FAN=true
DEVICE_FAKE_JACKSENSE=false
DEVICE_VOLUMECTL=true
DEVICE_AUDIO_MIXER="Master"
DEVICE_AUDIO_MIXER="DAC"
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-volume-keys-event"
DEVICE_CONTROLLER_DEV="/dev/input/by-path/platform-singleadc-joypad-event-joystick"
DEVICE_BRIGHTNESS="50"

View file

@ -1,10 +1,5 @@
# Silence PWM
echo 0 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/export 2>/dev/null
echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period 2>/dev/null
echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable 2>/dev/null
echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle 2>/dev/null
# Enable WIFI
echo ${DEVICE_WIFI} > /sys/class/gpio/export 2>/dev/null
echo out > /sys/class/gpio/gpio${DEVICE_WIFI}/direction 2>/dev/null
echo 1 > /sys/class/gpio/gpio${DEVICE_WIFI}/value 2>/dev/null
# Inform init that this is a rotated display
DISPLAY_ROTATED=true
# Rotate the display on the 552.
fbset -g 1152 1920 1152 1920 32 2>/dev/null

View file

@ -65,7 +65,7 @@
# for a list of additional drivers see packages/linux-drivers
# Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="RTL8812AU RTL8188EU" #RTL8188FU RTL8188EU RTL8814AU RTL8192DU RTL8812AU RTL8821CU RTL8192CU RTL8192EU
# ADDITIONAL_DRIVERS="RTL8812AU RTL8188EU" #RTL8188FU RTL8188EU RTL8814AU RTL8192DU RTL8812AU RTL8821CU RTL8192CU RTL8192EU
# build and install driver addons (yes / no)
DRIVER_ADDONS_SUPPORT="no"

View file

@ -132,6 +132,7 @@ pre_make_target() {
git clone https://github.com/arter97/exfat-linux.git
cd exfat-linux
git checkout old
rm -rf .git
cd $PKG_BUILD/fs
if [ -d "exfat" ]
then
@ -151,10 +152,6 @@ pre_make_target() {
}
make_target() {
kernel_make modules
kernel_make INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) modules_install
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/source
if [ "$PKG_BUILD_PERF" = "yes" ] ; then
( cd tools/perf
@ -209,6 +206,9 @@ make_target() {
# file with symbols from built-in and external modules.
# Without that it'll contain only the symbols from the kernel
kernel_make $KERNEL_TARGET $KERNEL_MAKE_EXTRACMD modules
kernel_make INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) modules_install
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/source
if [ -n "$KERNEL_UIMAGE_TARGET" ] ; then