Author Topic: Help me get started  (Read 3014 times)

walknight

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Help me get started
« on: July 25, 2020, 08:56:47 PM »
I managed to build attract mode on a RK3328 linux box.
I copied everything inside the "config" folder in the source archive to /tmp/config/ , then ran

./attract -c /tmp/config

And I got this message and the program exits:

Code: [Select]
Warning: Attract-Mode was compiled to look for its default configuration files in: /usr/local/share/attract/, which is not available.
Config file not found: /tmp/config/attract.cfg
 - Constructed 1 filters in 0 ms (1 comparisons)
Error, could not find default font.

Can someone send me a default attract.cfg to get me started?

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Help me get started
« Reply #1 on: July 25, 2020, 10:14:32 PM »
attract.cfg
Code: [Select]
# Generated by Attract-Mode v2.6.1
#
sound
sound_volume         100
ambient_volume       100
movie_volume         100

input_map
configure            Tab
prev_letter          LControl+Up
next_letter          LControl+Down
filters_menu         LControl+Left
next_filter          LControl+Right
configure            Escape+Up
edit_game            Escape+Down
add_favourite        Escape+LControl
prev_letter          Joy0 Up+Joy0 Button0
next_letter          Joy0 Down+Joy0 Button0
filters_menu         Joy0 Left+Joy0 Button0
next_filter          Joy0 Right+Joy0 Button0
configure            Joy0 Up+Joy0 Button1
edit_game            Joy0 Down+Joy0 Button1
add_favourite        Joy0 Button0+Joy0 Button1
back                 Escape
back                 Joy0 Button1
up                   Up
up                   Joy0 Up
down                 Down
down                 Joy0 Down
left                 Left
left                 Joy0 Left
right                Right
right                Joy0 Right
select               Return
select               LControl
select               Joy0 Button0
default             back exit
default             up prev_game
default             down next_game
default             left prev_display
default             right next_display

general
language             en
exit_command         
exit_message         
default_font         FreeSans
font_path            /usr/share/fonts/;$HOME/.fonts/
screen_saver_timeout 600
displays_menu_exit   yes
hide_brackets        no
startup_mode         default
confirm_favourites   yes
confirm_exit         yes
mouse_threshold      10
joystick_threshold   75
window_mode          default
filter_wrap_mode     default
track_usage          yes
multiple_monitors    no
smooth_images        yes
selection_max_step   128
selection_speed_ms   40
move_mouse_on_launch yes
scrape_snaps         yes
scrape_marquees      yes
scrape_flyers        yes
scrape_wheels        yes
scrape_fanart        no
scrape_videos        no
scrape_overview      yes
thegamesdb_key       
hide_console         no
video_decoder       
menu_prompt          Displays Menu
menu_layout         


« Last Edit: July 25, 2020, 10:20:09 PM by progets »

walknight

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Help me get started
« Reply #2 on: July 26, 2020, 12:21:09 AM »
Thanks! Turns out it exited as it couldn't even find a font. I changed the font search path and put in a .ttf file there, after that I was able to get to the config screen.

Now another problem: When I go to Add Emulator, I cannot type anything. It just shows a blinking cursor but anything I type does not register.
But I could use TAB/ESC/Enter and arrow keys. And when I configure the "Custom 1" through "Custom 6" keys, it actually detects any key I press just fine. So only in the "Add Emulator" screen it cannot take my input.
Has anyone seen this issue before?

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Help me get started
« Reply #3 on: July 26, 2020, 01:29:55 AM »
The Rockchip isn't something that is popular around here. That doesn't mean you can't get it to work. I have played with older Rockchip boards but always had to tweak things to make it work and even then they were just "workarounds".

First I would ask, are you using a normal wired keyboard?

Second I would say, you can manually modify the attract.cfg (it's just a text file) "input map" fields to see if that helps.

Third, you can manually create emulator files, but this shouldn't be needed.

Example of my Windows "Nintendo Entertainment System.cfg" emulator file stored in /attract/emulators/
Code: [Select]
# Generated by Attract-Mode v2.6.1
#
executable           \Emulators\RetroArch\retroarch.exe
args                 -f -L cores\fceumm_libretro.dll "[romfilename]"
rompath              \Roms\Nintendo Entertainment System
romext               .nes
system               Nintendo Entertainment System (NES)
info_source          thegamesdb.net
artwork    boxart          \EmuMovies\Nintendo_NES\Box_3D;\EmuMovies\Nintendo_NES\Box
artwork    boxbackart      \EmuMovies\Nintendo_NES\BoxBack
artwork    cartart         \EmuMovies\Nintendo_NES\Cart
artwork    fanart          \EmuMovies\Nintendo_NES\Background
artwork    marquee         \EmuMovies\Nintendo_NES\Banner
artwork    snap            \EmuMovies\Nintendo_NES\Video_MP4_HI_QUAL;\EmuMovies\Nintendo_NES\Snap
artwork    title           \EmuMovies\Nintendo_NES\Title
artwork    wheel           \EmuMovies\Nintendo_NES\Logos


Your first error showed that AM wanted to run from /usr/local/share/attract/. I'm not saying this is your problem but it might be worth taking a look/test.

I do recall keyboard issues a few years ago but not recently. You're using a current/modern version of AM, right?

If you need help with an emulator config file just as a point of testing, provide all the paths to your emulator, roms, etc. and I will help you build it manually.

Are you running AM with the correct permissions? Try running as root or sudo to root. Also make sure all scripts are executable with the account you are using.
« Last Edit: July 26, 2020, 01:55:15 AM by progets »

walknight

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Help me get started
« Reply #4 on: July 26, 2020, 09:02:40 AM »
Thanks for the detailed instructions! I'll tinker around and report back.
I'm a developer myself so don't mind tweaking things. In fact getting AM to build took a lot of efforts but I think it'll be worth it.

walknight

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Help me get started
« Reply #5 on: July 26, 2020, 11:37:06 PM »
Made great progress today! Finally was able to see the graphics and videos although some images did not show up. Below please find my response:

First I would ask, are you using a normal wired keyboard?

It's a wired USB keyboard. The fact that it actually registers all key presses when setting up a "custom 1" key makes me feel that the keyboard is seen by the program.
The issue is only at a "input text box" type widget, where it does not echo any text typed. The backspace/home/end/arrow keys do work in the text box.

Second I would say, you can manually modify the attract.cfg (it's just a text file) "input map" fields to see if that helps.

I can see the auto generated "input map" section and those keys do work. Again it's only in the text box that I cannot type.

Third, you can manually create emulator files, but this shouldn't be needed.

This is what worked for me. So I created a MAME.cfg file using your template. Then upon entering AM I can see an emulator "MAME" appears in the menu.
There is some small issue though: The logo and marquee and video all load fine, but the boxart do not show.

Also this is actually an arcade cabinet with joysticks/spinners and a trackball, but none of those works. Only the USB keyboard works now.

I'm ready to dig into the code and insert some print statements to see what went wrong. Could you give me some pointers as to where to look for these issues?

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Help me get started
« Reply #6 on: July 27, 2020, 10:22:22 PM »
Your "boxart" problem is likely just a naming issue depending on the layout/theme you're using. There isn't a set standard so your layout is likely calling it "flyer" or "fanart". If this is the case you can change your folder name or change the layout.nut file to the name you want to use.

In terms of trouble shooting, there should be a "last_run.log" that might have some helpful information. There should also either be an attract-console binary or a switch for the attract binary to output to the console. I don't have an AM linux system on hand to look.

I looked at some old threads and the old keyboard problem was solved by adding a delay in the boot before running AM. You could also just exit and rerun AM to work around the old issue. This was resolved years ago though, at least on the Pi.

You might try disconnecting your arcade controls to make sure that isn't a factor. Also check the memory split on your OS, I've seen weird problems on the Pi if the GPU is set too low.

What OS are you using and how are you running AM? In GUI, from command line, with x-windows?

walknight

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Help me get started
« Reply #7 on: July 28, 2020, 08:35:21 PM »
What OS are you using and how are you running AM? In GUI, from command line, with x-windows?

Thanks again for the many suggestions, will definitely check them out!
The firmware on this cab is a buildroot created Linux roughly compatible with Ubuntu 16.04. It has no X window but does have wayland.
They allow some kind of homebrew mechanism where you can put the executable onto a USB drive, and launch it from the stock GUI.
I do have SSH access to the cab so can also launch it through command line and check stdout or log files.

walknight

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Help me get started
« Reply #8 on: July 29, 2020, 08:15:37 PM »
Update:
First the "boxart" issue has been resovled as you pointed out. Turns out the theme was using "fanart" or "flyer" so I just added a "flyer" entry pointing to the same path and it worked flawlessly. Thanks!

On the joystick issue, I think I've determined that it's due to my system did not install the "joystick" API and only have the "evdev" interface, as I don't see any /dev/input/jsN device but only /dev/input/eventN. I read that SFML does not support evdev yet. So my question is: How hard it is to add evdev support, or at least make my joystick work through the evdev interface?

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Help me get started
« Reply #9 on: July 30, 2020, 07:32:30 PM »
I think installing the joystick API would be the easiest thing to do.

AM uses SFML but isn't the creator or developer for SFML. If you want to try to get SFML to support evdev you would need to ask those folks about it.