* * *

Recent Posts

Pages: [1] 2 3 ... 10
Operating Systems / Re: Pi 3 with Radio Transmitter
« Last post by Thaddy on Today at 10:34:44 am »
I have to research it a bit but aside: did you know you can use the pi3 out of the box as an FM radio transmitter with just a small 20 cm antenna on gpio 4?
Works like a charm and the code can be easily translated to FreePascal.
Yes, you are right. It's a single thread doing the work.
But it only steps through a list of 3 blocks, which remain unfreed, and calls call_stack for each block.
I tried to put in some extra debug info but i can't use SysUtils in heaptrc.pp, so no time stamps.
Linux / Re: Installing Lazarus Packages System-wide
« Last post by JuhaManninen on Today at 09:45:55 am »
You must study the sources about PrimaryConfigPath and SecondaryConfigPath etc.
I guess it should be improved. Maybe you can figure out what goes on there.
If i end Lazarus with for example 3 unfreed blocks it takes more than 30 s for the following output:
Have you looked at the CPU usage in your machine during those 30 seconds ?  I suspect that during those 30 seconds there is one core at 100%.  If you have 8 cores, that means that one core will be at 12.5% and the system slightly above that depending on what else your machine is busy doing.

I haven't looked at the code that tracks and reconciles heap usage but, even without doing that, it's very likely that the code is single threaded.  In addition to that, you can see that the number of blocks that have been allocated and freed is a fair number, IOW, there is a fair amount of work to match and reconcile allocations and releases.  In addition to that, the system also has to assemble the call sequence that lead to the unallocated blocks, depending on the implementation, that can take some time too.

Leledumbo is right, whenever you need to figure out why a program or routine is taking more time than you like/expect, it's time to use a profiler.  That's the only safe way of determining the reason for the time spent.

My smell guess is that the time reflects mostly the fact that the reconciliation is single threaded and the fairly large number of memory blocks there are to track.  A profiler is the right way of figuring out the exact reason and the details related to it.


Operating Systems / Pi 3 with Radio Transmitter
« Last post by jdredd on Today at 08:15:55 am »
Wanting to use a FS1000A radio transmitter with a pi3 b+ running latest raspbian.

Lazarus/FPC installed and working.

Ive only really been able in the past to turn on and off LED's using the Pi and Lazarus.

I can get this to work with python examples, but i'd rather use Lazarus/FPC if i can , but can't find anything searching the google box.
Output is redirected to file on SSD:
Code: Pascal  [Select]
  1. program Lazarus;
  2. ...
  3. begin
  4.   {$If Declared(UseHeapTrace)}
  5.   DeleteFile('lazarus-heaptrace.log');
  6.   SetHeapTraceOutput('lazarus-heaptrace.log');
  7.   // don't show empty heaptrc output
  8.   GlobalSkipIfNoLeaks := True;
  9.   {$endif}

If i end Lazarus with for example 3 unfreed blocks it takes more than 30 s for the following output:
Code: Text  [Select]
  1. C:\freepascal\laz\lazarus.exe --no-splash-screen --started-by-startlazarus --primary-config-path=C:\freepascal\Config\i386 --force-new-instance
  2. Heap dump by heaptrc unit of C:\freepascal\laz\lazarus.exe
  3. 3740085 memory blocks allocated : 522969118/532855656
  4. 3740082 memory blocks freed     : 522969046/532855584
  5. 3 unfreed memory blocks : 72
  6. True heap size : 1540096 (256 used in System startup)
  7. True free heap : 1539456
  8. Should be : 1539480
  9. Call trace for block $266AA0D0 size 24
  10.   $00415CF6
  11.   $00411D68
  12.   $0055DC94  CREATE,  line 5364 of lresources.pp
  13.   $00F5BDB2  PARSESOURCES,  line 324 of LazProfilerAddon.pas
  14.   $00F5DE17  PROJECTBUILDING,  line 742 of LazProfilerAddon.pas
  15.   $0080E74D  DOCALLMODALFUNCTIONHANDLER,  line 673 of lazideintf.pas
  16.   $0047299D  DOBUILDPROJECT,  line 6713 of main.pp
  17.   $00474A15  DORUNPROJECTWITHOUTDEBUG,  line 7194 of main.pp
  18.   $00F5E8D9  START,  line 886 of LazProfilerAddon.pas
  19.   $0080A215  MENUITEMCLICK,  line 549 of menuintf.pas
  20.   $0080D475  MENUITEMCLICK,  line 1710 of menuintf.pas
  21.   $005F4624  CLICK,  line 83 of include/menuitem.inc
  22.   $005F4EA5  DOCLICKED,  line 293 of include/menuitem.inc
  23.   $00412275
  24.   $00593DE8  DOWINDOWPROC,  line 2081 of win32/win32callback.inc
  25.   $00595579  WINDOWPROC,  line 2699 of win32/win32callback.inc
  26. Call trace for block $1EA4DA28 size 24
  27.   $00415CF6
  28.   $00411D68
  29.   $0055DC94  CREATE,  line 5364 of lresources.pp
  30.   $00F5BD48  PARSESOURCES,  line 318 of LazProfilerAddon.pas
  31.   $00F5DE17  PROJECTBUILDING,  line 742 of LazProfilerAddon.pas
  32.   $0080E74D  DOCALLMODALFUNCTIONHANDLER,  line 673 of lazideintf.pas
  33.   $0047299D  DOBUILDPROJECT,  line 6713 of main.pp
  34.   $00474A15  DORUNPROJECTWITHOUTDEBUG,  line 7194 of main.pp
  35.   $00F5E8D9  START,  line 886 of LazProfilerAddon.pas
  36.   $0080A215  MENUITEMCLICK,  line 549 of menuintf.pas
  37.   $0080D475  MENUITEMCLICK,  line 1710 of menuintf.pas
  38.   $005F4624  CLICK,  line 83 of include/menuitem.inc
  39.   $005F4EA5  DOCLICKED,  line 293 of include/menuitem.inc
  40.   $00412275
  41.   $00593DE8  DOWINDOWPROC,  line 2081 of win32/win32callback.inc
  42.   $00595579  WINDOWPROC,  line 2699 of win32/win32callback.inc
  43. Call trace for block $1EA4F428 size 24
  44.   $00415CF6
  45.   $00411D68
  46.   $0055DC94  CREATE,  line 5364 of lresources.pp
  47.   $00F5BCDE  PARSESOURCES,  line 312 of LazProfilerAddon.pas
  48.   $00F5DE17  PROJECTBUILDING,  line 742 of LazProfilerAddon.pas
  49.   $0080E74D  DOCALLMODALFUNCTIONHANDLER,  line 673 of lazideintf.pas
  50.   $0047299D  DOBUILDPROJECT,  line 6713 of main.pp
  51.   $00474A15  DORUNPROJECTWITHOUTDEBUG,  line 7194 of main.pp
  52.   $00F5E8D9  START,  line 886 of LazProfilerAddon.pas
  53.   $0080A215  MENUITEMCLICK,  line 549 of menuintf.pas
  54.   $0080D475  MENUITEMCLICK,  line 1710 of menuintf.pas
  55.   $005F4624  CLICK,  line 83 of include/menuitem.inc
  56.   $005F4EA5  DOCLICKED,  line 293 of include/menuitem.inc
  57.   $00412275
  58.   $00593DE8  DOWINDOWPROC,  line 2081 of win32/win32callback.inc
  59.   $00595579  WINDOWPROC,  line 2699 of win32/win32callback.inc

So storage shouldn't be a problem here.

Which influence has the type of debuginformation?
General / Re: Lazarus IDE sees my code changes but fpc dont.
« Last post by DonAlfredo on Today at 05:44:44 am »
Normally, if you make changes into the FPC sources, you need to rebuild FPC itself.
Fpcupdeluxe makes this easy.

In setup+, just check the "rebuild only" checkbox.
And click the FPC button in the main screen.
Fpcupdeluxe will rebuild FPC without updating the sources !
Pas2JS / Re: Not able to compile simple program using pas2js
« Last post by jiutianfei on Today at 05:43:27 am »
My ~/.pas2js.cfg contains this line:


That directory looks like this:

browserconsole.pas   libjquery.pas   README.txt     sysutils.pas
classes.pas        math.pas        rtlconsts.pas  types.pas
contnrs.pas        nodejs.pas      rtti.pas       typinfo.pas
dateutils.pas        objpas.pas      strutils.pas   webgl.pas
hotreloadclient.pas  pas2js_rtl.lpk  system.js       web.pas
js.pas           pas2js_rtl.pas  system.pas     webrouter.pp
Linux / $LINKLIB ssl and $LINKLIB crypto
« Last post by ozznixon on Today at 01:33:40 am »
Can someone refresh my memory - if I put $LINKLIB in my code, I am linking the .a into my binary - so I should not worry about dependency on another Linux box, right?

I dev on Fedora, thus have a newer OPENSSL than my production server (1.0.2m versus 1.0.1p) ... so I thought I would recompile 1.0.2m to have the .a files - link it into my binary and get around it... if it is supposed to work that way, I missed something - as the production server reports /usr/lib64/libssl.10 version_1.0.2 expected (loosely).

Project compiles w/o issue on Fedora with or without $LINKLIB. Which brings up the question, when it is linking it into my binary, what obj/dump command shows dependencies?

Thanks (been 4 years since I had to recompile this project - notes are vague).
General / Re: Lazarus IDE sees my code changes but fpc dont.
« Last post by cpicanco on Today at 12:54:59 am »
Humm... I think I am doing something really wrong:

$~/lazarus/stable/fpcsrc/packages/libvlc$ make
./fpmake compile --localunitdir=../.. --globalunitdir=.. --os=linux --cpu=x86_64 -o -Cg -o -dx86_64 --compiler=~/lazarus/stable/fpc/bin/x86_64-linux/ppcx64 -bu
The installer encountered the following error:
Could not find unit directory for dependency package "rtl"
Makefile:2362: recipe for target 'all' failed
make: *** [all] Error 1

Things I have tried:

1) adding export FPCDIR=~/lazarus/stable/fpc/lib/fpc/3.0.4 to my .bashrc

2) linking fpc.sh to /usr/local/lib and including fpcupdeluxe fpc.cfg in my $HOME/.fpc.cfg (as mentioned here https://github.com/castle-engine/castle-engine/wiki/fpcupdeluxe)

Please guys, I need some light to compile this code.

Pages: [1] 2 3 ... 10


Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus