Recent

Author Topic: Extended Module Player  (Read 2514 times)

bobby100

  • Sr. Member
  • ****
  • Posts: 253
    • Malzilla
Re: Extended Module Player
« Reply #15 on: September 12, 2024, 07:44:33 pm »
Hmmm, I am trying to compile BeRoXM under Lazarus, and I got into the following problem in sysosh.inc
Code: Pascal  [Select][+][-]
  1. type
  2. {$ifdef CPU64}
  3.   THandle = QWord;
  4.   ULONG_PTR = QWord;
  5. {$else CPU64}
  6.   THandle = DWord;
  7.   ULONG_PTR = DWord;
  8. {$endif CPU64}
  9.   TThreadID = DWord;
  10.   SIZE_T = ULONG_PTR;
The following line from BeRoXM.pas
Code: Pascal  [Select][+][-]
  1. ThreadHandle:=BeginThread(NIL,0,@BeRoXMThreadProc,SELF,CREATE_SUSPENDED, ThreadID);
gets ThreadID as QWord, but the BeginThread expects LongWord. Could it be, that there is an error in sysosh.inc, and that TThreadID should get into CPU64 define as a QWord?

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Extended Module Player
« Reply #16 on: September 12, 2024, 10:29:07 pm »
Hmmm, I am trying to compile BeRoXM under Lazarus, and I got into the following problem in sysosh.inc
I am a bit confused by your findings. A threadID in FPC is of type PtrUInt (or at least should be according to the docs). That raises the question where is that coming from ?

see also https://www.freepascal.org/docs-html/rtl/system/beginthread.html and https://www.freepascal.org/docs-html/prog/progse44.html
This tagline is powered by AI

bobby100

  • Sr. Member
  • ****
  • Posts: 253
    • Malzilla
Re: Extended Module Player
« Reply #17 on: September 13, 2024, 12:21:08 am »
PtrUInt is also a LongWord/DWord according to the docs, but if I follow through the RTL, it is a QWord for TThreadID, but it is expected LongWord in BeginThread.

bobby100

  • Sr. Member
  • ****
  • Posts: 253
    • Malzilla
Re: Extended Module Player
« Reply #18 on: September 14, 2024, 11:46:33 am »
Should I fill a bug-report on GitLab for FPC/RTL?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11778
  • FPC developer.
Re: Extended Module Player
« Reply #19 on: September 14, 2024, 12:31:10 pm »
This is a well known issue, and lies in the definition of the beginthread stuff.

The last time it was mentioned, the reaction was that it doesn't hurt, and then it was better  to keep the interface the same.

I did this change  in development version back then

SHA-1: 7957c349407241e8135af138a68621d4cc9ccea3

* * change tthreadid to thandle, as the used functions for threadid in systhrd all use HANDLE.
« Last Edit: September 14, 2024, 12:34:02 pm by marcov »

bobby100

  • Sr. Member
  • ****
  • Posts: 253
    • Malzilla
Re: Extended Module Player
« Reply #20 on: September 14, 2024, 02:38:12 pm »
@Gigatron
Here is a simple example of BeRoXM for Lazarus. It plays a module from an array.
In sub-folder is the code to generate the unit with the array.

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #21 on: September 14, 2024, 02:59:33 pm »
Hi,
Ok , this is the 3rd version of extended xmplayer without SDL2 or other external library except libxmp.dll.
...

Hello Gigatron.

There is a update of your project with target Unix system too.
It uses the root libalsa.so library.
Also libxmp.pas does now dynamically loading of the xmp library, you may load it when and from you want with xmp_Load(const libfilename:string);

The project is in attachment, you will need to change the target in project option if you want to compile it for Linux (default is Win64).

Here the xmp libraries for Linux 64 and Windows 64 + the demo mod file (too big for attachment).
https://github.com/fredvs/test/releases/download/fpc323/xmp_demo_libs.zip
Copy those files in the root directory of the project.

Many thanks to make me discover that fantastic xmp library.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Extended Module Player
« Reply #22 on: September 14, 2024, 03:48:47 pm »
There is a update of your project with target Unix system too.
Impatient ?  :P

Good that you used the packrecords for the xmp headers, otherwise it becomes a mess  :)

All good though and thank you Fred, as it takes out the edge for my attempt (xmp header almost similar as your implementation, using dynamic loading). Ofc. I have to do a lot of testing with all kinds of modules to see if everything actually works  O:-)

Because I want to use the xmp examples as is, I've gone with asound headers that have a bit more functions exposed. All seems to be working with libasound, openal and I've tossed in a libao example as well. The hard part is cleaning things up (first make it work, then make it clean, tidy and consistent).

fwiw: the interwebs is stuffed with small modules that are around 40-50 kb in size (narrow search to chip-tune(s)).
This tagline is powered by AI

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #23 on: September 14, 2024, 04:40:03 pm »

Because I want to use the xmp examples as is, I've gone with asound headers that have a bit more functions exposed. All seems to be working with libasound, openal and I've tossed in a libao example as well.

Yes I took big inspiration from the xmp alsa.c example.
It works great with fpc.  ;)
Now for the less-root-audio multi os library, I prefer PortAudio.  :-X

There is a console demo of xmp for fpc:
https://github.com/fredvs/xmp_pas
« Last Edit: September 14, 2024, 07:02:56 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Gigatron

  • Full Member
  • ***
  • Posts: 144
  • Amiga Rulez !!
Re: Extended Module Player
« Reply #24 on: September 14, 2024, 07:49:17 pm »
@Gigatron
Here is a simple example of BeRoXM for Lazarus. It plays a module from an array.
In sub-folder is the code to generate the unit with the array.

@bobby100 thank you for the project , it working nice ;
Sub Quantum Technology ! Ufo Landing : Ezekiel 1-4;

Gigatron

  • Full Member
  • ***
  • Posts: 144
  • Amiga Rulez !!
Re: Extended Module Player
« Reply #25 on: September 14, 2024, 07:57:58 pm »
Hi,
Ok , this is the 3rd version of extended xmplayer without SDL2 or other external library except libxmp.dll.
...

Hello Gigatron.

There is a update of your project with target Unix system too.
It uses the root libalsa.so library.
Also libxmp.pas does now dynamically loading of the xmp library, you may load it when and from you want with xmp_Load(const libfilename:string);

The project is in attachment, you will need to change the target in project option if you want to compile it for Linux (default is Win64).

Here the xmp libraries for Linux 64 and Windows 64 + the demo mod file (too big for attachment).
https://github.com/fredvs/test/releases/download/fpc323/xmp_demo_libs.zip
Copy those files in the root directory of the project.

Many thanks to make me discover that fantastic xmp library.

Fre;D
Nice @Fred thank you too , i am not on Linux maybe in the future :)
Sub Quantum Technology ! Ufo Landing : Ezekiel 1-4;

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #26 on: September 16, 2024, 11:57:51 am »
Hello.
uos audio library can deal now with libxmp.
The example SimplePlayer was updated to play also mod, it, s3m, xm and other module formats.
Have fun!
Fre;D
« Last Edit: September 16, 2024, 01:17:01 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #27 on: September 17, 2024, 05:34:44 pm »
Hello XMP lovers!

Do you know (a) site(s) with nice demos of mod, it, xm, s3m and others that can be downloaded?
There are few demos in fpc package /fpc-src/packages/libndsfpc/examples/ that are nice, but I want more.  ::)

Thanks.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Guva

  • Jr. Member
  • **
  • Posts: 97
Re: Extended Module Player
« Reply #28 on: September 17, 2024, 05:45:54 pm »
Hello XMP lovers!

Do you know (a) site(s) with nice demos of mod, it, xm, s3m and others that can be downloaded?
There are few demos in fpc package /fpc-src/packages/libndsfpc/examples/ that are nice, but I want more.  ::)

Thanks.

https://modarchive.org/

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #29 on: September 17, 2024, 05:48:17 pm »
Hello XMP lovers!

Do you know (a) site(s) with nice demos of mod, it, xm, s3m and others that can be downloaded?
There are few demos in fpc package /fpc-src/packages/libndsfpc/examples/ that are nice, but I want more.  ::)

Thanks.

https://modarchive.org/

Perfect, many thanks.  ;D
Huh, with one must I absolutely try?
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018