mrchrisster/MiSTer_SAM

CLI tools just straight don't work

Closed this issue · 7 comments

Hi there. Loving SAM, it's fantastic. Getting right to it, though; the CLI interface for running instances does not and cannot work as intended.

/media/fat/Scripts# ./MiSTer_SAM_on.sh monitor Attaching MiSTer SAM to current shell.../tmp/gdbcmd.84QL:3: Error in sourced command file: 'open' has unknown return type; cast the call to its declared return type ./MiSTer_SAM_on.sh: line 865: warn: command not found
Monitor just won't work -- can't work, given that it's a) coded wrong, and b) trying to access a command not included with the MiSTer-FPGA Linux distribution.

/media/fat/Scripts# ./MiSTer_SAM_on.sh stop Stopping other running instances of MiSTer_SAM_on.sh... Done! Thanks for playing!

/media/fat/Scripts# ps aux | grep SAM 724 root {MiSTer_SAM_MCP} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_MCP 753 root inotifywait --quiet --monitor --event create --event delete /dev/input/ --outfile /tmp/.SAM_Joy_Change 754 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh 759 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh 762 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1 764 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1 1387 root grep SAM
Stop doesn't work -- it doesn't close things properly. Games continue to cycle and change. Also somehow there's two copies of the monitors running?

/media/fat/Scripts# ./MiSTer_SAM_on.sh start Stopping other running instances of MiSTer_SAM_on.sh... Done! Let Mortal Kombat begin! Starting now on the NEC TurboGrafx-16 / PC Engine: Zero 4 Champ (Japan) Next game in 134...
After stopping SAM using the prior command, then starting, two instances are running, so it changes twice per period, each instance waiting the proper time but not caring that it was already recently changed by SAM.

EDIT: Sorry for newline breakage, apparently Github's "Insert Code" formatting doesn't respect code formatting characters like newline, etc. -- it all shows properly before I hit Send or Update

Thanks, the monitor command not working is a known issue. Trust me, it was working fine a year ago ;) It's fixed in the test branch of Mister SAM. You can try it out by enabling test branch (last line of Mister_SAM.ini)

I noticed stop command not working properly. Happy to look at a PR if you like to improve it?

Update reason: clarity

Roger that. Switching to test branch now.

  • might suggest adding "Known Issues" to the otherwise extremely detailed and helpful front page -- I mean that as a compliment! If there are known issues, that's the only thing I can think of which isn't well-documented there.
  • re: PR; I'll see if I can make sense of it; bash scripting isn't my forte but I do have plenty of time lol

Update; Switched to 'test' branch, rebooted. Monitor command does not work.

`/media/fat# Scripts/MiSTer_SAM_on.sh monitor
Attaching MiSTer SAM to current shell.../tmp/gdbcmd.yz6w:3: Error in sourced command file:
'open' has unknown return type; cast the call to its declared return type
Scripts/MiSTer_SAM_on.sh: line 865: warn: command not found

/media/fat# ps aux | grep SAM

722 root {MiSTer_SAM_MCP} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_MCP

751 root inotifywait --quiet --monitor --event create --event delete /dev/input/ --outfile /tmp/.SAM_Joy_Change

752 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh

757 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh

760 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1

762 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1

1009 root {MiSTer_SAM_on.s} /bin/bash /media/fat/Scripts/MiSTer_SAM_on.sh start

1114 root grep SAM`

That suggests you're not on the test branch. Did you update after enabling it in the ini?

I asked it to, but I didn't delete stuff then re-run it from scratch.

PR #105 covers all concerns

Great thanks, I'll take a look tomorrow.

This is fixed in the most recent release