# we assume you have a PC with Windows system and 7zip (or Winrar) installed
# and GParted Live USB stick bootable
# more info on GParted website to create your a bootable Live system)
# and another USB drive for the image disk
WINDOWS PC
# download the distribution from our website/github and extract it with 7zip (or Winrar)
# insert your USB drive and format it using NTFS with for example ‘imgdisk’ name
# then copy the extracted image disk (.img) from Windows to your USB drive
# optional: rename image disk to musiclounge.img or medialounge.img
BAREBONE PC (HTPC)
# insert the the GParted Live USB, the imgdisk usb stick, plug a keyboard (and optionally a mouse)
# and turn the HTPC ON
# quickly hit F10 (NUC) or F12 to show up the boot menu
# boot UEFI:disk corresponding to GParted live USB
# GParted app should be opened so you can identify easily
# your internal hard drive (/dev/sda) and your USB stick ‘imgdisk’ (/dev/sdX)
# in our example:
internal hard drive (ssd): /dev/sda
imgdisk partition 1: /dev/sdb1
# QUIT GParted app
# open terminal with root permissions
# mount your usb imgdisk
$ mount/dev/sdX /media
$ cd/media
$ ls
# IMPORTANT: check the integrity of the image disk
$ sha1sum medialounge....img
# compare the result with the SHA1 line on website
# if this doesn’t match then your image disk is corrupted, you can’t go further until your img disk is clean
# clone from image disk to your internal disk (/dev/sda)
# ALL DATA IN INTERNAL HARD DRIVE/SSD WILL BE ERASED
# download the distribution from our website/github and extract it with 7zip or Winrar
# IMPORTANT: check the integrity of the image disk
# and compare the result with the corresponding SHA256 line on website
# run powershell (i.e. Windows Terminal) and type:
Get-FileHash C:\path\to\imagedisk.img
# if this doesn’t match then your image disk is corrupted, you can’t go further until your img disk is clean
# connect your SSD (or 2.5″ Hard drive) to your PC with the Startech USB3 To SATA adapter
# then run Rufus and select the image disk, tick the “List USB Hard Drives” and select your SSD
# clone from image disk to your internal disk
#ALL DATA IN INTERNAL HARD DRIVE/SSD WILL BE ERASED
# After the cloning, close Rufus, disconnect the adapter cable from the PC and mount the SSD inside your Barebone PC/NUC
BAREBONE PC (HTPC)
# insert the the GParted Live USB, plug a keyboard (and optionally a mouse)
# and turn the HTPC ON
# quickly hit F10 (NUC) or F12 to show up the boot menu
# boot UEFI:disk corresponding to GParted live USB
# GParted app should be opened so you can identify easily
# your internal hard drive (/dev/sda)
# Fix the GPT backup header/table if GParted prompts to do so
# resize the root partition of your internal disk (/dev/sda3)
# double-check and APPLY all changes
# expand partition 3 (minimum 16GB)
# shutdown your HTPC
# remove both GParted live usb
# congrats! You are now ready to enjoy your distribution
# Audiophile Music Player And Kodi Home Theater Software# # the best combo to take benefit to your audio and video system # Ubuntu Kinetic Kudu Live 22.10 Based (Kernel 5.19)
# follow instructions below to build your own Audiophile Home Theater Server # MediaLounge server includes almost all audiophile services of MusicLounge with the addition of Kodi Home Theater software, HEVC – 4K60fps – HDR10 supported (tested on Intel NUC)
# To get the best audio quality # Connect the USB dac to the stereo HIFI pre-amp using a dedicated stereo hifi speakers # and the HDMI cable to a 3.1 or 5.1 or 7.1 AV Receiver with dedicated home theater speakers
# Full Session Transcription
# install Ubuntu Live Server amd64
# select minimal server installation (set Minimized option) # username pi # hostname medialounge
# pick username pi # password musiclounge
# Install openSSH [yes]
# in case of server install stuck on “curtin command in-target” with “Install Complete!” on top bar # check by selecting [View Full Log] and if the install is freezed then # choose “cancel update & reboot” # (force reboot if needed)
# server is now installed
# open ssh sesssion # follow the instructions below
login pi
# install nano
$ sudo apt installnano
# disable cd-rom release, comment cdrom line in sources list if exists
$ sudonano/etc/apt/sources.list
#deb [check-date=no] file:///cdrom jammy main restricted
# CTRL X +Y to SAVE
#update distro
$ sudo apt update
#upgrade
$ sudo apt upgrade
# check for update again until All packages are up to date.
# in case of “The following packages have been kept back:” # force install of left back pkgs
$ sudoapt-get install(list of packages)
# install auto completion
$ sudoapt-get install bash-completion
# logout # reopen ssh sesssion
# add sudoers after installation
$ sudonano/etc/sudoers
# add the line below after root ALL=(ALL:ALL) ALL
user ALL=(ALL:ALL) ALL
# CTRL X +Y to SAVE
$ mkdir Downloads
$ mkdir scripts
$ ls
# hostname
# check hostname should be musiclounge or medialounge hostnamectl
$ sudonano/etc/hostname
# check host
$ sudonano/etc/hosts
# disable cloud-init
$ sudotouch/etc/cloud/cloud-init.disabled
# Disable all cloud services # uncheck all except “No-Cloud” on first line
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# with:
location /favicon.ico {
alias /var/www/html/ml_play.png;
}
location /music {
alias /mnt/media;
}
location /mympd/ {
proxy_pass http://127.0.0.1:8080/;
}
location / {
return 301 http://$host:8080/;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# CTRL X +Y to SAVE
$ sudomkdir/var/www/html/tmp
$ sudo usermod -a-G www-data pi
$ sudochown-R www-data:www-data /var/www
$ sudochmod-R g+rwX /var/www
$ sudoln-s/var/www/ ~/www
$ sudo systemctl restart nginx
# add pi to audio and other groups
$ sudo usermod -aG adm,dialout,cdrom,sudo,audio,www-data,video,plugdev,games,users,input,render,netdev pi
# for Raspberry PI add gpio i2c spi
$ sudo usermod -aG adm,dialout,cdrom,sudo,audio,www-data,video,plugdev,games,users,input,render,netdev,gpio,i2c,spi pi
# check ALSA
$ aplay-l
# in case of error or no sound card try
$ sudoaplay-l
# if OK with list of sound cards including your DAC
# edit /etc/mpd.conf (copy / paste conf read tutorial) # mpd is configured with sound card 1 (“hw:1,0”)
# backup
$ sudocp/etc/mpd.conf Downloads/mpd.conf.bak
# clear
$ sudo truncate -s0/etc/mpd.conf
# edit
$ sudonano/etc/mpd.conf
# copy and paste these lines
music_directory "/mnt/media"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/log/mpd/mpd.log"
# uncomment pid_file if you do not use systemd
#pid_file "/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "mpd"
group "audio"
bind_to_address "any"
port "6600"
log_level "default"
restore_paused "yes"
#save_absolute_paths_in_playlists "no"
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
#metadata_to_use "+comment"
auto_update "no"
#auto_update_depth "3"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
zeroconf_enabled "no"
zeroconf_name "Music DAC"
connection_timeout "120"
#password "password@read,add,control,admin"
#default_permissions "read,add,control,admin"
#
###############################################################################
# Database #######################################################################
#
#database {
# plugin "proxy"
# host "other.mpd.host"
# port "6600"
#}
# Input #######################################################################
#
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
# QOBUZ input plugin
input {
enabled "no"
plugin "qobuz"
# app_id "ID"
# app_secret "SECRET"
# username "USERNAME"
# password "PASSWORD"
# format_id "N"
}
# TIDAL input plugin
input {
enabled "no"
plugin "tidal"
# token "TOKEN"
# username "USERNAME"
# password "PASSWORD"
# audioquality "Q"
}
# Decoder #####################################################################
#
decoder {
plugin "ffmpeg"
enabled "yes"
# gapless "no"
}
decoder {
plugin "wildmidi"
enabled "no"
}
replaygain "off"
replaygain_preamp "0"
#replaygain_missing_preamp "0"
#replaygain_limit "yes"
volume_normalization "no"
filesystem_charset "UTF-8"
###############################################################################
audio_output {
type "alsa"
name "Default"
device "hw:1,0"
mixer_type "none"
dop "no"
}
audio_output {
type "alsa"
name "ALSA DAC DOP"
device "hw:1,0"
mixer_type "none"
dop "yes"
}
audio_output {
type "alsa"
name "ALSA DAC NoDOP"
device "hw:1,0"
mixer_type "none"
dop "no"
}
audio_buffer_size "4096"
#buffer_before_play "10%"
max_output_buffer_size "131072"
max_connections "128"
audio_output {
type "alsa"
name "ALSA EQ"
device "plug:plugequal"
# format "44100:16:2" # optional
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
}
# optional output to stream music to local device (phone, tablet, pc,...)
audio_output {
type "httpd"
name "Local Stream"
encoder "vorbis"
#encoder "lame" # comment vorbis and use lame for iOS support
port "8000"
quality "5.0" # do not define if bitrate is defined
#bitrate "128" # do not define if quality is defined
#format "44100:16:1"
always_on "yes" # prevent MPD from disconnecting all listeners when playback
tags "yes" # httpd supports sending tags to listening streams.
}
# CTRL + X the Y to SAVE
# start MPD service
$ sudo systemctl restart mpd
# configure smb share points
# (copy/past at the end, read the tutorial)
$ sudonano/etc/samba/smb.conf
[playlists]
path = /var/lib/mpd/playlists
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = mpd
[music]
path = /mnt/media
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = mpd
[www]
path = /var/www/html
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = www-data
[Downloads]
path = /home/pi/Downloads
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = pi
[scripts]
path = /home/pi/scripts
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = pi
[sdcard]
path = /home/pi
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = root
# CTRL + X the Y to SAVE
$ sudo/etc/init.d/smbd restart
# now you have acces to www folder from the network # download and copy at least the faveicon ( ml_play.png by default) # and your hmtl files if used [ml_play.png] image
# optional set log level to ERROR (3) (avoid thousands WARN AlbumArtistSort missing in log)
$ sudonano/var/lib/mympd/config/loglevel
# CTRL + X the Y to SAVE
# start myMPD
$ sudo systemctl enable mympd
$ sudo systemctl start mympd
$ sudo systemctl status mympd
# return home
$ cd ~/
# ALSA EQ
$ sudoapt-get install libasound2-plugin-equal
$ sudonano/var/lib/mpd/.asoundrc
pcm.!default {
type plug
slave.pcm plugequal;
}
ctl.!default {
type hw card 0
}
ctl.equal {
type equal;
}
pcm.plugequal {
type equal;
slave.pcm "plughw:1,0"; # NOTE this line MUST be your hardware device.
}
pcm.equal {
type plug;
slave.pcm plugequal;
}
# CTRL + X the Y to SAVE
# check ALSA EQ
$ sudo-H-u mpd alsamixer -D equal
# trigger scripts with a remote control to configure the EQ # examples # scripts select automatically the ALSA EQ audio output (see the MPD conf for more info)
# be patient could take a while if your music library is big… mpc update
# reopen SSH session
# check the Roon tutorial HERE to install Roon Server if needed
# cleanup pkgs
$ sudo apt clean
$ sudo apt autoremove
# Congrats! the first “Audiophile” part of this distro is ready
# time to enjoy your music and test if the # audiophile server part is correctly installed.
# browse and play your music from a browser using myMPD http://medialounge:8080 # or with a MPD client like MALP or DroidMyMPD # check the remote control # use a DLNA client VLC or BubbleUPnP to browse and play your music # check the upnp renderer # check Spotify by playing your favorite # song and using MediaLounge Spotify Connect # check the AirPlay with apple device or TuneBlade on Windows # and open your Roon client to browse and play you music
[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target
[Service]
User = pi
Group = pi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = on-abort
RestartSec = 5
[Install]
WantedBy = multi-user.target
# CTRL + X the Y to SAVE
$ sudo systemctl daemon-reload
$ sudo systemctl enable kodi
$ sudo systemctl start kodi
$ sudo systemctl status kodi
# add kodi smb share points at the end of conf
$ sudonano/etc/samba/smb.conf
[kodi]
path = /home/pi/.kodi
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = pi
[userdata]
path = /home/pi/.kodi/userdata
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = pi
# CTRL + X the Y to SAVE
$ sudo systemctl restart smbd
$ sudo reboot
# Adding media source to Kodi
# IMPORTANT NOTICE for Windows network SMB share in Kodi 20 # make sure to configure your NAS with shared folders using SMB v2 or v3 and with # access to everyone (no user/pass)
# setup KODI SMB service with minimum version SMBv2 and maximum SMBv3 # browse the network from a PC and check if you have a full access to shared # folders without needing to enter your credential # then in Kodi create your movies, TV shows, etc. source points (i.e. //MYSERVER/Video ) with # a dummy username and password (like username: srcmedia and paswd: srckodi)
# OPTIONAL: create Video and TV Shows folders if you store the media on the server (not recommended)
$ cd ~/
$ mkdir Video
$ mkdir"TV Shows"
# setup HDMI CEC
# do not forget to add the Pulse Heigh CEC adapter ( https://www.pulse-eight.com ) to be able to use the TV remote control even with the Intel NUC which have a poor CEC implementation (you may need to deactivated internal IR Receiver and HDMI CEC in Intel NUC Bios).
# Congrats! The audiophile server and the Kodi Home Theater are ready
# setup the Kodi SYSTEM > AUDIO > and choose the correct number of speakers # activate the passthrough to take benefit of Dolby, DTS, trueHD, etc.
# install rc6 mce IR remote control with Kodi 20
# by default Kodi manages the RC6 MCE remote control if your usb dongle is installed or the built in extended IR receiver is set in your bios # unfortunately some essential buttons of the remote control do not work like BACK (KEY_BACK) and OK (KEY_OK) for example. Read the instructions below to fix it. # open SSH session # install ir-keytable
$ sudo apt install ir-keytable
# check if remote control is recognized
$ sudo ir-keytable
# result for usb dongle (mceusb)
Found /sys/class/rc/rc0/ with:
Name: Media Center Ed. eHome Infrared Remote Transceiver (147a:e03e)
Driver: mceusb
Default keymap: rc-rc6-mce
Input device: /dev/input/event6
LIRC device: /dev/lirc0
Attached BPF protocols: Operation not supported
Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm
Enabled kernel protocols: lirc rc-6
bus: 3, vendor/product: 147a:e03e, version: 0x1201
Repeat delay = 500 ms, repeat period = 125 ms
# now the pause, back and OK buttons work and to get info select the item on Kodi and do a long press on OK
# reboot
$ sudo reboot
# to test your remote control or get the correct scancode
$ sudo ir-keytable -t
# UNINSTALL KODI SERVICES
# if for some reason you no longer need the Home Theater service and want to keep the server for the audio system only (in short using it as the MusicLounge server) do the following
# cloning large UEFI image disk (5GB+) from Windows to internal hard drive (or SSD) may cause of corrupt installation # also due to GPT structure, cloning to another disk is not enough, you need to rewrite the GPT backup header/table on the last 33 sectors of your target disk # finally you really need to resize the root partition to get enough space for using the distribution
# here are the instructions to make this from Windows and with GParted Live on Linux side.
SOLUTION 1 Requirements
This way is very easy but requires to remove the hard drive/SSD from the Barebone PC/NUC and a special USB3.0 to SATA adapter cable (ref. USB3S2SAT3CB from StartTech).
Windows PC with Rufus and 7-Zip (or Winrar) Installed 1 USB Drive with Bootable GParted Live
# in case of dependencies error, download and install all pkgs
$ for x in{'kodi-repository-kodi_20.1+dfsg-1_all.deb','kodi-data_20.1+dfsg-1_all.deb','kodi-bin_20.1+dfsg-1_amd64.deb','kodi_20.1+dfsg-1_amd64.deb'}; dowget$x http://ftp.us.debian.org/debian/pool/main/k/kodi/$x; done
# or
# download/install Kodi 20.1 manually (not recommended)
$ for x in{'kodi-repository-kodi_20.1+dfsg-1_all.deb','kodi-data_20.1+dfsg-1_all.deb','kodi-bin_20.1+dfsg-1_arm64.deb','kodi_20.1+dfsg-1_arm64.deb'}; dowget$x http://ftp.us.debian.org/debian/pool/main/k/kodi/$x; done
[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target
[Service]
User = pi
Group = pi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = on-abort
RestartSec = 5
[Install]
WantedBy = multi-user.target
# CTRL + X the Y to SAVE
$ sudo systemctl daemon-reload
$ sudo systemctl enable kodi
$ sudo systemctl start kodi
$ sudo systemctl status kodi
# add kodi smb share points
# insert lines at the end of conf
$ sudonano/etc/samba/smb.conf
[kodi]
path = /home/pi/.kodi
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = pi
[userdata]
path = /home/pi/.kodi/userdata
read only = no
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0755
force user = pi
# CTRL + X the Y to SAVE
$ sudo systemctl restart smbd
$ sudo reboot
# Adding media source to Kodi
# IMPORTANT NOTICE for Windows network SMB share in Kodi 20
# make sure to configure your NAS with shared folders using SMB v2 or v3 and with
# access to everyone (no user/pass)
# setup KODI SMB service with minimum version SMBv2 and maximum SMBv3
# browse the network from a PC and check if you have a full access to shared
# folders without needing to enter your credential
# then in Kodi create your movies, TV shows, etc. source points (i.e. //MYSERVER/Video ) with
# a dummy username and password (like username: srcmedia and paswd: srckodi)
# OPTIONAL: create Video and TV Shows folders if you store the media on the server (not recommended)
$ cd ~/
$ mkdir Video
$ mkdir"TV Shows"
# setup HDMI CEC
# on raspberry PI 4 HDMI CEC is already managed,
# however some keys of remote control must be adjusted like the back and contextual menu key.
# use the Keymap Editor addon (already installed) to make your changes in >global>navigation.
# on amd64 platform
# do not forget to add the Pulse Heigh CEC adapter ( https://www.pulse-eight.com ) to be able to use the TV remote control even with the Intel NUC which have a poor CEC implementation.
you may need to deactivate internal IR Receiver and HDMI CEC in Intel NUC Bios.
# install rc6 mce IR remote control with Kodi 20
# by default Kodi manages the RC6 MCE remote control if your usb dongle is installed or the built in extended IR receiver is set in your bios
# you may need to activate internal IR Receiver in Intel NUC Bios.
# unfortunately some essential buttons of the remote control do not work like BACK (KEY_BACK) and OK (KEY_OK) for example. Read the instructions below to fix it.
# open SSH session
# install ir-keytable
$ sudo apt install ir-keytable
# check if remote control is recognized
$ sudo ir-keytable
# result for usb dongle (mceusb)
Found /sys/class/rc/rc0/ with:
Name: Media Center Ed. eHome Infrared Remote Transceiver (147a:e03e)
Driver: mceusb
Default keymap: rc-rc6-mce
Input device: /dev/input/event6
LIRC device: /dev/lirc0
Attached BPF protocols: Operation not supported
Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm
Enabled kernel protocols: lirc rc-6
bus: 3, vendor/product: 147a:e03e, version: 0x1201
Repeat delay = 500 ms, repeat period = 125 ms
# now the pause, back and OK buttons work and to get info select the item on Kodi and do a long press on OK
# reboot
$ sudo reboot
# to test your remote control or get the correct scancode
$ sudo ir-keytable -t
# Backup / Restore Kodi Data
# backup
$ cd ~/
$ tar cvzf ~/Downloads/"kodi_backup-$(date +'%m-%d-%y').tar.gz"--exclude=.kodi/temp .kodi
# restore
$ cd ~/
$ sudo systemctl stop kodi
$ tar xzvf kodi_backup-xx-xx-xx.tar.gz
$ sudo systemctl start kodi
# UNINSTALL KODI SERVICES
# if for some reason you no longer need the Home Theater service and want to keep the server for the audio system only (in short using it as the MusicLounge server) do the following
$ sudo systemctl stop kodi
$ sudo systemctl disable kodi
# edit /etc/samba/smb.conf to remove or comment SMB Share kodi
$ sudonano/etc/samba/smb.conf
#[kodi]
#path = /home/pi/.kodi
#read only = no
#public = yes
#writable = yes
#browseable = yes
#guest ok = yes
#create mask = 0777
#directory mask = 0755
#force user = pi
#[userdata]
#path = /home/pi/.kodi/userdata
#read only = no
#public = yes
#writable = yes
#browseable = yes
#guest ok = yes
#create mask = 0777
#directory mask = 0755
#force user = pi
# CTRL + X and Y to save
$ sudo reboot
# you can remove kodi user data and configuration files if needed
$ cd ~/
$ sudorm-r .kodi
# Congrats! The audiophile server and the Kodi Home Theater are ready
# setup the Kodi SYSTEM > AUDIO > and choose the correct number of speakers
# activate the passthrough to take benefit of Dolby, DTS, trueHD, etc.
# read this tutorial if you cannot wake up (resume) your Barebone PC with your IR remote control after entering standby mode (suspend)
# do the following to enable wake up on USB port where your IR remote control receiver (USB IR Blaster) is connected
# check the usb port used by your receiver
$ lsusb -t
pi@medialounge:~$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
|__ Port 1: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 1: Dev 6, If 0, Class=Vendor Specific Class, Driver=mceusb, 12M
|__ Port 3: Dev 3, If 0, Class=Audio, Driver=snd-usb-audio, 480M
# mceusb is on Bus 1 Port 1 (1-1)
# to confirm the USB port, get the Product ID of the receiver
$ lsusb
pi@medialounge:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 152a:8750 Thesycon Systemsoftware & Consulting GmbH D90 MQA
Bus 001 Device 009: ID 147a:e03e Formosa Industrial Computing, Inc. Infrared Receiver [IR605A/Q]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# Infrared Receiver Product ID is e03e
# then get the port your receiver is plugged in:
$ grep e03e /sys/bus/usb/devices/*/idProduct
/sys/bus/usb/devices/1-1/idProduct:e03e
# 1-1 confirm the Bus 1 and Port 1
# now check if wake up is enabled for this device
$ cat/sys/bus/usb/devices/1-1/power/wakeup
disabled
# it is disabled, enable wake up on this port
$ sudo sh -c 'echo "enabled" > /sys/bus/usb/devices/1-1/power/wakeup'
# check again
$ cat/sys/bus/usb/devices/1-1/power/wakeup
enabled
# create a systemd entry to make it permanent
# store the script in /usr/local/bin
$ sudonano/usr/local/bin/ir-remote-wakeup.sh
# add the command to enable wakeup
#!/usr/bin/bash
# enable wake up on IR remote control using USB bus 1 port 1
echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
# CTRL+X and Y to SAVE
$ sudochmod +x /usr/local/bin/ir-remote-wakeup.sh
#
# now create a systemd service to make it permanent
# enable wake up ir remote conrol on bus 1 port 1
[Unit]
Description=wakeup ir remote on bus 1 port 1 see ir-remote-wakeup.sh from /usr/local/bin/ for more info
[Service]
ExecStart=/usr/local/bin/ir-remote-wakeup.sh
[Install]
WantedBy=multi-user.target
# enable service
$ sudo systemctl daemon-reload
$ sudo systemctl enable ir-remote-wakeup.service
$ sudo systemctl start ir-remote-wakeup.service
#
# on suspend mode your IR remote control can now wake up the barebone PC
# to allow sleep (suspend) but disallow hibernation
# edit
# disable ASPM in bios may help if your PCIe hardware cannot on wake up from sleep
# check if the PC wake up normaly if this still not working change the ASPM policy
# check it with:
$ cat/sys/module/pcie_aspm/parameters/policy
# should be set to [performance]
[default] performance powersave powersupersave
# if performance is not set add
# pcie_aspm=force pcie_aspm.policy=performance cmds
# to grub GRUB_CMDLINE_LINUX_DEFAULT