Page 1 of 2
OpenLibrary Errors
Posted: Tue Nov 25, 2008 1:19 am
by Inner
PB430b4
XMP -
http://xmp.sourceforge.net/
UADE -
http://zakalwe.fi/uade/download.html
# Both - of these players export libraries that are for Audacious, however only the XMP Audacious plugin PureBasic opens.
# XMP - Exports a libxmp.a but is not importable as the linker throws so many errors it's still trying to list them.
Using console commands (xmp/uade123) on either would fail because the console commands in PB are broken on linux, and is the wrong method also if we drop down to using native commands in an attempt to avoid PB's broken console commands, because that means constantly dumping a file to to the hard drive every millisecond to get various running time of the tune being played.
Now then while it might be very adventagous to support Audacious as a plugins it's the wrong path I feel for attacking this problem.
So where do I go from here?
Posted: Tue Nov 25, 2008 1:32 am
by lexvictory
instead of using import on the .a file, try using it on the .so file - works for me on linux shared libs.
on a side note, how are the console commands broken on linux?
Posted: Tue Nov 25, 2008 2:00 am
by Inner
lexvictory wrote:instead of using import on the .a file, try using it on the .so file - works for me on linux shared libs.
on a side note, how are the console commands broken on linux?
because uade123 reports that it;
uade123: can't setup interactive mode (tcsetattr()): Input/output error
uadecore: No more songs to play.
Code: Select all
p=RunProgram("uade123","~/Projects/uade-2.12/songs/AHX.Cruisin","/",#PB_Program_Open|#PB_Program_Read)
While ProgramRunning(p)
output.s + ReadProgramString(p) + Chr(13)
Wend
Debug output
So I draw my conclusion the commands are broken becuse uade123 is outputting errors that it can write to the console in the standard way while being ran by PureBasic commands.
As stated you cannot use the .so for UADE's Audacious plugin because PB refuses to open it, however it will open the XMP Audacious plugin just fine, now if your writing a plugin system would you not write it the same for all plugins? of course you would, under that law both .so libraries should open fine UADE and XMP without problem but this isn't the case.
Having a preference would be UADE because it's replay is better than XMP in some instants XMP replay is shockingly bad, I was using XMP as a test case as something else that plays multiformat tunes.
Posted: Tue Nov 25, 2008 2:12 am
by lexvictory
uade123: can't setup interactive mode (tcsetattr()) would indicate that it needs a terminal (i.e. konsole, xterm, etc).
As far as I remember, PB's runprogram commands read/write stdout/stdin, which means anything (windows or linux) that tries interactive mode, will not work. (someone correct me if I'm wrong)
I will have a look at Uade to see what I can find.
Posted: Tue Nov 25, 2008 2:39 am
by Inner
lexvictory wrote:uade123: can't setup interactive mode (tcsetattr()) would indicate that it needs a terminal (i.e. konsole, xterm, etc).
As far as I remember, PB's runprogram commands read/write stdout/stdin, which means anything (windows or linux) that tries interactive mode, will not work. (someone correct me if I'm wrong)
I will have a look at Uade to see what I can find.
Sounds strangely formilure if that is the case with uade123 how else can I support it, considering PB won't open the Audacious .so library so I can go in the back door, my guess make a .so library for it but I've no clue how to do that, and the documentation for UADE is basically zero which means read the source code or use the source for uade123 as a guide.
Posted: Tue Nov 25, 2008 4:13 am
by lexvictory
if the xmms plugin is ok to use it should be able to be used like so:
Code: Select all
ImportC "/usr/lib/xmms/Input/libuade2.so"
get_iplugin_info()
EndImport
Debug get_iplugin_info()
to use the audacious plugin, it needs other libraries to be imported (I got as far as libaudacious and the alsa output plugin, but the alsa plugin needs more that I can't figure out

)
Posted: Tue Nov 25, 2008 4:42 am
by Inner
lexvictory wrote:if the xmms plugin is ok to use it should be able to be used like so:
Code: Select all
ImportC "/usr/lib/xmms/Input/libuade2.so"
get_iplugin_info()
EndImport
Debug get_iplugin_info()
to use the audacious plugin, it needs other libraries to be imported (I got as far as libaudacious and the alsa output plugin, but the alsa plugin needs more that I can't figure out

)
The xmms plugin I can't compile.
chief@agnus ~/Projects/uade-2.12/src/frontends/xmms $ make
gcc -Wall -O2 -fPIC -shared -g -I../common -I../../include -c plugin.c
In file included from plugin.c:29:
plugin.h:9:18: error: glib.h: No such file or directory
plugin.h:10:21: error: gtk/gtk.h: No such file or directory
plugin.h:11:25: error: xmms/plugin.h: No such file or directory
plugin.h:12:23: error: xmms/util.h: No such file or directory
In file included from plugin.c:29:
plugin.h:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
plugin.c:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘uade_ip’
plugin.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sample_format’
plugin.c:273: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
plugin.c: In function ‘uadexmms_is_our_file’:
plugin.c:315: error: ‘TRUE’ undeclared (first use in this function)
plugin.c:315: error: (Each undeclared identifier is reported only once
plugin.c:315: error: for each function it appears in.)
plugin.c:332: error: ‘FALSE’ undeclared (first use in this function)
plugin.c: In function ‘initialize_song’:
plugin.c:397: error: ‘TRUE’ undeclared (first use in this function)
plugin.c:401: error: ‘FALSE’ undeclared (first use in this function)
plugin.c: In function ‘play_loop’:
plugin.c:442: error: ‘uade_ip’ undeclared (first use in this function)
plugin.c:485: warning: implicit declaration of function ‘xmms_usleep’
plugin.c:564: error: ‘sample_format’ undeclared (first use in this function)
plugin.c: In function ‘uade_play_file’:
plugin.c:762: error: ‘uade_ip’ undeclared (first use in this function)
plugin.c:762: error: ‘sample_format’ undeclared (first use in this function)
plugin.c:787: error: ‘FALSE’ undeclared (first use in this function)
plugin.c: In function ‘uade_stop’:
plugin.c:845: error: ‘uade_ip’ undeclared (first use in this function)
plugin.c: In function ‘uade_pause’:
plugin.c:855: error: ‘uade_ip’ undeclared (first use in this function)
plugin.c: In function ‘uade_get_time’:
plugin.c:887: error: ‘uade_ip’ undeclared (first use in this function)
plugin.c: In function ‘uade_info_string’:
plugin.c:924: error: ‘uade_ip’ undeclared (first use in this function)
make: *** [plugin.o] Error 1
I'm figuring this is due to the fact that xmms is deprecated and no longer in development and the plugin is only still available for those older linux operating system that still support it.
There is also a uadecore whatever that is.
Posted: Tue Nov 25, 2008 4:45 am
by lexvictory
plugin.h:11:25: error: xmms/plugin.h: No such file or directory
plugin.h:12:23: error: xmms/util.h: No such file or directory
you need xmms-dev installed.
if u use debian/ubuntu just do an apt-get install xmms-dev
Posted: Tue Nov 25, 2008 5:40 am
by Inner
lexvictory wrote:plugin.h:11:25: error: xmms/plugin.h: No such file or directory
plugin.h:12:23: error: xmms/util.h: No such file or directory
you need xmms-dev installed.
if u use debian/ubuntu just do an apt-get install xmms-dev
Gentoo xmms isn't even in my remote portage site anymore as with all things depreciated erased from existents, I remember a year or so ago when I first installed Gentoo trying to use xmms because I thought it was the only one for me, and finding it deprecated I tried compiling it from source which also failed, the thing is so old now that it doesn't even compile anymore, price you pay for having an up to date system.
I did have one idea and that is to make uade123 an .so but I don't know how to make the makefile output to that, idea being that I could trim out the unrequited functionality and access it that way.
The frustrating thing is I used to know years ago, when I was making the scintilla gadget for PB under linux, which then Freak then picked up later (not the same code I don't think) and used for the PB IDE you use today on all 3 platforms.
Posted: Tue Nov 25, 2008 5:50 am
by lexvictory
*** 3. Notes on GNU/Linux distributions ***
3.1 Gentoo
To install necessary dependencies for Gentoo, execute:
emerge -u libao (the dependency for uade123)
emerge -u xmms
emerge -u audacious
I dont know much about gentoo anymore, but that's what the INSTALL.readme file says...
other than that, I can't help.
Posted: Tue Nov 25, 2008 6:49 am
by Inner
lexvictory wrote:*** 3. Notes on GNU/Linux distributions ***
3.1 Gentoo
To install necessary dependencies for Gentoo, execute:
emerge -u libao (the dependency for uade123)
emerge -u xmms
emerge -u audacious
I dont know much about gentoo anymore, but that's what the INSTALL.readme file says...
other than that, I can't help.
That is telling you to remove ( -u ) libao , xmms & audacious.
Be honest with you I'm surprised I got a single reply to the thread, people tend to stay within the con finds of the PureBasic language unless it's provide for them from an external source, a nice packaged way.
It's my own fault I don't do anything mainstream

Posted: Tue Nov 25, 2008 9:12 am
by Inner
actually it is printing to stdout...
Code: Select all
case 'c':
strlcpy(uade_output_file_name, "/dev/stdout", sizeof uade_output_file_name);
/* Output sample data to stdout so do not print anything on stdout */
uade_terminal_file = stderr;
break;
in fact looking through the uade123 code, there is nothing non-standard about it.
Posted: Tue Nov 25, 2008 10:06 am
by Inner
And this;
Code: Select all
fp = popen_("uade123 ~/Projects/uade-2.12/songs/AHX.Cruisin","r")
line.s=Space(130)
While ( fgets_( line, 130, fp))
Debug line
Wend
pclose_(fp)
Confirms it! side step all PB's garbage and you get what you expect.
you still get this tho.
uade123: can't setup interactive mode (tcsetattr()): Input/output error
but at least it tries to play it
Posted: Tue Nov 25, 2008 2:16 pm
by freak
> Confirms it! side step all PB's garbage and you get what you expect.
The "~" character in your path is a shell feature. popen_() executes a new shell, RunProgram() doesn't, thats why the program cannot find the file.
You created the garbage. Pass a real path to the command and it will work just fine.
If PB is so much garbage, why don't you side step it all and just go away ? thank you.
Posted: Tue Nov 25, 2008 2:21 pm
by Inner
freak wrote:> Confirms it! side step all PB's garbage and you get what you expect.
The "~" character in your path is a shell feature. popen_() executes a new shell, RunProgram() doesn't, thats why the program cannot find the file.
You created the garbage. Pass a real path to the command and it will work just fine.
If PB is so much garbage, why don't you side step it all and just go away ? thank you.
WRONG! has nothing to do with it not finding a file, it finds it quite well thank you very much.
RunProgram & popen have never had a problem finding anything.
While I'm at it ~ = a terminal command to return the path to the current home director, stop smoking drugs.