Author Topic: Request: quiet (no prints) mode  (Read 13573 times)

a_netanel

  • Newbie
  • *
  • Posts: 4
    • View Profile
Request: quiet (no prints) mode
« on: April 25, 2017, 02:02:17 PM »
I'm trying to minimize the amount of output to the console, that can be seen in the second before the game is launched.
I tried to redirect stdout to /dev/null, but this way the runcommand menu does not clear, even if i send a clear command in runcommand-onstart.sh etc.

I looked in the cpp code and saw there are only 94 lines that output to stdout (greped "cout").
I believe it could be quite easy (to someone who remembers how to program cpp, that is) to add a flag that quiets these couts.

Many thanks!

a_netanel

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #1 on: April 25, 2017, 02:29:51 PM »
Just for sake of completion, for now I manage to quiet the output by an ugly hack:
1. change the autostart script to:
Code: [Select]
stty -echo
clear
attract 2>1 |grep -o $'\033c'

2. create runcommand-onstart and runcommand-onend scripts that contain:
Code: [Select]
printf "\033c"

a_netanel

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #2 on: April 25, 2017, 03:37:33 PM »
Tweaked it a bit to hide cursor as well.
autostart.sh:
Code: [Select]
setterm -cursor off
stty -echo
clear
attract 2>&1 | grep -o $'\033\[2J'

runcommand-onstart.sh & runcommand.onend.sh:
Code: [Select]
printf "\033[H\033[2J"
Sorry about the spam, but I think this should be documented :)
« Last Edit: May 04, 2017, 09:57:56 AM by a_netanel »

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #3 on: April 26, 2017, 11:12:47 PM »
It's not spam and it should be documented. Great info.

d4NY0

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #4 on: May 14, 2017, 06:29:00 AM »
Excellent tweak. Thank you.

But I got one problem. I start a game and push a button to configure emulator options. When I choose the "Launch" option, the blue runcommand background stays visible on both sides of my widescreen display while playing Dreamcast.

Any idea?

Edit: This happens only using Reicast (Dreamcast).
« Last Edit: May 16, 2017, 02:15:11 AM by d4NY0 »

tekn0

  • Full Member
  • ***
  • Posts: 52
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #5 on: July 06, 2017, 09:19:37 AM »
Thank you so much for this workaround. It is working great here.

Launch screen is now all clean. Also the GetErrorx500 thing is now gone as well! :)

slowsl

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #6 on: September 25, 2017, 11:26:55 AM »
Is there a dummy's guide to getting this accomplished on a retropie?  I'm not quite sure I follow on what to do.
Thanks!

flexfulton

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #7 on: October 12, 2017, 07:55:29 AM »
This is great to remove the visually unappealing flash of the glGetError.  The only issue with this is that if you use the Retropie Setup Script that will flash on the screen now before and after the launching.png.

A simple reboot with get rid of it though.  So for now it's the best best for a completely clean system.

flexfulton

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #8 on: October 12, 2017, 08:02:50 AM »
Is there a dummy's guide to getting this accomplished on a retropie?  I'm not quite sure I follow on what to do.
Thanks!

You need to replace what is in the autostart.sh script found in /opt/retropie/configs/all with

setterm -cursor off
stty -echo
clear
attract 2>&1 | grep -o $'\033\[2J'

You can just make sure that a # is in front of all the existing lines in you would rather save it in case you need to revert back.

Thank you need to make two text files one called runcommand-onstart and one called runcommand-onend.  They both need to contain printf "\033[H\033[2J"
Once you created them, rename them to add the .sh to the end and then upload them into the /opt/retropie/configs/all folder.

This can all be done via WinSCP but you can also do it via command line if you want.  Th

Please note that if you use the Retropie Setup Script at any time that will flash up before the game loads.  This can be cleaned up by rebooting the system.

Also note that all terminal text that you wish to input to the system via USB keyboard will no longer show up either.  It will accept the text you just won't be able to see it.  You can however SSH into the system to do all your work if required.

Good luck!

mojoatomic

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #9 on: October 13, 2017, 05:36:42 PM »
The [H inside of    printf "\033[H\033[2J"   gave me an issue.  Once that's removed, this is a great solution and I can confirm it works great.


https://youtu.be/iIsJCYU7_4I

flexfulton

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #10 on: October 18, 2017, 10:47:01 AM »
What was the issue you were having?

mortron

  • Full Member
  • ***
  • Posts: 27
    • View Profile
Re: Request: quiet (no prints) mode
« Reply #11 on: June 26, 2018, 07:16:15 AM »
I am sorry to bring this back up.

The creating of new scripts is new to me, and while I can half figure this process out, I am a bit lost. Is there a tutorial or something a little more idiot proof to achieve this? Or does anyone mind helping me along the way with answers etc? I didn't feel this warranted a new thread, as I am sure some others will want to accomplish this as well at some point. Thanks