The NEW Build Your Own Arcade Controls

Main => Software Forum => Linux => Topic started by: StefanV on January 03, 2021, 11:34:22 am

Title: LEDSpicer changing button color when using emitter.
Post by: StefanV on January 03, 2021, 11:34:22 am
Hi everyone,

I bulidng my first arcade and at the moment I am trying to light my RGB Buttons for my aracde running retropie on a RPI 4.
Using LEDSpicer is working quite well for this.

There is one challenge I am fighting with.
Is there any chance to change the button colors when emitter gathers the configuration from the gameData.xml file?
With my current configuration the button color is always "White", and I would like to change the colors not for every game but for the system.

Attached there is snap from the log file for using emitter with galaga like the example from the LEDSpicer Wiki Pages:
Code: [Select]
Received message: task: CraftProfile, data: arcade/galaga|P2_JOYSTICK1,P2_BUTTON1,P1_JOYSTICK1,P1_BUTTON1|PLAYER1,PLAYER2,2_COINS,2_PLAYERS|arcade|11
changing profile to arcade/galaga
Reading /usr/share/ledspicer/profiles/arcade/galaga.xml
Profile failed: Unable to read the file /usr/share/ledspicer/profiles/arcade/galaga.xml Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename=/usr/share/ledspicer/profiles/arcade/galaga.xml
Creating profile with profile_arcade
Reading /usr/share/ledspicer/profiles/profile_arcade.xml
Unknown element P2_JOYSTICK1
Unknown element P2_BUTTON1
Unknown element P1_JOYSTICK1
Using element P1_BUTTON1 color White
Loading animation PLAYER1

I found out that chanig the color is possible when I create a profile for each game.
But that would mean I need to craete a xml profile file for any game played.
From my understanding that would contradict the idea behind using emitter an get the config from the gameData.xml file.

Any hint is much appreaciated.
Thanks, Stefan.
Title: Re: LEDSpicer changing button color when using emitter.
Post by: mahuti on January 04, 2021, 09:07:59 am
I have a lot of experience with LEDspicer and my system does what you ask with only the profile_arcade. Changing the colors is done automatically with a colors.ini file. I'll get the details and details back to you later.

Meantime I have a write up  (http://forum.attractmode.org/index.php?topic=3799.msg26732#msg26732)that could possibly be helpful, though I don't remember if I specifically covered that scenario in it.
Title: Re: LEDSpicer changing button color when using emitter.
Post by: StefanV on January 04, 2021, 10:40:09 am
Thanks mahuti for your quick response.    :D
I will take a look in your linked description for the emitter plugin.

I guess the hint to the colors.ini file will be the key.
I haven't found any information to this here in the forum nor in the ledspicer wiki pages.

BTW: The search function of this forum is not working for me.
I alway get the error attached in the uploaded screenshot. Any idea to this issue?

Thanks, Stefan.
Title: Re: LEDSpicer changing button color when using emitter.
Post by: PL1 on January 04, 2021, 12:30:50 pm
BTW: The search function of this forum is not working for me.
I alway get the error attached in the uploaded screenshot. Any idea to this issue?
Saint knows about the problem.  http://forum.arcadecontrols.com/index.php/topic,162229.0.html (http://forum.arcadecontrols.com/index.php/topic,162229.0.html)

JRobATL found a way to partly restore search functionality.
You can still use the search feature if you search in message subjects only.

If a subject line search doesn't yield the desired results, add "site:forum.arcadecontrols.com" to an internet search engine query.
- For example, if you want to search for BYOAC posts containing LEDSpicer and emitter the search terms would be,
Code: [Select]
LEDSpicer emitter site:forum.arcadecontrols.comhttps://duckduckgo.com/?q=LEDSpicer+emitter+site%3Aforum.arcadecontrols.com&t=h_&ia=web (https://duckduckgo.com/?q=LEDSpicer+emitter+site%3Aforum.arcadecontrols.com&t=h_&ia=web)


Scott
Title: Re: LEDSpicer changing button color when using emitter.
Post by: meduza on January 04, 2021, 01:35:15 pm
as mahuti, using the color's file is one way to go, you can also use default color per element / group :)
Title: Re: LEDSpicer changing button color when using emitter.
Post by: StefanV on January 04, 2021, 01:49:25 pm
Quote
If a subject line search doesn't yield the desired results, add "site:forum.arcadecontrols.com" to an internet search engine query.
- For example, if you want to search for BYOAC posts containing LEDSpicer and emitter the search terms would be,

Thanks Scott for catching up and clarification for the search issue!  :cheers:
Title: Re: LEDSpicer changing button color when using emitter.
Post by: StefanV on January 04, 2021, 01:58:25 pm
as mahuti, using the color's file is one way to go, you can also use default color per element / group :)

Hi meduza, sounds interesting.
How would that be configured correctly?
I tried it setting the color for the buttons (elements) on the profile of the system.
E.g.: in the profile_arcade.xml.
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<LEDSpicer
version="1.0"
type="Profile"
backgroundColor="Black"
>
            <element name="P1_BUTTON1" color="Red" />
            <element name="P1_BUTTON2" color="Green" />
    <element name="P1_BUTTON3" color="Yellow"/>
            <element name="P1_BUTTON4" color="Blue"/>
</LEDSpicer>

But this is not working out for me.
Using emitter sets any of the element to the color "White"

If I configure this for a game / rom profile e.g. galaga or 1942 then this is working well.
But that would mean I need to create a game / rom profile for each game.

Thanks, Stefan.
Title: Re: LEDSpicer changing button color when using emitter.
Post by: meduza on January 09, 2021, 12:29:29 am
Hello Stefan, I just found out that I forgot to document this   :-\
to add default colors to elements or groups use
Code: [Select]
defaultColor="Xxx"where Xxx is a color name from the list of colors (the 1st letter normally is Capital)
I will update the docs soon with several features we added lately. 8)

The default color can be override by ElementColor or GroupColor set on profiles  :laugh:

EDIT: Updated documentation added default color and solenoid usage! 8)
check it here (https://sourceforge.net/p/ledspicer/wiki/Configuration/#elements)
Title: Re: LEDSpicer changing button color when using emitter.
Post by: StefanV on January 09, 2021, 05:35:35 am
Hi meduza,

thanks for calrification.   :cheers:
I just gave it a try and it works well if set the default color in the ledspicer.conf
But if I set the color for a button element to another color in the system profile (e.g. profile_arcade.xml) it is not working for me.  :dunno

maybe someting else is wrong with my compilitation of LED Spicer:
If I call "ledspicerd -p default" I get a segmentation fault.
Code: [Select]
Initializing Device Ultimarc Ipac Ultimate IO
Connecting to 0xd209:0x410
Detecting interface
No Game Controller mode detected
Claiming interface 2
Dropping privileges to user id 1000 and group id 1000
Privileges dropped
Segmentation fault

My system is a raspberry pi4. The compilation went through witout error.
Any idea?

Thanks, Stefan.


Title: Re: LEDSpicer changing button color when using emitter.
Post by: mahuti on January 09, 2021, 11:27:51 am
Invalid XML?
Title: Re: LEDSpicer changing button color when using emitter.
Post by: meduza on January 09, 2021, 12:54:55 pm
looks like a syntax error, can you paste the profile and any other file used by it here so we can help you?
Title: Re: LEDSpicer changing button color when using emitter.
Post by: StefanV on January 10, 2021, 08:28:06 am
looks like a syntax error, can you paste the profile and any other file used by it here so we can help you?

Sure, files attached. ( I renamed the xml files to txt, as the board does not allow xml files)
There is nothing special in the xml files so far.
The default profile works if the ledspicerd daemon is running or if I run "ledspicerd -f" in foreground mode.
It only ends up with segmentation fault if I call it with "ledspcerd -p default".
All other profiles loading with -p also end up in a segmentation fault.

Using normal daemon mode or -f (foreground mode) the following appears to happen:
mslug.xml works as expected the 4 buttons turn blue.
But profile_acade.xml is not working as expected.
If I delete mslug.xml I would expect the profile_arcade.xml to be loaded with turning the buttons into red,
but instead the default colors from the ledspicer.conf are used. B1=Red,B2=Yellow,B3=Green and Button4=Blue.

Thanks, guys for trying to help me out, Stefan.
Title: Re: LEDSpicer changing button color when using emitter.
Post by: meduza on January 18, 2021, 10:24:54 am
got the files I will check.