Skip to content

Instantly share code, notes, and snippets.

@jakebrinkmann
Last active April 25, 2024 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakebrinkmann/6e28cd7e39b76a0245e7219282a338cb to your computer and use it in GitHub Desktop.
Save jakebrinkmann/6e28cd7e39b76a0245e7219282a338cb to your computer and use it in GitHub Desktop.
HTPC (Home Theater PC), Batocera, Lakka Configs (retroarch, xclip -selection clipboard -i, Kodi, libreelec.tv,)
type adb &>/dev/null
adb --version
adb kill-server
adb start-server
# connect via usb
adb devices
adb tcpip 5555
# Disable screen timeout
# 0=disabled
# 300000=5min
# 1200000=20min
# 2147460000=24days
adb -s "$DEVICE_IP:5555" shell <<EOF
settings get system screen_off_timeout
settings get secure sleep_timeout
...
settings put system screen_off_timeout 2147460000
settings put secure sleep_timeout 0
EOF
# Batocera 39 - 2024/03/07 - Painted Lady
curl -fSLO https://updates.batocera.org/x86_64/stable/last/batocera-x86_64-x86_64-39-20240304.img.gz
gunzip -c batocera-x86_64-x86_64-39-20240304.img.gz \
| sudo dd status=progress of=/dev/sda conv=fsync \
&& sync \
&& sudo eject /dev/sda
#================================================================================
# https://wiki.batocera.org/access_the_batocera_via_ssh
ssh root@batocera.local
# linux
# OR ssh root@<192.168.0.44>
# https://wiki.batocera.org/edit_boot_partition#editing_the_boot_partition_while_batocera_is_running
vi /boot/batocera-boot.conf
# https://wiki.batocera.org/supported_pc_hardware
aplay -L
batocera-audio list
batocera-audio list-profiles
# From Batocera main MENU:
# - KODI / setting ⚙️/ System / Audio
# - In the AUDIO PASSTHROUGH - ENABLE Allow PASSTHROUGH and your TVs or Audio Passthrough DEVICE should be selected. I’m my setup I have a Samsung 57" Shown as HDA INTEL PCH , SAMSUNG on HDMI #0
# - Lastly make sure that your AUDIO OUTPUT matches KODI.
# - ON BATOCERA / System Settings / Hardware Audio Output should be set to same as above HDMI# 0
# - Set to "Auto" with "(HDMI3)" Audio Profile!
grep -RI hdmi .kodi/userdata/
# .kodi/userdata/guisettings.xml: <setting id="audiooutput.audiodevice">ALSA:hdmi:CARD=NVidia,DEV=2</setting>
# .kodi/userdata/guisettings.xml: <setting id="audiooutput.passthroughdevice">ALSA:hdmi:CARD=NVidia,DEV=2</setting>
# https://wiki.batocera.org/add_games_bios
# smb://batocera.local/share/bios/
git clone https://github.com/Abdess/retroarch_system.git ~/Downloads/BIOS
rsync --recursive --progress ~/Downloads/BIOS/* root@192.168.0.44/userdata/bios
rsync --recursive --progress --size-only ~/Downloads/ROMS/ root@192.168.0.44:/userdata/roms/
rsync --recursive --progress --size-only ~/Downloads/Kids\ -\ 2021/ root@192.168.0.44:/userdata/kodi/movies/
sudo -s
cp -f "/etc/pacman.conf" "/etc/pacman.conf.orig"
sed -i 's/SigLevel.*/SigLevel = Never/' /etc/pacman.conf
pacman -Syy gnupg archlinux-keyring manjaro-keyring --ignore manjaro-system
mv -f "/etc/pacman.conf.orig" "/etc/pacman.conf"
pacman -Syu
# https://kodi.tv/
sudo -s
killall gpg-agent
rm -rf /etc/pacman.d/gnupg/
pacman-key --init
pacman-key --populate archlinux
pacman-key --refresh-keys
pacman -S archlinux-keyring
pacman -Scc
pacman -Syu --noconfirm
pacman -Sy --noconfirm kodi
aplay -l
pactl list
pactl set-card-profile 0 output:hdmi-stereo
sudo pacman -Rs kodi
sudo nmap -sn 192.168.0.0/24
ssh root@192.168.0.30
add this parameter video=LVDS-1:d to the kernel boot command
video=dp-1:d video=LVDS-1:d video=LVDS-2:d HDMI-A-2:d HDMI-A-1:e
e => output forced to on d => output forced to off
vga=current
adding empty sshd.conf file to /storage/.cache/services folder
retroarch=0
http://www.lakka.tv/doc/PC/
Mount USB:
LAKKA: syslinux.conf
APPEND boot=LABEL=System disk=LABEL=Storage ssh vt.global_cursor_default=0 loglevel=2 video=LVDS-1:d
for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done
DP-1: disconnected
HDMI-A-1: connected
LVDS-1: disconnected
VGA-1: disconnected
LABEL installer
KERNEL /KERNEL
APPEND boot=UUID=2903-0842 installer quiet systemd.debug_shell video=HDMI-A-1:e
find / -iname syslinux.cfg
/flash/syslinux.cfg
/storage/roms/System/syslinux.cfg
/storage/roms/System-2/syslinux.cfg
mount -o remount,rw /flash
nano /flash/syslinux.cfg
mount -o remount,ro /flash
reboot
aplay -L
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
retroarch -v
[INFO] [Config]: Loading default config.
[INFO] [Config]: Looking for config in: "/storage/.config/retroarch/retroarch.cfg".
[INFO] RetroArch 1.10.2 (Git 8b6fe0a)
[INFO] [DRM]: Mode 0: (1920x1080) 1920 x 1080, 60.000000 Hz
[INFO] [DRM]: Mode 15: (1280x720) 1280 x 720, 60.000000 Hz
[INFO] [DRM]: Mode 21: (720x480) 720 x 480, 60.000000 Hz
[INFO] [DRM]: Mode 25: (640x480) 640 x 480, 60.000000 Hz
systemctl status retroarch
● retroarch.service - Retroarch
Loaded: loaded (/usr/lib/systemd/system/retroarch.service; disabled; vendor
preset: disabled)
less /usr/lib/systemd/system/retroarch.service
EnvironmentFile=-/storage/.cache/services/retroarch.conf
cat /run/libreelec/retroarch.conf
ALSA_CARD="0"
LD_LIBRARY_PATH="/usr/lib:/tmp/cores"
systemctl enable sshd
systemctl stop retroarch.service
nano /etc/retroarch.cfg
nano /storage/.config/retroarch/retroarch.cfg
# video_fullscreen_x = "960"
# video_fullscreen_y = "540"
# audio_device = "hdmi:CARD=PCH,DEV=0"
# https://wiki.libreelec.tv/project/releases
# Nightly: https://test.libreelec.tv/12.0/
curl https://test.libreelec.tv/12.0/Generic/Generic/LibreELEC-Generic.x86_64-12.0-nightly-20240422-fa623c3.img.gz \
--output LibreELEC-Generic.x86_64.img.gz
curl -fsSL https://releases.libreelec.tv/LibreELEC-Generic-legacy.x86_64-11.95.2.img.gz \
--output LibreELEC-Generic.x86_64.img.gz
# https://github.com/solbero/guide-kodi-lutris/blob/master/GUIDE.md
# https://help.ubuntu.com/community/Installation/MinimalCD
# QUESTION: is mac-mini using x86 or x86_64?
# Try Ubuntu 18.04 "Bionic Beaver"
curl -fSLO http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso
curl -fSLO http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-i386/current/images/netboot/mini.iso
# https://cdimage.ubuntu.com/xubuntu/releases/23.10/release/
# OMG IT WORKED!
curl -fSLO https://cdimage.ubuntu.com/xubuntu/releases/23.10/release/xubuntu-23.10-minimal-amd64.iso
sudo dd status=progress if=xubuntu-23.10-minimal-amd64.iso of=/dev/sda conv=fsync \
&& sync \
&& sudo eject /dev/sda
#==================================================
sudo apt install -y git openssh-server net-tools make
sudo sshd -t -f /etc/ssh/sshd_config
sudo service ssh restart
ssh htpc@192.168.4.40
# https://wiki.archlinux.org/title/Kodi
# https://www.electromaker.io/tutorial/blog/boot-to-kodi-in-manjaro-linux-on-the-raspberry-pi
#..................................................
# https://github.com/graysky2/kodi-standalone-service/tree/master
git clone https://github.com/graysky2/kodi-standalone-service.git
cd kodi-standalone-service
sudo make install
sudo systemd-sysusers
sudo systemd-tmpfiles --create
sudo service kodi-gbm start
sudo service kodi-gbm status
# active (running)...
#..................................................
sudo usermod -a -G nopasswdlogin kodi
sudo usermod -a -G cdrom,video,plugdev,users,input,netdev,dialout kodi
sudo apt-add-repository ppa:team-xbmc/ppa
sudo apt install kodi kodi-peripheral-joystick
# TODO: How to just launch without openbox? wtf is this? it "works" but...
sudo apt install openbox unzip
wget -O kodi-openbox-master.zip https://github.com/lufinkey/kodi-openbox/archive/master.zip
unzip kodi-openbox-master.zip
cd kodi-openbox-master
./build.sh
sudo dpkg -i kodi-openbox.deb
sudo nano /etc/lightdm/lightdm.conf
# [Seat:*]
# autologin-user=kodi
# autologin-session=kodi-openbox
#..................................................
# Settings > System > Addons > Unknown Sources
# Install diggz repo -> Fenlight
# source: https://diggz1.me/diggzrepo
# Install coco repo -> Coco scrapers
# source: https://cocojoe2411.github.io
# Install ivarbrandt -> Fentastic skin
# source: https://ivarbrandt.github.io/repository.ivarbrandt
# Get usb device
sudo fdisk -l
lsblk
# Write zeros over everything
sudo dd status=progress if=/dev/zero of=/dev/sda bs=4k && sync
# make new partition table
# - `o` to create a new empty DOS partition table.
# - `n` to add a new partition.
# - `w` to write.
sudo fdisk /dev/sda
sudo mkfs.vfat /dev/sda1
sudo eject /dev/sda
# https://aur.archlinux.org/packages/unetbootin
pkgname=unetbootin
[ -d /tmp/$pkgname ] || \
git clone https://aur.archlinux.org/$pkgname.git /tmp/$pkgname && \
cd /tmp/$pkgname && \
makepkg -Acsf --skippgpcheck && \
sudo pacman --noconfirm -U ./*.pkg.tar.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment