[OLD-1] AGS engine Linux port

Started by BigMc, Sun 03/06/2012 19:04:20

Previous topic - Next topic

s_d

#460
Quote from: Calin Leafshade on Thu 06/06/2013 22:52:37
How does the midi setup work in the linux version?
How do I tell AGS which alsa port to use? I run timidity which works fine in everything else but I can't seem to get any midi signals from AGS at all.

Yep;  what BigMC said.  Though, this is so poorly documented (between AGS & Allegro) that I'm glad you asked.  I'll go ahead and reply at length, so we may link to the post itself, in the future.

Calin, you need a couple of things.

First, you need to verify that you have MIDI supported (i.e., that either your sound driver supports MIDI directly, as most do, or through Timidity or similar).  Run aplaymidi -l (that's "l" for "list") to display ALSA ports which support MIDI.  The output might look like:

Code: text
  Port    Client name                      Port name
  14:0    Midi Through                     Midi Through Port-0


Note the port number (zero in this case).

Next, you need to verify that MIDI works at all (through a MIDI player unrelated to AGS, or similar).  At this point, you can be certain that you'll be able to play any AGS game with MIDI sound (modulo bugs of course).

To set up a specific game, first you'll need to put a patches.dat file in it's data directory (you can choose one from here).  I believe it must be named patches.dat for the Allegro library to find it.  I'm mostly using this one.

Lastly, you must set up the acsetup.cfg in the data directory, to properly index your MIDI port:

Code: INI

[sound]
digiid=1
midiid=0


You may not even have a "sound" section in the config file, but you'll need to add it. The parameter midiid is set to your port number from the aplaymidi listing.  For me, digiid needed to be set to 1, for MIDI port 0.  I'll go figure out why, and update this post with the reasoning.

Calin Leafshade

Nope, still doesnt work.

My MIDI is working fine and when I run the game (5 Days a Stranger) in Wine the midi works fine but not if i use the native linux port.

s_d

Is your MIDI port also zero?  What's in your acsetup.cfg?

Calin Leafshade

â”Å'â”â,¬[steve][archlaptop][~/games/yahtzee/5das]
â””â”â,¬Ã¢â€â,¬Ã¢â€¢Â¼ aplaymidi -l
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
128:0    TiMidity                         TiMidity port 0
128:1    TiMidity                         TiMidity port 1
128:2    TiMidity                         TiMidity port 2
128:3    TiMidity                         TiMidity port 3
â”Å'â”â,¬[steve][archlaptop][~/games/yahtzee/5das]
â””â”â,¬Ã¢â€â,¬Ã¢â€¢Â¼ cat acsetup.cfg 
[sound]
digiid=1
midiid=0
[misc]
defaultres=1
screenres=0
letterbox=0
defaultgfxdriver=DX5
gfxdriver=DX5
windowed=1
refresh=0
gfxfilter=StdScale3



I've connected port 14:0 to 128:0 and aplaymidi -p 14:0 music0.mid plays midi files just fine.

s_d

Ok, you've got native MIDI support on 14:0, so I don't think you need TiMidity (but that doesn't really matter too much).  Either way, it should be working.

Is it only 5 Days, or is it not working on other games as well?

BTW... please don't interpret my analysis & probing here as any kind of judgement against you.  This very well may be a bug!  I simply need to be certain, and as long as you're helping me, I prefer to gather as much information as I can.

BigMc

Allegros DIGMID does not output midi (to Timidity or whatever), it uses the patches to output the audio itself. I could not get Allegro to output midi either.

Cheeseness

Quote from: s_d on Tue 04/06/2013 03:02:59Cheeseness;  thank you for the valuable input!  I'm working on all of this, and will report back when I have more information.

No worries - wish I had a bit more time to dive into it. If you want to grab me on Steam/IRC (I can normally be found in #steamlug on freenode)/whatever I can try to work with you to try to further track stuff down when I'm around.


Also awesome to hear that Wadjet have brought somebody onboard and are looking to keep them contributing back :D

Calin Leafshade

Quote from: BigMc on Fri 07/06/2013 09:17:57
Allegros DIGMID does not output midi (to Timidity or whatever), it uses the patches to output the audio itself. I could not get Allegro to output midi either.

I thought this would be the case since it takes a patch file.

It's a shame AGS can't output pure midi in linux though.

BigMc

If you want to figure this out: I would start with the MIDI example program (exmidi.c) that comes with Allegro 4 and try to get that to work first.

Crimson Wizard

#469
Quote from: s_d on Thu 06/06/2013 00:07:28
Quote from: Crimson Wizard on Wed 05/06/2013 08:33:17
I made few optimizations in "develop" branch, mostly simplifying new class hierarchies and inlining functions. They did not increase perfomance really much, but were enough to fix desynchronization between animation and sound/music during cutscenes in particular games. I think it would be possible to partially merge (or cherry-pick) that to master.
(merging whole develop branch right before the release would be risky, because it has significant change in internal data structures).

I agree with your merge strategy;  would that be something you'd like me to cherry-pick and test, or would you prefer to?

I am going to try merging the first part of "develop" branch up to the point where I started to change internal implementation of game objects. It contains an improvement that seem to have a noticable effect on amount of processor load "Nelly Cootalot II" does (according to my examinations).
Also IIRC the changes in that part are strictly dedicated to optimizing utility classes and few engine routines.

WizardStan

Hi guys.
So I'm trying to build for a touchscreen oriented device running linux.  The problem is that the pointer is always offset if the window isn't a perfect fit.  Like, a 320x200 game in a 320x240 window has a 20 pixel bar at the top and bottom, right?  But then the mouse cursor is similarly 20 pixels lower than where it actually is.  Have I explained that well?  I've built it on my desktop (also running linux) and it's the exact same situation, the mouse pointer (and click region) appears 20 pixels below where it actually is according to the system, except on a desktop with a relative pointing device it doesn't make a difference.  When using an absolute coordinate device like a tablet it's a right pain.
I have a build from 8 months ago that didn't exhibit this problem and despite all the awesome cleanup that's been done to the code since then I can see that not a lot has changed with respect to how the pointer is handled, so I'm at a bit of a stall trying to figure out how to proceed.  Anyone have any ideas?  I'm assuming it's a mouse issue (or an "I'm-an-idiot" issue, those happen often enough) otherwise the iOS and Android devs would have had the same problem long ago.  Most curious is the fact that it used to work and now it doesn't and I can't see what the difference is.  Same version of allegro even!

WizardStan

I very nearly have a fix but I can't figure out where to get the really real screen size.  Ostensibly final_scrn_wid and final_scrn_hit should give me what I need, but I'm finding that not to be the case: even though the window is clearly 960x720 these two variables continue to say 320x240.  The scaling seems to be entirely automatic, too: if I reduce my screen resolution to 800x600 I only get a 640x480 window, and if I reduce it to 640x480 then it sticks with a 320x240 window.  current_screen_resolution_multiplier is of no help either, it is always 1, just as final_scrn_wid is always 320 even when the window itself is much larger.  Can anyone shed any light on why this might be the case?  What part of the code is causing the window to be dynamically scaled with my screen resolution, and can I find out exactly what scale it is using?
Thank you!

BigMc

The code that selects the scaling filter for windowed mode is here:
https://github.com/adventuregamestudio/ags/commit/3b9b41448500132a665e9dd3e15b22eac9a43126

It selects a resolution smaller than your desktop resolution to leave space for window borders and taskbar.

The Android port works well with touchscreen devices, it draws the game in native resolution to a surface that is then displayed and scaled using OpenGL. One could get rid of the scaling hacks on Linux and Windows if these ports would also use OpenGL. They could share more code with Android then.

scottchiefbaker

I build AGS from the master branch and tried to run Wadjeteye's new Shivah demo and I get this error:

AGS: Built library path: ./libagstouch.so
AGS: dlopen returned: ./libagstouch.so: cannot open shared object file: No such file or directory
AGS: Built library path: /tmp/The Shivah - Kosher Edition (DEMO)/libagstouch.so
AGS: dlopen returned: /tmp/The Shivah - Kosher Edition (DEMO)/libagstouch.so: cannot open shared object file: No such file or directory
AGS: Plugin loading failed, trying built-in plugins...
AGS: No built-in plugin found. Plugin loading failed!
AGS: No placeholder functions for the plugin found. The game might fail to load.
AGS: Built library path: ./libagswadjetutil.so
AGS: dlopen returned: ./libagswadjetutil.so: cannot open shared object file: No such file or directory
AGS: Built library path: /tmp/The Shivah - Kosher Edition (DEMO)/libagswadjetutil.so
AGS: dlopen returned: /tmp/The Shivah - Kosher Edition (DEMO)/libagswadjetutil.so: cannot open shared object file: No such file or directory
AGS: Plugin loading failed, trying built-in plugins...
AGS: No built-in plugin found. Plugin loading failed!
AGS: No placeholder functions for the plugin found. The game might fail to load.
AGS: Built library path: ./libags_shell.so
AGS: dlopen returned: ./libags_shell.so: cannot open shared object file: No such file or directory
AGS: Built library path: /tmp/The Shivah - Kosher Edition (DEMO)/libags_shell.so
AGS: dlopen returned: /tmp/The Shivah - Kosher Edition (DEMO)/libags_shell.so: cannot open shared object file: No such file or directory
AGS: Plugin loading failed, trying built-in plugins...
AGS: No built-in plugin found. Plugin loading failed!
AGS: Placeholder functions for the plugin found.
Script link failed: Runtime error: unresolved import 'IsOnPhone'

Is this an AGS error, or a Wadjeteye error?

BigMc

The plugins have to be compiled on Linux. Closed source plugins make it impossible to port a game retroactively without reverse engineering the plugins, so plugins should be ideally replaced by modules or open sourced.

s_d

#475
Those plugins are due to Janet's iOS build.  Recall that they used the snowrain plugin for Gemini Rue and moved that to a module.

I thought the ags_shell issue was dealt-with, though... we should simply not load it, and then URL's become not click-able.  I've been meaning to build a Linux version since it would be trivial to shell out to a browser ("sensible-browser", or "$BROWSER" or whatever), but it takes a back seat to the audio corruption bug.  (Yes, I'm still working on it, but haven't fixed it yet, so nothing to report.)

Once we get Gemini Rue solid for release (including audio and our ags-setup util) we can ask Janet to strip out those libraries from The Shivah, and take a look at wadjetutil, not sure what that is.  Until then, I can't imagine bothering her.

Crimson Wizard

#476
Isn't that new Shivah demo a special build for iOS? Maybe it is not even supposed to run on other platforms due change in UI or something?

EDIT: Oh, nevermind, noticed the thread: http://www.adventuregamestudio.co.uk/forums/index.php?topic=49522

scottchiefbaker

I'm just getting back in to github and AGS, what branch are we working on currently?

Crimson Wizard

Quote from: scottchiefbaker on Fri 15/11/2013 18:16:34
I'm just getting back in to github and AGS, what branch are we working on currently?
Here's the plan on branch usage: http://www.adventuregamestudio.co.uk/forums/index.php?topic=46296.msg636445912#msg636445912
The master is temporarily not updated, while most recent updates are made to "release-3.3.0".

TazX

#479
Firstly, thanks!.  A lot of work has gone into the Linux port, and it's awesome you're spending so much time on us.  Secondly, I'm going to ask for a little more of your time to (hopefully) help me get it working on my computer.  (roll)

I'm trying to install AGS from the github on Linux Mint.  Kernal Version (if that's helpful) 3.8.0-33-generic #48-Ubuntu x86_64 GNU/Linux
I've tried both techniques (Ubuntu / Debian based (which Mint is), and the more generic Linux instructions) and it errors out with the following message:
Linking engine...
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [ags] Error 1
make: Leaving directory `/home/username/ags/Engine'


I've tried googling the error but haven't found much, and forcing links (which seems like it might work) hasn't ever worked well, and I'm not sure where to begin, or what I should be linking.  I've tried an apt-cache search for lstdc and haven't found any compatible libraries.

Long story short, I guess I'm asking for help installing AGS as I've reached the end of my problem solving skills.  ???

SMF spam blocked by CleanTalk