Author Topic: config_directory issue with attract mode  (Read 7502 times)

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
config_directory issue with attract mode
« on: February 14, 2017, 06:54:26 PM »
I’m getting tired of this. I figured that I would try posting on the forum first because no one seems to read the bug reports on github. I’ve only had this issue posted on there for ever. My main computer used for programing is running mac os x, but I have also experienced an issue with this on windoze as well. Regardless…

Attract mode launches the attract.app package as expected, without any issues. The issues arise when you try to launch it via console from the following line in the terminal, and it’s yielded print:
Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract
Starting Attract-Mode v2.2.0-3 (OSX)
Warning: Attract-Mode was compiled to look for its default configuration files in: ../config/, which is not available.
Config: /Users/keiljr/.attract/attract.cfg

*** Initializing display: 'mame'
 - Loaded master romlist 'mame' in 1 ms (147 entries kept, 10 discarded)
 - Constructed 10 filters in 0 ms (1470 comparisons)
Error loading language resource file: en
Fontconfig error: Cannot load default config file
Plugin file not found: History.dat
 - Loaded layout: /Users/keiljr/.attract/layouts/flavors/ (layout.nut)

Attract mode stores config files under two directories on Mac Os X.
  • /Applications/Attract.app/Contents/MacOS/attract
  • ~/.attract/

Using the method to launch previously provided, the app config directory is ignored while the home directory config directory is loaded. Default plugins, modules, etc will not be loaded.

So this leads us to checking the command line params:

Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract -h
Attract-Mode v2.2.0-3 Copyright (c) 2013-2016 Andrew Mickelson
Usage: /Applications/Attract.app/Contents/MacOS/attract [option...]

ROMLIST IMPORT/BUILD OPTIONS:
  -b, --build-romlist <emu> [emu(s)...]
     Builds a romlist using the configuration for the specified emulator(s)
  -i, --import-romlist <file> [emu]
     Import romlist from the specified file. Supported formats:
        *.lst (Mamewah/Wahcade!)
        *.txt (Attract-Mode)
        *.xml (Mame listxml format or HyperSpin)
     The emulator to use for list entries can be specified as well
  -F, --filter <rule>
     Apply the specified filter rule when creating romlist
  -E, --exception <exception>
     Apply the specified filter rules exception when creating romlist
  --full
     Use with --build-romlist to include all possible roms [MAME only]
  -o, --output <romlist>
     Specify the name of the romlist to create, overwriting any existing

ARTWORK SCRAPER OPTIONS:
  -s, --scrape-art <emu> [emu(s)...]
     Scrape missing artwork for the specified emulator(s)

OTHER OPTIONS:
  -c, --config <config_directory>
     Specify the configuration to use
  -f, --font <font_name>
     Specify the default font to use
  -h, --help: Show this message
  -v, --version: Show version information

So we can use -c to explicitly declare a config directory. This resolves issues launching attract in Windows as a shell, as the Windows version only has one config directory. Mac os x has two however. I do not believe this param allows more than one option. I have tried the following without success. This is important to resolve for debugging, and is getting rather annoying.

Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract -c /Users/keiljr/.attract
Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract -c /Applications/Attract.app/Contents/MacOS/attract /Users/keiljr/.attract
Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract -c /Applications/Attract.app/Contents/MacOS/attract;/Users/keiljr/.attract

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 863
    • View Profile
    • new projects
Re: config_directory issue with attract mode
« Reply #1 on: February 15, 2017, 12:45:18 AM »
hmmm... I'm not at the computer with AM atm and can't check. But I can't remember having problems with running AM from terminal.

it sound trivial - but can you check out if problem disappears when you chnage your current directory to am executable first
like cd /Applications/Attract.app/Contents/MacOS/

and than run attract


keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: config_directory issue with attract mode
« Reply #2 on: February 17, 2017, 07:13:49 PM »
hmmm... I'm not at the computer with AM atm and can't check. But I can't remember having problems with running AM from terminal.

it sound trivial - but can you check out if problem disappears when you chnage your current directory to am executable first
like cd /Applications/Attract.app/Contents/MacOS/

and than run attract

Thank you for the tip! :) Issue is mostly resolved, and in a totally usable state so I can easily debug. Still some thing going on with font config.

Code: [Select]
Keils-iMac:~ keiljr$ cd /Applications/Attract.app/Contents/MacOS
Keils-iMac:MacOS keiljr$ /Applications/Attract.app/Contents/MacOS/attract
Starting Attract-Mode v2.2.0-3 (OSX)
Config: /Users/keiljr/.attract/attract.cfg

*** Initializing display: 'mame'
 - Loaded master romlist 'mame' in 1 ms (147 entries kept, 10 discarded)
 - Constructed 10 filters in 0 ms (1470 comparisons)
Fontconfig error: Cannot load default config file
Error opening input file: ../config/intro/intro.mp4
ERROR loading video: ../config/intro/intro.mp4
Error opening input file: ../config/intro/intro.mp4
ERROR loading video: ../config/intro/intro.mp4
 - Loaded layout: /Users/keiljr/.attract/layouts/flavors/ (layout.nut)

Fontconfig error: Cannot load default config file

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: config_directory issue with attract mode
« Reply #3 on: February 19, 2017, 02:20:49 AM »
Hi, I did two blog entries on setting up Attract Mode in MacOS:

https://mameonmacs.blogspot.co.at/2017/01/attract-mode-for-mame-under-osx.html
https://mameonmacs.blogspot.co.at/2017/01/attract-mode-for-osx-setup-part-2.html

Part 1 includes the font topic, part 2 the video topic. I would be very grateful for feedback on these two entries and whether I have missed anything.
In Terminal, you definitely must run Attract Mode from the App directory. Same with MAME from the Terminal

EDIT: I just realize that I have the same font config error, however, my font choice works, so it does not seem to harm.

Cheers, Stefan