Aloshi / EmulationStation

A flexible emulator front-end supporting keyboardless navigation and custom system themes.
MIT License
2.07k stars 904 forks source link

Hide console output when opening/closing emulators #236

Open djcross opened 10 years ago

djcross commented 10 years ago

I've recently started tinkering with emulationstation, and presently one of my little annoyances is that the console text is being displayed when an emulator is being started and stopped.

Is there any way to disable this?

joeelliott commented 10 years ago

There is currently no way to make the console text silent, which is outside of emulationstation and not something that can be hidden, which is actually a complaint in many other linux projects not even related to emulation or the rpi.

It may be possible for Aloshi to make emulationstation run a loading screen (I would love this, as a theme designer :+1: ) until the game actually boots. I have no real concept of how labor intensive a feature like that may be though, or if its even possible for emulationstation to know the game loaded in order to exit the loading screen and go into an idle mode.

nilsbyte commented 10 years ago

I agree, @joeelliott - but only from a designers point of view. It's a mix of a Linux related question and ES. Also the console output before and after running an emulator gives vital information of the things that are going on. If there will be a feature like this, it surely has to be switchable on or off.

bowenwr commented 10 years ago

I agree it would be "nice to have" (and togglable) for my specific use case of having a dedicated PC only for EmulationStation games, allowing me to hide the PC aspects from view.

nilsbyte commented 10 years ago

@Aloshi and @petrockblog have to evaluate if this is possible with RetroPie.

djcross commented 10 years ago

I managed to make this better, but not perfect by prefixing clear && to the beginning of all of the run commands in the tags inside es_systems.cfg

GM-Script-Writer-62850 commented 9 years ago

i think you can dump the output to /dev/null by adding this to the emulator's command > /dev/null 2>&1

<command>retroarch -L /usr/lib/libretro/stella_libretro.so --appendconfig ~/.config/retroarch/retroarch.atari.cfg %ROM%</command>
becomes
<command>retroarch -L /usr/lib/libretro/stella_libretro.so --appendconfig ~/.config/retroarch/retroarch.atari.cfg %ROM% > /dev/null 2>&1</command>

if you want to nullify all text emulationstaion > /dev/null 2>&1

djcross commented 9 years ago

Ahhh, also a good idea. I'll try this tonight.

ghost commented 9 years ago

Is it possible to implement this in Windows as well?

GM-Script-Writer-62850 commented 9 years ago

in your bat script start it with @echo off that might do it, you could just run es using a shortcut icon or startup entry

Aloshi commented 9 years ago

FYI, the latest build in the unstable branch completely hides the console on Windows unless ES is run with --debug.

ghost commented 9 years ago

Fantastic! Will check it out! Thanks for this great software. I will donate some money to it when i can if you have a paypal or similar.

space-invader commented 9 years ago

I'd like to know where which is the file that starts emulationstation when booting a RetroPie image.

I want it in order to try the "emulationstaion > /dev/null 2>&1" order.

PD. I'm sorry for my bad English!

GM-Script-Writer-62850 commented 9 years ago

IIRC it is the last line of /etc/profile

space-invader commented 9 years ago

Hi, I tried it, but the "last log in..." message and the messages when starting and exiting an emulator continues. What can I do to nullify them?

GM-Script-Writer-62850 commented 9 years ago

have it run clear;emulationstaion > /dev/null 2>&1

space-invader commented 9 years ago

Ok, this works for muting the messages when starting and exiting the emulators, but not for the message "last log in...", I think this is a kernel message, so silenting ES will not silent this, correct?

GM-Script-Writer-62850 commented 9 years ago

clear should have got that off the screen

space-invader commented 9 years ago

In my case not :(

Now I have finished with it, tomorrow I will post the complete líne I have...

Thanks.

GM-Script-Writer-62850 commented 9 years ago

no problem, you can just post your last few lines and i can edit them, there must be something i am forgetting

space-invader commented 9 years ago

Ok!

space-invader commented 9 years ago

Hi again!

The last líne of my "/etc/profile" file is this:

[ -n "${SSH_CONNECTION}" ] || clear;emulationstation > /dev/nulo 2>&1

(all in a unique líne)

space-invader commented 9 years ago

nulo NOT, null

Muy spanish corrector works more than I'd like ;)

GM-Script-Writer-62850 commented 9 years ago

try this if [ -z "${SSH_CONNECTION}" ];then clear;emulationstation > /dev/null 2>&1;fi

that can also be is a readable fashion written like this, but i assumed you wanted it in a single line

if [ -z "${SSH_CONNECTION}" ];then
   clear
   emulationstation > /dev/null 2>&1
fi

this will make debugging a PITA since you can't see what the error message is, you know cause you dumped everything into null, but it will give you a black loading screen *this is beyond es support, this is basic shell scripting, this really belongs on the retropi forms, just saying

you may want to use the --no-exit option on es emulationstation --no-exit > /dev/null 2>&1 this will prevent the user from exiting es and requiring a keyboard be connected

space-invader commented 9 years ago

No way.

The message continúes there :(

space-invader commented 9 years ago

In fact, the message appears and then the screen is cleaned, but the message can be seen.

I'd need a method to forcé the message not to be shown (if it is possible)

space-invader commented 9 years ago

I have realised that the problem is not on this script. I suppose it is a kernel message, but I have no idea on how to deactivate it.

GM-Script-Writer-62850 commented 9 years ago

most likely it is output from dmesg just googled something try this

if [ -z "${SSH_CONNECTION}" ];then
   echo "6" | sudo tee /proc/sys/kernel/printk
   clear
   emulationstation > /dev/null 2>&1
fi
FrankSerpico commented 9 years ago

Up!

Im using the lastest release of ES for Windows (2.0.1a.), and cmd window keeps popping up when I run an emulator and when they close . Is this was not fixed in the latest version ? I run Retroarch for all emulators. What am I doing wrong? Thank you for your attention

stephenohair commented 9 years ago

I use a keyboard even with the /dev/null 2>&1 trick I still see keypresses. I fixed this by adding stty -echo before calling emulationstation and then enabling it again with stty echo after exiting. I made the change in my /etc/profile.

Edit the last line of the /etc/profile to look like:

[ -n "${SSH_CONNECTION}" ] || `clear;stty -echo;emulationstation > /dev/null 2>&1;stty echo`
0x646e78 commented 9 years ago

@SuperEvenSteven - worked a treat thanks!

LeftoverNoodles commented 8 years ago

@Aloshi Did this enhancement make it into 2.0.1a?

Jeromyal commented 8 years ago

For windows I created the following batch file

@echo off if "%1" == "" start "" /min "%~dpnx0" MY_FLAG && exit taskkill /f /im explorer.exe set HOME=%~dp0 emulationstation.exe start explorer.exe exit

I then used a program called portable bat to exe converter to create a new ES portable launcher app

Killing the explorer makes a nice black screen and the cmd window hides itself. Then when you quit ES, the explorer restarts. Note: Be sure to not be doing explorer processes when launching this such as coping or moving files.

I have not found a way to hide that brief flash of a cmd window that transitions between the ES browser and retroarch launching a core instance.

mahtar commented 8 years ago

@Jeromyal thanks for the Windows tip.

Bat to Exe converted file was triggering my antivirus so I decided to use shortcut to bat file and set it to minimize, works great on Win10.

Also I wanted to minimize all the other windows before ES starts so I created a shortcut to toggle desktop inside ES folder and run it before killing explorer in the bat. Unfortunately it won't toggle the windows back as it probably forgets the states when explorer is killed (so I don't call it again in bat).

To create ShowDesktop.lnk file, create a new shortcut with target: explorer.exe shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}

Bat file then looks like this:

@echo off
if "%1" == "" start "" /min "%~dpnx0" MY_FLAG && exit
ShowDesktop.lnk
taskkill /f /im explorer.exe
set HOME=%~dp0
emulationstation.exe
start explorer.exe
exit

I then created shortcut to the bat file, set the icon to ES and to run minimized and the overall experience is much better.

Someone may write a custom portable launcher that does it all or maybe I will do it if I find some time.

That brief flash of cmd window would have to be sorted within ES as it is being called every time an emulator is started. I tried adding start /min [emulator command] in es_systems.cfg between <command> tags but then ES window is minimized when coming back from emulator (plus without explorer running, the minimized cmd window is visible anyway). It would be worth checking if ES code can be changed so the cmd window is not visible.

Jakobud commented 6 years ago

The worst thing about this Loading text screen is that there is an option to "Press A button to configure". It sucks to let your kids play a RetroPie because they end up trying to play a game, press a button at the wrong time and end up in some weird configuration menu where they end up lost or worse, screwing up settings.

dankcushions commented 6 years ago

@Jakobud https://retropie.org.uk/docs/Runcommand/#configuring-runcommand

QcGix commented 5 years ago

This is an old issue but it seems to be still relevant on Windows. I've tried the batch file to kill explorer but there is still a flash of the cmd prompt before the emulator start. I've used other emulator like LaunchBox BigBox where they add a full screen loading screen so these cmd prompt are hidden. Would it be possible to do that in Emulation Station? This is the only thing remaining that bugs me about Emulation Station. I'm trying other front end because of that but none is has snappy as Emulation Station.

psakhis commented 4 years ago

Workaround it's set cmd console windowPos out off range desktop. Works perfect. I load reg file before start emulastation and i restore it at exit.

QcGix commented 4 years ago

That sounds like a good idea. I'll try that tonight, would you mind sharing your reg file? We'll just have to adjust the value. Thanks!

psakhis commented 4 years ago

It's easy. I recommend you open [HKEY_CURRENT_USER\Console] and save as cmd_show.reg Change WindowSize and WindowsPosition and save as cmd_hide.reg or edit properties in a opened cmd until you don't see cmd window and save as cmd_hide.reg. My start.cmd as is _regedit /s cmd_hide.reg c:\users\arcade\emulationstation\emulationstation.exe --resolution 450 270 regedit /s cmdshow.reg

cmd_hide.txt cmd_show.txt

(*) I notice switchres retroarch needs explorer.exe, i only can do is hide taskbar at windows starts.. i don't find any other workaround for this.

QcGix commented 4 years ago

I've just tested this and it work perfectly for my needs! Thanks alot!

psakhis commented 4 years ago

I'm glad for you. I didn't like seeing windows components on my arcade cabinet xD, buuuut W7x64 gives me all the funcionality and performance.

Tasosgemah commented 4 years ago

Someone mentioned that newer builds hide the command window, i downloaded the latest exe with 20-March-20 date but the CMD still appears. Do i have to toggle/edit something?

psakhis commented 4 years ago

I'm using latest development version and i don't find any argument or option for hide command window launching roms (not emulastation properly). How the workaround works i have not spent more time with it.

Lakeyzer commented 4 months ago

[ -n "${SSH_CONNECTION}" ] || clear;stty -echo;emulationstation > /dev/null 2>&1;stty echo

Years later and I still had this issue on my RetroPie. Just got some Sinden Light Guns and they sometimes generate input for the command line. This comment is what finally lead me to fully fixing it.

I updated my /opt/retropie/configs/all/autostart.sh to the following.

clear;stty -echo;emulationstation --no-splash > /dev/null 2>&1;stty echo