On a fresh RetroPie image using a wired Nintendo Switch controller, my button assignments do not match up to yours.
My device name is:
deviceName="BDA NSW wired controller"
So I'm curious how you determined those hex values.
The joy2key program is hard programed.
/dev/input/jsX means it is applied to all Linux joystick.
The hex escape codes are ansi keyboard codes for keypresses that overlay buttons in the order of 'left', 'right', 'up', 'down', 'a', 'b', 'x', 'y'
0x3C 0x3E 0x2B 0x2D 0x70 0x71 0x69 0x6F
I would suspect your buttons are backwards (Japanese style) so I would move the value around like this.
As discussed with reddit user u/ben_theredonit, the pi4 fails to utilize the emulationstation.sh at the time of posting when shutting down. So editing emulationstation.sh, will not work to play a video before shut down. I solved the problem through a roundabout solution. I found a shutdown button that can be added via the carousel, developed by Steve Smith. Below is his video and in his YouTube description, his files:
The user Lampros in the youtube comments has a guide to install, if you find yourself getting the permission denied error, as many people in the comments have, I fixed mine by simply typing "sudo" in front of the "chmod +x" command
From there, I simply changed the 'rom' shutdown script adding the "sudo omxplayer RetroPie/roms/shutdown/shutdown.mp4" code and it worked.
Big thanks to reddit user u/ben_theredonit, who offered their help.
I hope this helps anyone that was lost as I was when trying to add a shutdown video.
Closing the thread on this. There is nothing wrong with the randomizer. While there was exactly one (1) "Little Computer People" video, there were ~100 variations of the game in the XML referencing the same video. So it's probably by design. It would seem that each game listed in XML with a valid video has the potential to play. Like throwing 100 tickets into a casino raffle drum... You're more likely to win.
Ideally each video found should act as 1 potential. Not a big problem, but since games with multiple variants that reference the same video are more likely to play, making things seem less random than they truly are.
Mystery solved after spending way too much time staring at random videos.
An easy way to replace the artwork location in the gamelist.xml with another / new one is the sed command (stream editor). This example changes the video directory from the relative path ./media/videos/ to the absolute path /mnt/artwork/videos/:
cp gamelist.xml gamelist.xml.backup # make a backup in case something goes wrong
sed -i 's#<video>./media/#<video>/mnt/artwork/#g' gamelist.xml
The part in single quotes does the actual sed-magic:
s(earch)#[old string]#[new string]#g(lobally, i.e. all occurences)
This works for every other path, just change <video> to <image>, <marquee> etc. Omitting the artwork tag before the path will change any occurence in the file, e.g. if the whole artwork is located in another place.
Execute man sed in the command line to get the manpage (manual page) of this tool, or search the web for myriads of examples.
@shavecat You could use my script to resize all videos automatically. You'd just have to teach yourself the necessary ffmpeg options to change the resolution instead of (or in addition to) the colour encoding and add them to the ffmpeg line in my script.
@bfollowell What video player option are you using in Emulationstation ? omxplayer, the HW accelerated option, has issues with some videos. If you switch off the hw accelerated video, do the videos play ok ?
I really didn't setup a player. I just put the media files in the individual ROMs folders, along with my gamelist.xml file, and the videos showed up and started playing. So, whatever player RetroPie uses by default, and however it is setup.
Actually, before I submitted this, I decided to go and check. I found OMX Player (HW Accelerated) listed under the Main Menu under Other Settings. This was off. I turned it on, and the videos for TG16 start much faster now. There is still a slight delay, but only about a second. I still have no idea why it's only this one system that exhibits this behavior, but I'm happy with it now.