Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: One-button power on/off with IPAC2?  (Read 8451 times)

0 Members and 1 Guest are viewing this topic.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
One-button power on/off with IPAC2?
« on: August 26, 2013, 11:07:29 am »
Built a cabinet with a single red button on the side intended to power it on and off. It's wired to an IPAC2.

Works fine if I assign this button to "sleep/wake" (apart from leaving the button lights on through my pac-drive). But, I'd rather have it actually power down. When I assign this button to "power" through the IPAC2's software, I'm able to power down OK. But, pressing it won't cause it to power up - even though it seems the USB bus still has power. I set my BIOS to allow power-up from a USB keyboard, but somehow the BIOS knows the IPAC2 isn't a "real" keyboard - it will only power up when I plug in a real USB keyboard and hit a key.

Anyone else run into this and have a solution? I'm using Mala as a front-end if that's relevant. Bonus points if anyone has a way to turn off my Pac-Drive / LED Blinky powered button lights on sleep or power down as well. I know I can configure Mala to cleanly shut everything down when it gets a certain keystroke, but the problem is getting that same keystroke to power the system back up since it's one button.




MastarArcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:May 20, 2014, 02:42:08 pm
Re: One-button power on/off with IPAC2?
« Reply #1 on: August 26, 2013, 11:13:25 am »
Hi Fkane,

I too am using an IPAC, and haven't yet done this on my system, but I was thinking about it. One thing that I noticed on my motherboard is that even if I set the system to power on via Key Press (albeit USB or PS2), there are jumpers on my motherboard (ABIT IC7-G), which need to be toggled in order for this function to work in addition to making the changes in BIOS. This might not be your issue, but it may be something to look in to.


fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #2 on: August 26, 2013, 11:19:58 am »
It works fine with a real USB keyboard, so I suspect it's not a jumper issue.

I suppose I could just cut my computer's wires to its own power button and wire them instead to my big red button. Would that work - is there anything special about a computer power button?

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #3 on: August 26, 2013, 11:50:59 am »
Argh. When powering off using the case's power button, Mala prevents Windows from shutting down. Seems it is not responding to the close command Windows 7 is giving it. So, wiring my button to the case's power button wouldn't do the job either.

I think I need to have my power button tell Mala to shut itself down and then shutdown the computer - that should be possible if I leave it connected to the IPAC and tell Mala about whatever key it emulates. But, the trick is getting that same button to power the system back up. In principle that would work if the "wake on USB keyboard" BIOS function worked with the IPAC, but it doesn't on my system.

Does power on via USB keyboard press work for anyone with an IPAC, or is it something weird about my system?
« Last Edit: August 26, 2013, 11:53:36 am by fkane »

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: One-button power on/off with IPAC2?
« Reply #4 on: August 26, 2013, 12:00:44 pm »
cant you exit mala with P1 start + p2 start then shut down windows? Optionally, cant you set MaLa to shutdown windows on exit?
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #5 on: August 26, 2013, 12:06:52 pm »
Well, yes, but this is a dedicated cabinet with no keyboard or easy access to the computer inside. I want one button to shut down Mala and Windows (that much I can manage,) but then that same button needs to power the system back on.

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: One-button power on/off with IPAC2?
« Reply #6 on: August 26, 2013, 12:33:33 pm »
exit mala with P1 +p2 start, then wire an arcade button into the PC to shut it down.
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #7 on: August 26, 2013, 12:39:23 pm »
Thanks. That would work, but my concern is that it's too complicated for my kids, wife, and visitors to figure out. Anything more complicated than a single power button won't fly for anyone but me. It must be possible!

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 02, 2025, 09:03:11 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: One-button power on/off with IPAC2?
« Reply #8 on: August 26, 2013, 12:42:52 pm »
welp, with the way I posted you can shut down the PC when mala exits, then use the power button to turn it back on. My PC has problem killing MaLa when I hit the power button.  If you figure it out, be sure to post, Im curious!
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

MastarArcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:May 20, 2014, 02:42:08 pm
Re: One-button power on/off with IPAC2?
« Reply #9 on: August 26, 2013, 01:12:16 pm »
It works fine with a real USB keyboard, so I suspect it's not a jumper issue.

I suppose I could just cut my computer's wires to its own power button and wire them instead to my big red button. Would that work - is there anything special about a computer power button?

Ahh, sorry, I missed that in your original post.

Does your IPAC work when your in your system BIOS (e.g. if you map your joy stick to the up/down arrows, can you navigate your BIOS setup menus?). This might be an indicator that the USB IPAC isn't recognized by your BIOS (it may only be working once your booted up in to the OS). If it does work however, then I agree, one would think that the "keyboard power on" function should work, but there still might be some "under the covers" protocol issues that aren't taking place with the IPAC. Its possible that you might have more success if you try the PS2 (Legacy) connection to/from the IPAC to your PC....might be worth a try.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: One-button power on/off with IPAC2?
« Reply #10 on: August 26, 2013, 01:17:06 pm »
You might check empardopo's allinone

http://forum.arcadecontrols.com/index.php/topic,113882.msg1209264.html#msg1209264

I believe it corrects the mala prevents shutdown issue.

Ideally, you'd just wire the button to the poweron of thepc and config windows to do a soft power down when it's pressed again. Sounds like you basically had it that way but Mala was getting in the way, which, I believe is a known issue.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #11 on: August 26, 2013, 01:29:43 pm »
Good idea on trying the PS/2 interface. I'll order a cable and try that out.

If that doesn't work, I'll mess around with AllInOne and/or AutoHotKey to see if I can intercept the shutdown and force Mala to close. Thanks for the link - hadn't run across AllInOne before.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: One-button power on/off with IPAC2?
« Reply #12 on: August 26, 2013, 02:11:43 pm »
Wire it to the power pins on your motherboard, not the ipac.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #13 on: August 26, 2013, 02:20:10 pm »
The only appeal of going through the IPAC is that I could tell Mala to shut itself down cleanly, instead of resorting to some other process forcing it to close upon shutdown. I could envision a kid hitting the power key at just the wrong time leading to a corrupt file or something. If only Mala handled shutdown properly, this would be so simple - I would just wire the button the the motherboard's power switch and be done with it.

Thinking about it some more, I wonder if my BIOS wasn't recognizing my power button as a keyboard press because I mapped it to "power" in the IPAC instead of a "normal" key. I think I'll try mapping it to some normal keystroke that Mala recognizes as an exit and shutdown command, and see if that works. I'll follow up.


fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #14 on: August 26, 2013, 02:35:35 pm »
No luck there. Back to the IPAC PS/2 interface idea (plan A) and motherboard power switch / other process to kill Mala at shutdown idea (plan B.)

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #15 on: August 27, 2013, 04:58:59 pm »
One bit of progress - I came across the attached plug-in that will safely shut down Mala when Windows 7 shuts down. Hooray! I don't know who to thank for writing it, but thanks whoever you are. So, you'd think at this point I could wire my power button to the motherboard's power switch and be done with it.

Now for the sad part - even when powered down, my computer is still giving power to the USB bus, and Mala is not issuing exit commands when shutting down using this plugin. That means I can't have Mala tell LED Blinky to shut all the lights off at shutdown, and I don't see any BIOS options for cutting power to the USB bus when it's off either. So, my "powered off" cabinet still has lights illuminated on it in whatever state they were in at shutdown.

I can't believe how hard such a simple thing is! But for people who don't have such odd BIOS's, perhaps this is useful.


keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: One-button power on/off with IPAC2?
« Reply #16 on: August 27, 2013, 05:24:35 pm »
The only appeal of going through the IPAC is that I could tell Mala to shut itself down cleanly, instead of resorting to some other process forcing it to close upon shutdown. I could envision a kid hitting the power key at just the wrong time leading to a corrupt file or something. If only Mala handled shutdown properly, this would be so simple - I would just wire the button the the motherboard's power switch and be done with it.

Thinking about it some more, I wonder if my BIOS wasn't recognizing my power button as a keyboard press because I mapped it to "power" in the IPAC instead of a "normal" key. I think I'll try mapping it to some normal keystroke that Mala recognizes as an exit and shutdown command, and see if that works. I'll follow up.

You could do what you are wanting using autohotkey or similar automation scripting engine with button attached to power pins on motherboard. Using a button connected to an ipac, I doubt there is any way you can get it to start up the system.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #17 on: August 27, 2013, 05:30:32 pm »
You're right - I contacted Ultimarc and an IPAC cannot start up a powered down system.

I do think AHK is my only hope for shutting off the lights. I was trying to hack the "graceful exit" plugin to call ledblinky.exe 2 before closing Mala, but that didn't work.

fkane

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:October 15, 2014, 10:44:36 am
  • I want to build my own arcade controls!
Re: One-button power on/off with IPAC2?
« Reply #18 on: August 28, 2013, 01:57:12 pm »
Just for posterity, here's what I ended up with. To recap, the problem is that my computer has a "feature" - an increasingly popular one - that power keeps going to the USB bus even when power is off, so you can charge your iDevices at all times.  And with my BIOS, there seems to be no way of disabling it. This means my Pac-Drive-powered LED lights stay on even when the system is off, which is just silly - and my family nags me about leaving the cabinet on all the time and wasting power, even though it is in fact sleeping or shut down.

Shutting off the LED's at shutdown proved to be a delicate operation; it must be timed perfectly with other things going on at shutdown it seems. Plus, Windows' + Mala's startup time is enough to annoy a user who expects to push the power button and quickly start playing. So, I just gave up on having my cabinet's power button actually power down the system and lights. Given that power would still be flowing to my IPAC and Pac-Drive anyhow, there seemed to be little to gain from shutting down vs. sleeping. I put a piece of tape over the blinking light on the case when it sleeps, and kept my power button wired to the IPAC and mapped to sleep/wake. I also set up Windows to automatically sleep after an hour of idle time.

Now, the problem was getting my Pac-Drive lights to shut off when sleeping, and to start back up on waking. Initially I set up an AutoHotKey script to run "ledblinky.exe 2" upon sleep, and "ledblinky.exe 1" upon wake, but this ended up confusing the Mala plugin since this causes the ledblinky process to get a new process ID.

So, I set up a new screensaver animation with LED Blinky's animation editor that just does nothing, and assigned that to be LED Blinky's front end screensaver. When AutoHotKey gets notified that Windows is about to sleep, I tell ledblinky to start its screensaver - which turns off the LED's. When it wakes back up, I end the screensaver, putting ledblinky back to its previous state for Mala.

It is a sick hack, but so far it seems to work. Here's my AutoHotKey script if anyone else finds it useful (obviously substitute your own path to ledblinky - and set up that do-nothing screensaver animation first.) I compiled this script to an exe and put it in my Startup folder.

OnMessage(0x218, "func_WM_POWERBROADCAST")

Return

func_WM_POWERBROADCAST(wParam, lParam)
{   
   If (lParam = 0) {
      ; PBT_APMSUSPEND or PBT_APMSTANDBY? -> System will sleep
      If (wParam = 4 OR wParam = 5) {
         RunWait, c:\arcade\mala174\mala174\plugins\ledblinky\ledblinky.exe 5
      }
      
      ; PBT_APMRESUMESUSPEND oder PBT_APMRESUMESTANDBY? -> System wakes up
      If (wParam = 7 OR wParam = 8) {
         RunWait, c:\arcade\mala174\mala174\plugins\ledblinky\ledblinky.exe 6
      }
   }
   Return
}

« Last Edit: August 28, 2013, 02:10:41 pm by fkane »

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: One-button power on/off with IPAC2?
« Reply #19 on: August 29, 2013, 01:06:14 pm »
another option would be to have the PC on a smart power strip, and your pac-drive plugged into a powered usb hub, which is plugged into one of the slave ports on the smart power strip..when the pc shuts off, the power strip kills power to the other outlets and therefore shuts off the usb hub.
Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
  • Last login:January 26, 2025, 08:51:53 am
  • Robots WILL kill you.
    • LEDBlinky
Re: One-button power on/off with IPAC2?
« Reply #20 on: September 02, 2013, 02:12:16 pm »
Now, the problem was getting my Pac-Drive lights to shut off when sleeping, and to start back up on waking. Initially I set up an AutoHotKey script to run "ledblinky.exe 2" upon sleep, and "ledblinky.exe 1" upon wake, but this ended up confusing the Mala plugin since this causes the ledblinky process to get a new process ID.

So, I set up a new screensaver animation with LED Blinky's animation editor that just does nothing, and assigned that to be LED Blinky's front end screensaver. When AutoHotKey gets notified that Windows is about to sleep, I tell ledblinky to start its screensaver - which turns off the LED's. When it wakes back up, I end the screensaver, putting ledblinky back to its previous state for Mala.

Very impressive solution!  :cheers:
Robots will kill you.



Arcade Addiction