From bo.berglund at gmail.com Wed Nov 15 17:08:39 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 Nov 2023 17:08:39 +0100 Subject: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions? Message-ID: I have now installed the 64 bit version of PiOS on an RPi4B device. If I install Lazarus/FPC on that can it create applications both for 32 and 64 bit RPi operating systems? Or do I have to install two versions of Lazarus and/or FPC to be able to do that? It would be nice to have only one Lazarus but both 64 and 32 bit FPC compilers and be able to select for which I want to build the application inside Lazarus itself. -- Bo Berglund Developer in Sweden From support at uvviewsoft.com Wed Nov 15 17:52:51 2023 From: support at uvviewsoft.com (Alexey Torgashin) Date: Wed, 15 Nov 2023 19:52:51 +0300 Subject: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions? In-Reply-To: References: Message-ID: <55cf9561619781e69cd1283d434273d1@uvviewsoft.com> fpcUpDeluxe allows to install additional FPC folder. with 'crosses' - for ex, I have additional FPC on Linux with crosses for Windows, Linux ARM, *BSD x32+x64, macOS x64+ARM. In the IDE you can specify that new FPC installation. Using IDE 'build modes' you can make N new modes, one mode pear each CPU/OS case. Alex From bo.berglund at gmail.com Wed Nov 15 17:59:39 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 Nov 2023 17:59:39 +0100 Subject: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions? References: <55cf9561619781e69cd1283d434273d1@uvviewsoft.com> Message-ID: <75u9li1bbnkmdifipqfuqb5m3tkpqgkt1f@4ax.com> On Wed, 15 Nov 2023 19:52:51 +0300, Alexey Torgashin via lazarus wrote: >fpcUpDeluxe allows to install additional FPC folder. with 'crosses' - >for ex, I have additional FPC on Linux with crosses for Windows, Linux >ARM, *BSD x32+x64, macOS x64+ARM. In the IDE you can specify that new >FPC installation. Using IDE 'build modes' you can make N new modes, one >mode pear each CPU/OS case. >Alex OK thanks, then I have to use fpcupdeluxe to install Lazarus + FPC then. I will try that as a first on the new RPi4 then. -- Bo Berglund Developer in Sweden From support at uvviewsoft.com Wed Nov 15 18:25:58 2023 From: support at uvviewsoft.com (Alexey Torgashin) Date: Wed, 15 Nov 2023 20:25:58 +0300 Subject: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions? In-Reply-To: <75u9li1bbnkmdifipqfuqb5m3tkpqgkt1f@4ax.com> References: <55cf9561619781e69cd1283d434273d1@uvviewsoft.com> <75u9li1bbnkmdifipqfuqb5m3tkpqgkt1f@4ax.com> Message-ID: > then I have to use fpcupdeluxe to install Lazarus + FPC then. Lazarus can be old. Only FPC need to be installed from Deluxe. Old Lazarus - in it, specify path for new FPC. Alex From bo.berglund at gmail.com Wed Nov 15 21:53:11 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 Nov 2023 21:53:11 +0100 Subject: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions? References: <55cf9561619781e69cd1283d434273d1@uvviewsoft.com> <75u9li1bbnkmdifipqfuqb5m3tkpqgkt1f@4ax.com> Message-ID: On Wed, 15 Nov 2023 20:25:58 +0300, Alexey Torgashin via lazarus wrote: >> then I have to use fpcupdeluxe to install Lazarus + FPC then. > >Lazarus can be old. Only FPC need to be installed from Deluxe. Old >Lazarus - in it, specify path for new FPC. >Alex I asked on the Lazarus forum as well, my first post is here: https://forum.lazarus.freepascal.org/index.php/topic,34645.msg496844.html#msg496844 It seems like the fpcupdeluxe available for armhf on GitHub does not run in PiOS 64 bit. It is a 32 bit application... NOTICE! I was alerted to using the wrong version of fpcupdeluxe, it should be the aarch64-linux version!!! With this version downloaded it tstarts running OK and I can configure and start building. But it fails after about 10 minutes complaining about this: make[1]: *** [Makefile:2682: packages_smart] Error 2 make: *** [Makefile:2837: build-stamp.aarch64-linux] Error 2 fpmake.pp(60) Error: Error while linking fpmake.pp(60) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted fpcupdeluxe: ERROR: FPC Native Installer (BuildModule: FPC): Error running /usr/bin/make for FPC failed with exit code 512 . Details: . ERROR: Fpcupdeluxe fatal error ! Sequencer (FPC): Failure running fpcupdeluxe: error executing sequence FPC Sequencer (Default): Failure running fpcupdeluxe: error executing sequence Default I refer the discussion over to the Lazarus forum (see link above). -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed Nov 15 23:04:03 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 Nov 2023 23:04:03 +0100 Subject: [Lazarus] Lazartus on RaspberryPi 64 bit - build for all RPi versions? References: <55cf9561619781e69cd1283d434273d1@uvviewsoft.com> <75u9li1bbnkmdifipqfuqb5m3tkpqgkt1f@4ax.com> Message-ID: On Wed, 15 Nov 2023 21:53:11 +0100, Bo Berglund via lazarus wrote: >I refer the discussion over to the Lazarus forum (see link above). Just a quick follow-up here: It seems like the fpc sources have not been updated with the solution to the bug discussed here: https://gitlab.com/freepascal.org/fpc/source/-/issues/39295 THis causes the build of Lazarus using fpcupdeluxe with the latest fpc 3.2.2 to fail because of a problem with __libc_csu_init during linking. Apparently it is fixed in non-released sources of fpc which we are waiting for... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Nov 16 13:30:25 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 16 Nov 2023 13:30:25 +0100 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? Message-ID: I have installed Lazarus on a Raspberry Pi4B running bookworm 64 bit operating system. I first tried to use fpcupdeluxe to do it but it fails miesrably with a linker error when building fpc. So then I decided to try the following: 1) Use apt install fpc to getb the latest 3.2.2 compiler installed. 2) Retrieve the Lazarus 2.2.6 sources from GitLab 3) Then run the make clean && make bigide inside the Lazarus source dir 4) Finally create the $HOME/.local/share/applications/lazarus_2.2.6.desktop launcher file This succeeded and after I had created the desktop file for Lazarus in step 4 it appeared in the RPi4 main menu under Programming. But when I started it it complains about not finding fppkg.cfg and sure enough there is no such file to be found, at least not in the locations I have seen before. So apparently it has not been created or is in some obscure loication not known by me. My Lazarus resides in $HOME/devtools/lazarus/2.2.6 and fpc has been placed in /usr/bin/fpc. But I cannot find a file named fppkgh.cfg whereever I look... What to do now? Lazarus runs and I can add IDE packages and rebuild Lazarus just fine but whenever it starts up it shows the dialog requesting the location of fppkg.cfg... -- Bo Berglund Developer in Sweden From aurimenes at gmail.com Thu Nov 16 13:59:51 2023 From: aurimenes at gmail.com (Aurimenes Silva) Date: Thu, 16 Nov 2023 09:59:51 -0300 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? In-Reply-To: References: Message-ID: I wonder, isn't this somehow related to writing permissions on your system? I can't help much because I use Windows here, but that's the content of my fppkg.cfg file (located in fpcsrc\utils\fpcmkcfg): [Defaults] ConfigVersion=4 LocalRepository=%LocalRepository% BuildDir={LocalRepository}build/ ArchivesDir={LocalRepository}archives/ CompilerConfigDir=%CompilerConfigDir% RemoteMirrors=https://www.freepascal.org/repository/mirrors.xml RemoteRepository=auto CompilerConfig=default FPMakeCompilerConfig=default Downloader=FPC I installed it using the standard Windows installer. Em 16/11/2023 09:30, Bo Berglund via lazarus escreveu: > I have installed Lazarus on a Raspberry Pi4B running bookworm 64 bit operating > system. > I first tried to use fpcupdeluxe to do it but it fails miesrably with a linker > error when building fpc. > So then I decided to try the following: > 1) Use apt install fpc to getb the latest 3.2.2 compiler installed. > 2) Retrieve the Lazarus 2.2.6 sources from GitLab > 3) Then run the make clean && make bigide inside the Lazarus source dir > 4) Finally create the $HOME/.local/share/applications/lazarus_2.2.6.desktop > launcher file > > This succeeded and after I had created the desktop file for Lazarus in step 4 it > appeared in the RPi4 main menu under Programming. > > But when I started it it complains about not finding fppkg.cfg and sure enough > there is no such file to be found, at least not in the locations I have seen > before. > > So apparently it has not been created or is in some obscure loication not known > by me. > > My Lazarus resides in $HOME/devtools/lazarus/2.2.6 and fpc has been placed in > /usr/bin/fpc. > > But I cannot find a file named fppkgh.cfg whereever I look... > > What to do now? > > Lazarus runs and I can add IDE packages and rebuild Lazarus just fine but > whenever it starts up it shows the dialog requesting the location of > fppkg.cfg... > > -- O software antiv?rus Avast realizou uma checagem de v?rus neste e-mail. www.avast.com From jmlandmesser at gmx.de Thu Nov 16 14:27:27 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Thu, 16 Nov 2023 14:27:27 +0100 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? In-Reply-To: References: Message-ID: <924ebc03-981c-4641-a90d-fbc138055ac3@gmx.de> Am 16.11.23 um 13:30 schrieb Bo Berglund via lazarus: > I have installed Lazarus on a Raspberry Pi4B running bookworm 64 bit operating > system. > I first tried to use fpcupdeluxe to do it but it fails miesrably with a linker > error when building fpc. > So then I decided to try the following: > 1) Use apt install fpc to getb the latest 3.2.2 compiler installed. > 2) Retrieve the Lazarus 2.2.6 sources from GitLab > 3) Then run the make clean && make bigide inside the Lazarus source dir > 4) Finally create the $HOME/.local/share/applications/lazarus_2.2.6.desktop > launcher file > > This succeeded and after I had created the desktop file for Lazarus in step 4 it > appeared in the RPi4 main menu under Programming. > > But when I started it it complains about not finding fppkg.cfg and sure enough > there is no such file to be found, at least not in the locations I have seen > before. > > So apparently it has not been created or is in some obscure loication not known > by me. > > My Lazarus resides in $HOME/devtools/lazarus/2.2.6 and fpc has been placed in > /usr/bin/fpc. > > But I cannot find a file named fppkgh.cfg whereever I look... > > What to do now? > > Lazarus runs and I can add IDE packages and rebuild Lazarus just fine but > whenever it starts up it shows the dialog requesting the location of > fppkg.cfg... > > On my Manjaro linux the file in question are located in two places: [john1 at manjaro lazarus]$ locate -i? fppkg.cfg */etc/fppkg.cfg* *... with this contrent* ** > *[Defaults] > ConfigVersion=5 > LocalRepository={UserDir}.fppkg/ > BuildDir={LocalRepository}build/ > ArchivesDir={LocalRepository}archives/ > CompilerConfigDir=/etc/fppkg > RemoteMirrors=https://www.freepascal.org/repository/mirrors.xml > RemoteRepository=auto > CompilerConfig=default > FPMakeCompilerConfig=default > Downloader=FPC > InstallRepository=user > > [Repository] > Name=fpc > Description=Packages which are installed along with the Free Pascal > Compiler > Path=/usr/lib/fpc/{CompilerVersion}/ > Prefix=/usr/lib/fpc/../../ > > [IncludeFiles] > FileMask=/etc/fppkgconf.d/*.conf > > [Repository] > Name=user > Description=User-installed packages > Path={LocalRepository}lib/fpc/{CompilerVersion} > Prefix={LocalRepository} > * * * */usr/lib/fpc/src/utils/fpcmkcfg/fppkg.cfg* Perhaps this command tells you more? [john1 at manjaro lazarus]$*./lazarus --setup* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu Nov 16 16:16:13 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 16 Nov 2023 16:16:13 +0100 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? References: <924ebc03-981c-4641-a90d-fbc138055ac3@gmx.de> Message-ID: On Thu, 16 Nov 2023 14:27:27 +0100, John Landmesser via lazarus wrote: >Am 16.11.23 um 13:30 schrieb Bo Berglund via lazarus: >> I have installed Lazarus on a Raspberry Pi4B running bookworm 64 bit operating >> system. >> I first tried to use fpcupdeluxe to do it but it fails miesrably with a linker >> error when building fpc. >> So then I decided to try the following: >> 1) Use apt install fpc to getb the latest 3.2.2 compiler installed. >> 2) Retrieve the Lazarus 2.2.6 sources from GitLab >> 3) Then run the make clean && make bigide inside the Lazarus source dir >> 4) Finally create the $HOME/.local/share/applications/lazarus_2.2.6.desktop >> launcher file >> >> This succeeded and after I had created the desktop file for Lazarus in step 4 it >> appeared in the RPi4 main menu under Programming. >> >> But when I started it it complains about not finding fppkg.cfg and sure enough >> there is no such file to be found, at least not in the locations I have seen >> before. >> >> So apparently it has not been created or is in some obscure loication not known >> by me. >> >> My Lazarus resides in $HOME/devtools/lazarus/2.2.6 and fpc has been placed in >> /usr/bin/fpc. >> >> But I cannot find a file named fppkgh.cfg whereever I look... >> >> What to do now? >> >> Lazarus runs and I can add IDE packages and rebuild Lazarus just fine but >> whenever it starts up it shows the dialog requesting the location of >> fppkg.cfg... >> >> > > >On my Manjaro linux the file in question are located in two places: > >[john1 at manjaro lazarus]$ locate -i? fppkg.cfg >*/etc/fppkg.cfg* > >*... with this contrent* > >** > >> *[Defaults] >> ConfigVersion=5 >> LocalRepository={UserDir}.fppkg/ >> BuildDir={LocalRepository}build/ >> ArchivesDir={LocalRepository}archives/ >> CompilerConfigDir=/etc/fppkg >> RemoteMirrors=https://www.freepascal.org/repository/mirrors.xml >> RemoteRepository=auto >> CompilerConfig=default >> FPMakeCompilerConfig=default >> Downloader=FPC >> InstallRepository=user >> >> [Repository] >> Name=fpc >> Description=Packages which are installed along with the Free Pascal >> Compiler >> Path=/usr/lib/fpc/{CompilerVersion}/ >> Prefix=/usr/lib/fpc/../../ >> >> [IncludeFiles] >> FileMask=/etc/fppkgconf.d/*.conf >> >> [Repository] >> Name=user >> Description=User-installed packages >> Path={LocalRepository}lib/fpc/{CompilerVersion} >> Prefix={LocalRepository} >> * >* >* > >*/usr/lib/fpc/src/utils/fpcmkcfg/fppkg.cfg* None of these locations exist on my device. However, Lazarus works (built from sources) as does fpc (installed via apt) The only problem ius that I get this annoying pop-up every time I start Lazarus... > >Perhaps this command tells you more? > >[john1 at manjaro lazarus]$*./lazarus --setup* What is that supposed to do? I don't want to run an unknown command after spending so much time finally getting Lazarus working... NOTE: ffpkg seems not to be a recognized command... And the file I found here is also not accepted: https://forum.lazarus.freepascal.org/index.php/topic,60994.msg457678.html#msg457678 -- Bo Berglund Developer in Sweden From werner.pamler at freenet.de Thu Nov 16 16:49:25 2023 From: werner.pamler at freenet.de (Werner Pamler) Date: Thu, 16 Nov 2023 16:49:25 +0100 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? In-Reply-To: References: Message-ID: <750dacaf-3e15-4eba-85aa-caea4d88b017@freenet.de> Am 16.11.2023 um 13:30 schrieb Bo Berglund via lazarus: > 2) Retrieve the Lazarus 2.2.6 sources from GitLab IIRC, the fppkg check has been by-passed by Laz 3.0. So, please try to install the RC2 of v3, or a wait a short time until the final version will be released. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu Nov 16 18:49:46 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 16 Nov 2023 18:49:46 +0100 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? References: <750dacaf-3e15-4eba-85aa-caea4d88b017@freenet.de> Message-ID: <0hlclita0k4n89agtf0mbms2sius7vtvmb@4ax.com> On Thu, 16 Nov 2023 16:49:25 +0100, Werner Pamler via lazarus wrote: >Am 16.11.2023 um 13:30 schrieb Bo Berglund via lazarus: >> 2) Retrieve the Lazarus 2.2.6 sources from GitLab >IIRC, the fppkg check has been by-passed by Laz 3.0. So, please try to >install the RC2 of v3, or a wait a short time until the final version >will be released. OK, will wait then. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Fri Nov 17 00:28:54 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 17 Nov 2023 00:28:54 +0100 Subject: [Lazarus] How to generate the fppkg.cnf file which Lazarus complains about when starting? References: <750dacaf-3e15-4eba-85aa-caea4d88b017@freenet.de> <0hlclita0k4n89agtf0mbms2sius7vtvmb@4ax.com> Message-ID: <7a9dlit62ilpcagc36t5uk97vtmql3vm3e@4ax.com> On Thu, 16 Nov 2023 18:49:46 +0100, Bo Berglund via lazarus wrote: >On Thu, 16 Nov 2023 16:49:25 +0100, Werner Pamler via lazarus > wrote: > >>Am 16.11.2023 um 13:30 schrieb Bo Berglund via lazarus: >>> 2) Retrieve the Lazarus 2.2.6 sources from GitLab >>IIRC, the fppkg check has been by-passed by Laz 3.0. So, please try to >>install the RC2 of v3, or a wait a short time until the final version >>will be released. > >OK, will wait then. > Or rather, I downloaded the 3.0.RC2 sources and built another Lazarus on the RPi4. This was different, no longer the ask for the fppkg.cnf file! So I guess I can let that issue rest for now. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sun Nov 19 14:50:34 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 19 Nov 2023 14:50:34 +0100 Subject: [Lazarus] LclVLC usage questions for switching from PasLibVLC Message-ID: I created a video editing tool back in 2018 or so in order to help pinpointing cut points for editing mp4 videos. At the time I did not find anything useful other than PasLibVLC, which I have been using since then on Windows. It works OK for what I need but I have to install the custom package into the IDE every time I make a new Lazarus installation. Until now I have only been on Windows with this application. A few days ago I wanted to build the application on a Linux system, but even though it compiled after I removed some Windows-only experimental functions it did not actually display the video, nothing at all shows up.... So I have been looking around for a solution and yesterday I found what is right under my nose: Lazarus contains LibVLC as a standard package available to be installed in the GUI using Package/Install-remove packages! No download needed from external sources! Really very neat and simple to get going and to rely upon going forward! Anyway, I have been experimenting with the example inside the package code and also read Michael's document "Displaying video files using Free Pascal and Lazarus". I think I can switch out PasLibVLC and replace it with the LclVLC player instead but I need some help in implementation. There are some functions I would like to get hints on how to implement: 1) Progressbar update --------------------- It is decribed how to make a progressbar show the current position of the video playback. That is event driven AFAICT. And it is shown in the doc... However, I don't understand what is going on in the pdf doc regarding getting the actual position shown by the position of the progressbar. I have tried to get the info from the player like this, but it won't work at all, it looks like the DoPositionChanged() event code does not get called.. This is what I have done: procedure TfrmMainVlc.FormCreate(Sender: TObject); begin FPlayer:=TLCLVLCPlayer.Create(Self); FPlayer.ParentWindow:=PVideo; FPlayer.OnPositionChanged:=@DoPositionChanged; //Set event handler FVideoFile := ReadIniString('Files', 'LastVideo', ''); //Get last video name FEVideo.FileName := FVideoFile; tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); //Get last volume end; procedure TfrmMainVlc.DoPositionChanged(Sender: TObject; const APos: Double); var nCurrPos: int64; begin //Just print the position to screen as first test nCurrPos := Round(APos); //Position in ms stxPos.Caption := IntToStr(nCurrPos); //Show position in StaticText box end; Nothing at all happens when I play the video, the event function is not called. 2) Reposition video via progressbar ----------------------------------- I also need the reverse, i.e. when I click the progressbar I want the video to be repositioned to the place I clicked. And this I have solved using this piece of code (note: I have set the progressbar max value to 1000 to get better resolution: //Mouse up on progressbar should reposition the video to the clicked pos procedure TfrmMainVlc.pgbVideoposMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var VidPos, Duration: int64; begin Duration := FPlayer.VideoLength div 1000; VidPos := Round(X / pgbVideopos.Width * pgbVideopos.Max * Duration / 1000); FPlayer.VideoPosition := Round(VidPos * 1000); end; 3) Increase/decrease playback speed? ------------------------------------ Is it possible to adjust the playback speed (I can do this with PasLibVLC)? Then how can it be done, say to enter a percentage between 50 and 200 in a box and then tell the player to use that setting. 4) Lipsync adjust ----------------- Is it possible to shift the audio forward/backward relative to the image in order to adjust lip sync? I can do this with PasLibVLC, but how can it be done here? Grateful for any suggestions on how to get this to work! -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sun Nov 19 14:56:27 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 19 Nov 2023 14:56:27 +0100 Subject: [Lazarus] LclVLC usage questions for switching from PasLibVLC References: Message-ID: On Sun, 19 Nov 2023 14:50:34 +0100, Bo Berglund via lazarus wrote: >procedure TfrmMainVlc.FormCreate(Sender: TObject); >begin > FPlayer:=TLCLVLCPlayer.Create(Self); > FPlayer.ParentWindow:=PVideo; > FPlayer.OnPositionChanged:=@DoPositionChanged; //Set event handler > FVideoFile := ReadIniString('Files', 'LastVideo', ''); //Get last video name > FEVideo.FileName := FVideoFile; > tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); //Get last volume >end; Sorry, in actual fact I have this in the FormCreate: procedure TfrmMainVlc.FormCreate(Sender: TObject); begin FPlayer:=TLCLVLCPlayer.Create(Self); FPlayer.ParentWindow:=PVideo; FPlayer.OnPositionChanged:=@DoPositionChanged; FVideoFile := ReadIniString('Files', 'LastVideo', ''); FEVideo.FileName := FVideoFile; tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); FPlayer.UseEvents:=True; // Enable events end; The last line was added *after* I copied the function to the list message.... -- Bo Berglund Developer in Sweden From michael at freepascal.org Sun Nov 19 17:07:01 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Nov 2023 17:07:01 +0100 (CET) Subject: [Lazarus] Building lazarus broken ? Message-ID: Hi, I did some changes to the fpcunit support. All worked in the IDE. In order to push my changes, I did a git pull. The change broke the "make bigide" command, so I was told by the CI/CD. Turns out the makefiles did not respect the lazarus dependencies in the packages: the new dependency on the codetools package was not taken into account by the makefiles. (how an uninitiated heathen like me is supposed to know this is probably only known to the happy initiated... ;)) I managed to fix that, fix is pushed so 'make bigide' works again. However, the git pull destroyed building the IDE in the IDE. For some reason, the IDE (I'm on linux mint) thinks it needs to build a cocoa version of the LCL. This is the lcl.pas as generated by the build procedure: uses AllLCLIntfUnits, CocoaConfig, CocoaCursor, CocoaMenus, LazarusPackageIntf; In the build settings, I did specify gtk2,linux,x86_64 as the platform settings. So why does the IDE insist on recreating a cocoa version of lcl.pas ? Michael. From michael at freepascal.org Sun Nov 19 17:21:09 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Nov 2023 17:21:09 +0100 (CET) Subject: [Lazarus] Building lazarus broken ? In-Reply-To: References: Message-ID: <3a14fb0-cd8d-27c2-1f60-3b11407f1e8@freepascal.org> On Sun, 19 Nov 2023, Michael Van Canneyt via lazarus wrote: > > Hi, > > I did some changes to the fpcunit support. All worked in the IDE. > > In order to push my changes, I did a git pull. > > The change broke the "make bigide" command, so I was told by the CI/CD. > > Turns out the makefiles did not respect the lazarus dependencies in the > packages: the new dependency on the codetools package was not taken into > account by the makefiles. (how an uninitiated heathen like me is supposed to > know this is probably only known to the happy initiated... ;)) > > I managed to fix that, fix is pushed so 'make bigide' works again. > > However, the git pull destroyed building the IDE in the IDE. > For some reason, the IDE (I'm on linux mint) thinks it needs to build a > cocoa version of the LCL. > > This is the lcl.pas as generated by the build procedure: > > uses > AllLCLIntfUnits, CocoaConfig, CocoaCursor, CocoaMenus, LazarusPackageIntf; > > In the build settings, I did specify gtk2,linux,x86_64 as the platform > settings. > > So why does the IDE insist on recreating a cocoa version of lcl.pas ? Well, as usual I found the answer myself after asking the question :/ This is the culprit: --- commit f821ad251b945f3435303f208b2e7de045749424 Author: rich2014 Date: Sun Nov 19 18:36:11 2023 +0800 Lcl: udpate lcl lpk and cocoa unit files --- I undid that commit: Clearly, the LCL package should not use any platform/wigetset specific units. Maybe time to introduce 'conditional inclusion' of units at least for the widgetset/platform ? Michael. From ganmax at narod.ru Sun Nov 19 17:42:26 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Sun, 19 Nov 2023 19:42:26 +0300 Subject: [Lazarus] Building lazarus broken ? In-Reply-To: <3a14fb0-cd8d-27c2-1f60-3b11407f1e8@freepascal.org> References: <3a14fb0-cd8d-27c2-1f60-3b11407f1e8@freepascal.org> Message-ID: <83f68eea-d182-48da-960a-154b58d4d7be@narod.ru> 19.11.2023 19:21, Michael Van Canneyt via lazarus ?????: > > > On Sun, 19 Nov 2023, Michael Van Canneyt via lazarus wrote: > >> >> Hi, >> >> I did some changes to the fpcunit support. All worked in the IDE. >> >> In order to push my changes, I did a git pull. >> >> The change broke the "make bigide" command, so I was told by the CI/CD. >> >> Turns out the makefiles did not respect the lazarus dependencies in the >> packages: the new dependency on the codetools package was not taken into >> account by the makefiles. (how an uninitiated heathen like me is >> supposed to >> know this is probably only known to the happy initiated... ;)) >> >> I managed to fix that, fix is pushed so 'make bigide' works again. >> >> However, the git pull destroyed building the IDE in the IDE. >> For some reason, the IDE (I'm on linux mint) thinks it needs to build a >> cocoa version of the LCL. >> >> This is the lcl.pas as generated by the build procedure: >> >> uses >> ?AllLCLIntfUnits, CocoaConfig, CocoaCursor, CocoaMenus, >> LazarusPackageIntf; >> >> In the build settings, I did specify gtk2,linux,x86_64 as the platform >> settings. >> >> So why does the IDE insist on recreating a cocoa version of lcl.pas ? > > Well, as usual I found the answer myself after asking the question :/ > > This is the culprit: > > --- > commit f821ad251b945f3435303f208b2e7de045749424 > Author: rich2014 > Date:?? Sun Nov 19 18:36:11 2023 +0800 > > ??? Lcl: udpate lcl lpk and cocoa unit files > --- > > I undid that commit: No need to do this. > Clearly, the LCL package should not use any platform/wigetset specific > units. I changed settings for newly added units, they should not be included in lcl.pas just like other ones in LCL interfaces. Also I added link to the package you added. Build works fine now. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From ganmax at narod.ru Sun Nov 19 17:56:38 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Sun, 19 Nov 2023 19:56:38 +0300 Subject: [Lazarus] Building lazarus broken ? In-Reply-To: References: Message-ID: 19.11.2023 19:07, Michael Van Canneyt via lazarus ?????: > > Hi, > > I did some changes to the fpcunit support. All worked in the IDE. > > In order to push my changes, I did a git pull. > > The change broke the "make bigide" command, so I was told by the CI/CD. > > Turns out the makefiles did not respect the lazarus dependencies in the > packages: the new dependency on the codetools package was not taken into > account by the makefiles. (how an uninitiated heathen like me is > supposed to > know this is probably only known to the happy initiated... ;)) > > I managed to fix that, fix is pushed so 'make bigide' works again. Makefiles are updated by updatemakefiles tool: Make sure *Additions and Overrides* are empty and run FPCDIR=/path/to/fpc/src/trunk PATH=/path/trunk/fpc/utils/fpcm/bin/x86_64-linux/:$PATH ./tools/updatemakefiles -- Best regards, Maxim Ganetskymailto:ganmax at narod.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Sun Nov 19 18:00:05 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Nov 2023 18:00:05 +0100 (CET) Subject: [Lazarus] Building lazarus broken ? In-Reply-To: <83f68eea-d182-48da-960a-154b58d4d7be@narod.ru> References: <3a14fb0-cd8d-27c2-1f60-3b11407f1e8@freepascal.org> <83f68eea-d182-48da-960a-154b58d4d7be@narod.ru> Message-ID: <7cec35f9-5bba-d7b1-189e-9beadf86dbc9@freepascal.org> On Sun, 19 Nov 2023, Maxim Ganetsky via lazarus wrote: > 19.11.2023 19:21, Michael Van Canneyt via lazarus ?????: >> >> >> On Sun, 19 Nov 2023, Michael Van Canneyt via lazarus wrote: >> >>> >>> Hi, >>> >>> I did some changes to the fpcunit support. All worked in the IDE. >>> >>> In order to push my changes, I did a git pull. >>> >>> The change broke the "make bigide" command, so I was told by the CI/CD. >>> >>> Turns out the makefiles did not respect the lazarus dependencies in the >>> packages: the new dependency on the codetools package was not taken into >>> account by the makefiles. (how an uninitiated heathen like me is >>> supposed to >>> know this is probably only known to the happy initiated... ;)) >>> >>> I managed to fix that, fix is pushed so 'make bigide' works again. >>> >>> However, the git pull destroyed building the IDE in the IDE. >>> For some reason, the IDE (I'm on linux mint) thinks it needs to build a >>> cocoa version of the LCL. >>> >>> This is the lcl.pas as generated by the build procedure: >>> >>> uses >>> ?AllLCLIntfUnits, CocoaConfig, CocoaCursor, CocoaMenus, >>> LazarusPackageIntf; >>> >>> In the build settings, I did specify gtk2,linux,x86_64 as the platform >>> settings. >>> >>> So why does the IDE insist on recreating a cocoa version of lcl.pas ? >> >> Well, as usual I found the answer myself after asking the question :/ >> >> This is the culprit: >> >> --- >> commit f821ad251b945f3435303f208b2e7de045749424 >> Author: rich2014 >> Date:?? Sun Nov 19 18:36:11 2023 +0800 >> >> ??? Lcl: udpate lcl lpk and cocoa unit files >> --- >> >> I undid that commit: > No need to do this. Well, it broke the build. >> Clearly, the LCL package should not use any platform/wigetset specific >> units. > > I changed settings for newly added units, they should not be included in > lcl.pas just like other ones in LCL interfaces. Also good. Thank you. Still, I think this is the single failure of the lazarus package system that needs to be addressed: The missing ability to include units or requirements for certain widgetsets/platforms. (and similarly in Delphi, obviously) Michael. From michael at freepascal.org Sun Nov 19 22:51:03 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Nov 2023 22:51:03 +0100 (CET) Subject: [Lazarus] Building lazarus broken ? In-Reply-To: References: Message-ID: <7814b45d-de41-128-d1f0-706a8a7e7eca@freepascal.org> On Sun, 19 Nov 2023, Maxim Ganetsky via lazarus wrote: > 19.11.2023 19:07, Michael Van Canneyt via lazarus ?????: >> >> Hi, >> >> I did some changes to the fpcunit support. All worked in the IDE. >> >> In order to push my changes, I did a git pull. >> >> The change broke the "make bigide" command, so I was told by the CI/CD. >> >> Turns out the makefiles did not respect the lazarus dependencies in the >> packages: the new dependency on the codetools package was not taken into >> account by the makefiles. (how an uninitiated heathen like me is supposed >> to >> know this is probably only known to the happy initiated... ;)) >> >> I managed to fix that, fix is pushed so 'make bigide' works again. > > Makefiles are updated by updatemakefiles tool: > > Make sure *Additions and Overrides* are empty and run > > FPCDIR=/path/to/fpc/src/trunk > PATH=/path/trunk/fpc/utils/fpcm/bin/x86_64-linux/:$PATH > ./tools/updatemakefiles Thank you. Maybe this should be documented somewhere ? Michael From ganmax at narod.ru Sun Nov 19 23:48:00 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Mon, 20 Nov 2023 01:48:00 +0300 Subject: [Lazarus] Building lazarus broken ? In-Reply-To: <7814b45d-de41-128-d1f0-706a8a7e7eca@freepascal.org> References: <7814b45d-de41-128-d1f0-706a8a7e7eca@freepascal.org> Message-ID: 20.11.2023 0:51, Michael Van Canneyt via lazarus ?????: > > > On Sun, 19 Nov 2023, Maxim Ganetsky via lazarus wrote: > >> 19.11.2023 19:07, Michael Van Canneyt via lazarus ?????: >>> >>> Hi, >>> >>> I did some changes to the fpcunit support. All worked in the IDE. >>> >>> In order to push my changes, I did a git pull. >>> >>> The change broke the "make bigide" command, so I was told by the CI/CD. >>> >>> Turns out the makefiles did not respect the lazarus dependencies in the >>> packages: the new dependency on the codetools package was not taken into >>> account by the makefiles. (how an uninitiated heathen like me is >>> supposed to >>> know this is probably only known to the happy initiated... ;)) >>> >>> I managed to fix that, fix is pushed so 'make bigide' works again. >> >> Makefiles are updated by updatemakefiles tool: >> >> Make sure *Additions and Overrides* are empty and run >> >> FPCDIR=/path/to/fpc/src/trunk >> PATH=/path/trunk/fpc/utils/fpcm/bin/x86_64-linux/:$PATH >> ./tools/updatemakefiles > > Thank you. > > Maybe this should be documented somewhere ? Actually it was a copy-paste from Lazarus release management page in Wiki: https://wiki.freepascal.org/Lazarus_3.0_fixes_branch#Tagging_release So it is documented. :) But documentation can be improved indeed. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From bo.berglund at gmail.com Mon Nov 20 15:09:34 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 20 Nov 2023 15:09:34 +0100 Subject: [Lazarus] LclVLC usage questions for switching from PasLibVLC References: Message-ID: <47nmli12sqq0b218cf2q3uud3l5ij8qdck@4ax.com> On Sun, 19 Nov 2023 14:50:34 +0100, Bo Berglund via lazarus wrote: >Lazarus contains LibVLC as a standard package available to be installed in the >GUI using Package/Install-remove packages! No download needed from external >sources! >Anyway, I have been experimenting with the example inside the package code and >also read Michael's document "Displaying video files using Free Pascal and >Lazarus". > >I think I can switch out PasLibVLC and replace it with the LclVLC player instead >but I need some help in implementation. > >There are some functions I would like to get hints on how to implement: > >1) Progressbar update >--------------------- THIS IS NOW SOLVED! -------------------- I added a TThread.Create... statement as I found in the document, without really understanding how it can help. Seems to me like creating a thread that immediately exits. What can that do? And I also added an FPlayer.UseEvents statement. This is how it now looks and it does allow the events to fire... procedure TfrmMainVlc.FormCreate(Sender: TObject); begin With TThread.Create(False) do Terminate; //Initialize the treading system?? FPlayer:=TLCLVLCPlayer.Create(Self); FPlayer.ParentWindow:=PVideo; FPlayer.OnPositionChanged:=@DoPositionChanged; FVideoFile := ReadIniString('Files', 'LastVideo', ''); FEVideo.FileName := FVideoFile; FEVideo.InitialDir := ExtractFileDir(FVideoFile); tbVolume.Position := ReadIniInt('Settings', 'Volume', 10); FPlayer.UseEvents:=True; end; The next item is the handling of the progress bar: It now looks like this and works: procedure TfrmMainVlc.DoPositionChanged(Sender: TObject; const APos: Double); var VPos: integer; begin VPos := Round(APos * pgbVideopos.Max); pgbVideopos.Position := VPos; end; > >2) Reposition video via progressbar >----------------------------------- This is also now working as follows: //Mouse up on progressbar should reposition the video to the clicked pos procedure TfrmMainVlc.pgbVideoposMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var VidPos: int64; Duration: int64; begin Duration := FPlayer.VideoLength div 1000; VidPos := Round(X / pgbVideopos.Width * pgbVideopos.Max * Duration); FPlayer.VideoPosition := VidPos; end; However the progressbar does not immediately reposition to the clicked position, instead it takes a second or so while it moves stepwise across. How can I make that instantaneous? >3) Increase/decrease playback speed? >------------------------------------ >Is it possible to adjust the playback speed (I can do this with PasLibVLC)? >Then how can it be done, say to enter a percentage between 50 and 200 in a box >and then tell the player to use that setting. > In the original code using PasLibVLC it is done like this: procedure TfrmMain.btnFFClick(Sender: TObject); begin vlcPlayer.SetPlayRate(speSpeed.Value); end; And here the progressbar position is immediately changed to the target position below the mous pointer. >4) Lipsync adjust >----------------- >Is it possible to shift the audio forward/backward relative to the image in >order to adjust lip sync? I can do this with PasLibVLC, but how can it be done >here? In the original code again it works and is done like shown below where the spinedit speAudio contains a value in milliseconds but the command expects microseconds, hence the multiplication by 1000: //For testing purposes, delay audio by the value from speAudio procedure TfrmMain.btnShiftAudioClick(Sender: TObject); var SyncCmd: string; begin vlcPlayer.SetAudioDelay(speAudio.Value *1000); //Convert to us SyncCmd := FormatAudioSyncCmd(-1 * speAudio.Value, FVideoFile); Clipboard.AsText := SyncCmd; //Ffmpeg command to modify file if needed end; Here I put the SyncCmd on the clipboard so it can be pasted into an SSH command window for ffmpeg to modify the video file itself if needed. This file modification is done after checking the effect inside the video player first, in the player whatever shift is applied is immediately there to check... Items 3 & 4 are still unsolved, how can it be done? Still hoping for suggestions on how to get this to work! -- Bo Berglund Developer in Sweden From pascaldragon at googlemail.com Mon Nov 20 18:27:03 2023 From: pascaldragon at googlemail.com (Sven Barth) Date: Mon, 20 Nov 2023 18:27:03 +0100 Subject: [Lazarus] LclVLC usage questions for switching from PasLibVLC In-Reply-To: <47nmli12sqq0b218cf2q3uud3l5ij8qdck@4ax.com> References: <47nmli12sqq0b218cf2q3uud3l5ij8qdck@4ax.com> Message-ID: Bo Berglund via lazarus schrieb am Mo., 20. Nov. 2023, 15:09: > On Sun, 19 Nov 2023 14:50:34 +0100, Bo Berglund via lazarus > wrote: > > >Lazarus contains LibVLC as a standard package available to be installed > in the > >GUI using Package/Install-remove packages! No download needed from > external > >sources! > > >Anyway, I have been experimenting with the example inside the package > code and > >also read Michael's document "Displaying video files using Free Pascal and > >Lazarus". > > > >I think I can switch out PasLibVLC and replace it with the LclVLC player > instead > >but I need some help in implementation. > > > >There are some functions I would like to get hints on how to implement: > > > >1) Progressbar update > >--------------------- > THIS IS NOW SOLVED! > -------------------- > I added a TThread.Create... statement as I found in the document, without > really > understanding how it can help. Seems to me like creating a thread that > immediately exits. What can that do? > It ensures that the RTL is multi threading aware, cause as long as no Pascal thread is started (which is the case for many programs) some shortcuts are taken by not using locks and such. However if you use an external library that starts non-Pascal threads that then call into the Pascal code things might go wrong due to this. Thus creating an empty thread will ensure that all locks are properly in place. Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Tue Nov 21 15:47:48 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Nov 2023 15:47:48 +0100 Subject: [Lazarus] PasLibVLC based video player does not run on Linux... Message-ID: As I have written in other posts I am trying to port a video application from Windows to Linux, specifically on Raspberry Pi4B with either bullseye or bookworm operating systems. The application runs very well on Windows and is based on PasLibVLC found here: https://prog.olsztyn.pl/paslibvlc/ But I am not able to make it show videos on Linux.. So as a test I have now reverted to a demo application on this website in order to minimize the possible problems: http://lazplanet.blogspot.com/2018/01/how-to-make-simple-video-player-in.html When I follow these instructions to create a test application on the RPi4B it builds but when executed the video window does not appear and no video can be played. Instead of a black player waiting for rthe file to play, there is a gray background just like the player was not created at all. If I copy the sources from RPi4B to my Windows10 PC and open the project in Lazarus there (same version 2.2.6) it builds fine, and in this case it also displays the video as expected. No problems there at all. Same sources. So something is not working in the Linux environment and I don't understand what. And whatever it is it does not generate any errors during compile/build on Linux. I *have* enabled the threading system in the project file by putting cthreads into the uses clause as first item so it is not a thread initializatiuon problem: {$IFDEF UNIX} cthreads, {$ENDIF} Now I am wondering if it perhaps cannot find the VLC *libraries* that are supposed to be available on a system with VLC installed. But I do not know how thatr is supposed to work and I don't understand the code either. All my Linux systems (with a GUI) can run VLC OK and display mp4 videos just fine with the VLC player application. But only on Windows10 is it working when using PasLibVlc in the test application. Any ideas? -- Bo Berglund Developer in Sweden From michael at freepascal.org Tue Nov 21 16:23:37 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 21 Nov 2023 16:23:37 +0100 (CET) Subject: [Lazarus] PasLibVLC based video player does not run on Linux... In-Reply-To: References: Message-ID: <3416e931-e0ce-cfee-d860-96b8637ed67@freepascal.org> On Tue, 21 Nov 2023, Bo Berglund via lazarus wrote: > As I have written in other posts I am trying to port a video application from > Windows to Linux, specifically on Raspberry Pi4B with either bullseye or > bookworm operating systems. > > The application runs very well on Windows and is based on PasLibVLC found here: > https://prog.olsztyn.pl/paslibvlc/ > > But I am not able to make it show videos on Linux.. > > So as a test I have now reverted to a demo application on this website in order > to minimize the possible problems: > http://lazplanet.blogspot.com/2018/01/how-to-make-simple-video-player-in.html > > When I follow these instructions to create a test application on the RPi4B it > builds but when executed the video window does not appear and no video can be > played. Instead of a black player waiting for rthe file to play, there is a gray > background just like the player was not created at all. > > If I copy the sources from RPi4B to my Windows10 PC and open the project in > Lazarus there (same version 2.2.6) it builds fine, and in this case it also > displays the video as expected. No problems there at all. Same sources. > > So something is not working in the Linux environment and I don't understand > what. And whatever it is it does not generate any errors during compile/build on > Linux. I developed it on linux, so at least then it worked. > > I *have* enabled the threading system in the project file by putting cthreads > into the uses clause as first item so it is not a thread initializatiuon > problem: > > {$IFDEF UNIX} > cthreads, > {$ENDIF} > > > Now I am wondering if it perhaps cannot find the VLC *libraries* that are > supposed to be available on a system with VLC installed. But I do not know how > thatr is supposed to work and I don't understand the code either. Make sure you have libvlc-dev installed on the rpi. This should install a symlink libvlc.so somewhere below /usr/lib Michael. From bo.berglund at gmail.com Tue Nov 21 17:25:39 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Nov 2023 17:25:39 +0100 Subject: [Lazarus] PasLibVLC based video player does not run on Linux... References: <3416e931-e0ce-cfee-d860-96b8637ed67@freepascal.org> Message-ID: <3okplilmp0i7njaqvf5g93ksv9rr9vanph@4ax.com> On Tue, 21 Nov 2023 16:23:37 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Tue, 21 Nov 2023, Bo Berglund via lazarus wrote: > >> As I have written in other posts I am trying to port a video application from >> Windows to Linux, specifically on Raspberry Pi4B with either bullseye or >> bookworm operating systems. >> >> The application runs very well on Windows and is based on PasLibVLC found here: >> https://prog.olsztyn.pl/paslibvlc/ >> >> But I am not able to make it show videos on Linux.. >> >> So as a test I have now reverted to a demo application on this website in order >> to minimize the possible problems: >> http://lazplanet.blogspot.com/2018/01/how-to-make-simple-video-player-in.html >> >> When I follow these instructions to create a test application on the RPi4B it >> builds but when executed the video window does not appear and no video can be >> played. Instead of a black player waiting for rthe file to play, there is a gray >> background just like the player was not created at all. >> >> If I copy the sources from RPi4B to my Windows10 PC and open the project in >> Lazarus there (same version 2.2.6) it builds fine, and in this case it also >> displays the video as expected. No problems there at all. Same sources. >> >> So something is not working in the Linux environment and I don't understand >> what. And whatever it is it does not generate any errors during compile/build on >> Linux. Thanks for responding! Much appreciated. >I developed it on linux, so at least then it worked. Do you mean lclVlc or PasLibVlc? I saw your name concerning the lclVlc package and the pdf documentation but another name (Robert Jedrzejczyk) is mentioned in the sources for PasLibVlc... I have tried replacing PasLibVlc with LclVlc shipped with Lazarus but I am missing a couple of items that I use during playback (varying play speed and audio shift for lipsync), which PasLibVlc does expose. And there is a curious animation of my progressbar when the video is jumped to a new position so the playing moves instantly but the progressbar is slowly reaching the actual position in about a second or so. This is mostly an appearance problem when I jump with the location buttons I have in my main application, but still looks strange. This is done now in a small test application where I am testing all the VLC calls used in the actual application I am porting but using LclVLC instead of PasLibVlc. When done there I will do the surgery on the main application itself. > >> >> I *have* enabled the threading system in the project file by putting cthreads >> into the uses clause as first item so it is not a thread initializatiuon >> problem: >> >> {$IFDEF UNIX} >> cthreads, >> {$ENDIF} >> >> >> Now I am wondering if it perhaps cannot find the VLC *libraries* that are >> supposed to be available on a system with VLC installed. But I do not know how >> thatr is supposed to work and I don't understand the code either. > On the newest RPi4 running bookworm 64 bit: $ apt policy libvlc-dev libvlc-dev: Installed: 1:3.0.20-0+rpt1+deb12u1 Candidate: 1:3.0.20-0+rpt1+deb12u1 Version table: *** 1:3.0.20-0+rpt1+deb12u1 500 500 http://archive.raspberrypi.com/debian bookworm/main arm64 Packages 100 /var/lib/dpkg/status 3.0.20-0+deb12u1 500 500 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages 3.0.18-2 500 500 http://deb.debian.org/debian bookworm/main arm64 Packages And on the other running bullseye 32 bit: $ apt policy libvlc-dev libvlc-dev: Installed: 1:3.0.20-0+rpt1+deb11u1 Candidate: 1:3.0.20-0+rpt1+deb11u1 Version table: *** 1:3.0.20-0+rpt1+deb11u1 500 500 http://archive.raspberrypi.org/debian bullseye/main armhf Packages 100 /var/lib/dpkg/status 3.0.20-0+deb11u1+rpi1 500 500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages $ find /usr/lib -name libvlc.so /usr/lib/arm-linux-gnueabihf/libvlc.so >Make sure you have libvlc-dev installed on the rpi. >This should install a symlink libvlc.so somewhere below /usr/lib On the bullseye system: $ find /usr/lib -name libvlc.so /usr/lib/arm-linux-gnueabihf/libvlc.so On the bookworm 64 system: $ find /usr/lib -name libvlc.so /usr/lib/aarch64-linux-gnu/libvlc.so Are these locations that will let the application (or Lazaur/Fpc) find the libraries? What are the requirements for the executable's environment for it to find the libvlc files? And is it necessary for them to be there for the building process only or for the end user's execution too? -- Bo Berglund Developer in Sweden From michael at freepascal.org Tue Nov 21 18:05:22 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 21 Nov 2023 18:05:22 +0100 (CET) Subject: [Lazarus] PasLibVLC based video player does not run on Linux... In-Reply-To: <3okplilmp0i7njaqvf5g93ksv9rr9vanph@4ax.com> References: <3416e931-e0ce-cfee-d860-96b8637ed67@freepascal.org> <3okplilmp0i7njaqvf5g93ksv9rr9vanph@4ax.com> Message-ID: <82358e89-4be7-8d75-5518-2d23ab68b37@freepascal.org> On Tue, 21 Nov 2023, Bo Berglund via lazarus wrote: >>> >>> So something is not working in the Linux environment and I don't understand >>> what. And whatever it is it does not generate any errors during compile/build on >>> Linux. > > Thanks for responding! Much appreciated. > >> I developed it on linux, so at least then it worked. > > Do you mean lclVlc or PasLibVlc? lclVlc > > I saw your name concerning the lclVlc package and the pdf documentation but > another name (Robert Jedrzejczyk) is mentioned in the sources for PasLibVlc... Where did you find paslibvlc ? The one I maintain is part of FPC and is in fpc/packages/libvlc. > > I have tried replacing PasLibVlc with LclVlc shipped with Lazarus but I am > missing a couple of items that I use during playback (varying play speed and > audio shift for lipsync), which PasLibVlc does expose. It should not be difficult to add those properties to lclvlc > > What are the requirements for the executable's environment for it to find the > libvlc files? Notmally nothing. > > And is it necessary for them to be there for the building process only or for > the end user's execution too? libvlc is loaded dynamically, you can specify the name. I can't comment on PasLibVlc. Michael. From bo.berglund at gmail.com Tue Nov 21 19:29:58 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Nov 2023 19:29:58 +0100 Subject: [Lazarus] PasLibVLC based video player does not run on Linux... References: <3416e931-e0ce-cfee-d860-96b8637ed67@freepascal.org> <3okplilmp0i7njaqvf5g93ksv9rr9vanph@4ax.com> <82358e89-4be7-8d75-5518-2d23ab68b37@freepascal.org> Message-ID: On Tue, 21 Nov 2023 18:05:22 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Tue, 21 Nov 2023, Bo Berglund via lazarus wrote: > >Where did you find paslibvlc ? I found it here years ago: https://prog.olsztyn.pl/paslibvlc/ And the first commit to my video tool in svn using it was done in May 2019... > >The one I maintain is part of FPC and is in fpc/packages/libvlc. Yes and a few days ago I found it to be a part of fpc/lazarus and that made me try to see if I could find all the stuff I have used in paslibvlc also here so I could just exchange the player and modify the calls. Makes much more sense to use a package that is in effect maintained than one that is stale on the net. >> >> I have tried replacing PasLibVlc with LclVlc shipped with Lazarus but I am >> missing a couple of items that I use during playback (varying play speed and >> audio shift for lipsync), which PasLibVlc does expose. > >It should not be difficult to add those properties to lclvlc If one knows how it is done internally I guess it is doable but for me not... But I can trace what I use backwards into PasLibVlc and see where it finally ends up. So: --------- Delay audio ------------------------ I call the audio delay like this: procedure TfrmMain.btnShiftAudioClick(Sender: TObject); //For testing purposes, delay audio by value from speAudio var SyncCmd: string; begin vlcPlayer.SetAudioDelay(speAudio.Value * 1000); end; which calls this inside PasLibVlc: procedure TPasLibVlcPlayer.SetAudioDelay(delay: Int64); begin if not Assigned(p_mi) then exit; libvlc_audio_set_delay(p_mi, delay); end; and this is where it ends up: (** * Set current audio delay. The audio delay will be reset to zero each time the media changes. * * param p_mi media player * param i_delay the audio delay (microseconds) * return 0 on success, -1 on error * version LibVLC 1.1.1 or later *) var libvlc_audio_set_delay : function( p_mi : libvlc_media_player_t_ptr; i_delay : Int64 ) : Integer; cdecl; ------------- Set video speed ----------------------- To set the speed this is what I use in my code: procedure TfrmMain.btnFFClick(Sender: TObject); begin vlcPlayer.SetPlayRate(speSpeed.Value); end; It goes here: procedure TPasLibVlcPlayer.SetPlayRate(rate: Integer); begin if (p_mi = NIL) then exit; if (rate < 1) then exit; if (rate > 1000) then exit; libvlc_media_player_set_rate(p_mi, rate / 100); end; And it winds up here: (** * Set movie play rate * * param p_mi the Media Player * param rate movie play rate to set * return -1 if an error was detected, 0 otherwise (but even then, it might * not actually work depending on the underlying media protocol) *) var libvlc_media_player_set_rate : function( p_mi : libvlc_media_player_t_ptr; rate : Single // float ) : Integer; cdecl; >> >> What are the requirements for the executable's environment for it to find the >> libvlc files? > >Notmally nothing. > >> >> And is it necessary for them to be there for the building process only or for >> the end user's execution too? > >libvlc is loaded dynamically, you can specify the name. Well, for lclvlc there are no problems because it finds the lib on the platforms I have tested it. Both RPi4 versions (32 and 64 bit) and Windows10. > >Michael. Thanks again! Nice to communicate with someone "in the know" for once! -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Tue Nov 21 21:17:11 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Nov 2023 21:17:11 +0100 Subject: [Lazarus] PasLibVLC based video player does not run on Linux... References: <3416e931-e0ce-cfee-d860-96b8637ed67@freepascal.org> <3okplilmp0i7njaqvf5g93ksv9rr9vanph@4ax.com> <82358e89-4be7-8d75-5518-2d23ab68b37@freepascal.org> Message-ID: <9a3qlide3gmph1ac06cndp0o8shrigvhek@4ax.com> On Tue, 21 Nov 2023 19:29:58 +0100, Bo Berglund via lazarus wrote: >------------- Set video speed ----------------------- >To set the speed this is what I use in my code: > >procedure TfrmMain.btnFFClick(Sender: TObject); >begin > vlcPlayer.SetPlayRate(speSpeed.Value); >end; > >It goes here: > >procedure TPasLibVlcPlayer.SetPlayRate(rate: Integer); >begin > if (p_mi = NIL) then exit; > if (rate < 1) then exit; > if (rate > 1000) then exit; > libvlc_media_player_set_rate(p_mi, rate / 100); >end; > >And it winds up here: > >(** > * Set movie play rate > * > * param p_mi the Media Player > * param rate movie play rate to set > * return -1 if an error was detected, 0 otherwise (but even then, it might > * not actually work depending on the underlying media protocol) > *) > >var > libvlc_media_player_set_rate : function( > p_mi : libvlc_media_player_t_ptr; > rate : Single // float > ) : Integer; cdecl; Now I have searched in the test application tha uses the Lazarus lclvlc package and found this hidden inside the vlc.pp unit procedure TCustomVLCMediaPlayer.SetPlayRate(Avalue : Integer); begin if Assigned(FInstance) then begin if (Avalue< 1) then AValue:=1 else if (AValue>1000) then AValue:=1000; libvlc_media_player_set_rate(FInstance,AValue/100); end; end; So there is such a function inside but how can I use it in my top level code? I tried like this: procedure TfrmMainVlc.btnSpeedClick(Sender: TObject); var VideoSpeed: integer; begin VideoSpeed := speVideoSpeed.Value; Fplayer.SetPlayRate(VideoSpeed); end; But it generates an error: "identifier idents no member "SetPlayRate" So I tried to trace it further and found it in unit vlc: TCustomVLCMediaPlayer = Class(TComponent) private ... procedure SetPlayRate(AValue: Integer); ... So how can I get to use this function? I.e. how to publish it (it is private now)? If I trace it down to implementation it looks like this: procedure TCustomVLCMediaPlayer.SetPlayRate(Avalue : Integer); begin if Assigned(FInstance) then begin if (Avalue< 1) then AValue:=1 else if (AValue>1000) then AValue:=1000; libvlc_media_player_set_rate(FInstance,AValue/100); end; end; So all is there but not accessible for me... -- Bo Berglund Developer in Sweden From werner.pamler at freenet.de Wed Nov 22 10:41:11 2023 From: werner.pamler at freenet.de (Werner Pamler) Date: Wed, 22 Nov 2023 10:41:11 +0100 Subject: [Lazarus] PasLibVLC based video player does not run on Linux... In-Reply-To: <9a3qlide3gmph1ac06cndp0o8shrigvhek@4ax.com> References: <3416e931-e0ce-cfee-d860-96b8637ed67@freepascal.org> <3okplilmp0i7njaqvf5g93ksv9rr9vanph@4ax.com> <82358e89-4be7-8d75-5518-2d23ab68b37@freepascal.org> <9a3qlide3gmph1ac06cndp0o8shrigvhek@4ax.com> Message-ID: Am 21.11.2023 um 21:17 schrieb Bo Berglund via lazarus: > On Tue, 21 Nov 2023 19:29:58 +0100, Bo Berglund via lazarus > wrote: > >> ------------- Set video speed ----------------------- >> To set the speed this is what I use in my code: >> >> procedure TfrmMain.btnFFClick(Sender: TObject); >> begin >> vlcPlayer.SetPlayRate(speSpeed.Value); >> end; >> >> It goes here: >> >> procedure TPasLibVlcPlayer.SetPlayRate(rate: Integer); >> begin >> if (p_mi = NIL) then exit; >> if (rate < 1) then exit; >> if (rate > 1000) then exit; >> libvlc_media_player_set_rate(p_mi, rate / 100); >> end; >> >> And it winds up here: >> >> (** >> * Set movie play rate >> * >> * param p_mi the Media Player >> * param rate movie play rate to set >> * return -1 if an error was detected, 0 otherwise (but even then, it might >> * not actually work depending on the underlying media protocol) >> *) >> >> var >> libvlc_media_player_set_rate : function( >> p_mi : libvlc_media_player_t_ptr; >> rate : Single // float >> ) : Integer; cdecl; > Now I have searched in the test application tha uses the Lazarus lclvlc package > and found this hidden inside the vlc.pp unit > > > procedure TCustomVLCMediaPlayer.SetPlayRate(Avalue : Integer); > begin > if Assigned(FInstance) then > begin > if (Avalue< 1) then > AValue:=1 > else if (AValue>1000) then > AValue:=1000; > libvlc_media_player_set_rate(FInstance,AValue/100); > end; > end; > > So there is such a function inside but how can I use it in my top level code? > I tried like this: > > procedure TfrmMainVlc.btnSpeedClick(Sender: TObject); > var > VideoSpeed: integer; > begin > VideoSpeed := speVideoSpeed.Value; > Fplayer.SetPlayRate(VideoSpeed); > end; > > But it generates an error: > "identifier idents no member "SetPlayRate" > > So I tried to trace it further and found it in unit vlc: > > TCustomVLCMediaPlayer = Class(TComponent) > private > ... > procedure SetPlayRate(AValue: Integer); > ... > > So how can I get to use this function? I.e. how to publish it (it is private > now)? > > If I trace it down to implementation it looks like this: > > procedure TCustomVLCMediaPlayer.SetPlayRate(Avalue : Integer); > begin > if Assigned(FInstance) then > begin > if (Avalue< 1) then > AValue:=1 > else if (AValue>1000) then > AValue:=1000; > libvlc_media_player_set_rate(FInstance,AValue/100); > end; > end; > > So all is there but not accessible for me... Private methods GetSomething and SetSomething usually are getters and setter for a property "Something". Looking at vlc.pp I can see that the methods GetPlayRate and SetPlayRate do exist, but a property "PlayRate" has not been defined. Just forgotten? Post a feature request to the fpc bugtracker to create this property. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ganmax at narod.ru Thu Nov 23 02:11:30 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Thu, 23 Nov 2023 04:11:30 +0300 Subject: [Lazarus] Attn. Mattias, adding x86 CPU detection function to DefineTemplates.pas Message-ID: <30236016-930b-4d16-bcbf-db64e9813400@narod.ru> Hello. I am trying to solve https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38786 (Lazarus emits x86-specific assembler mode compiler option for non-x86 CPUs). In order to solve it, I need to add the following function to DefineTemplates.pas: function IsCPUX86(TargetCPU: string): boolean; begin TargetCPU := GetFPCTargetCPU(TargetCPU); Result:=(TargetCPU='i8086') or (TargetCPU='i386') or (TargetCPU='x86_64'); end; The questions are: 1. Is it correct place? 2. Is its name OK? 3. Maybe I missed some existing function? The complete patch is attached in the issue. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From nc-gaertnma at netcologne.de Thu Nov 23 22:55:37 2023 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Thu, 23 Nov 2023 22:55:37 +0100 Subject: [Lazarus] Attn. Mattias, adding x86 CPU detection function to DefineTemplates.pas In-Reply-To: <30236016-930b-4d16-bcbf-db64e9813400@narod.ru> References: <30236016-930b-4d16-bcbf-db64e9813400@narod.ru> Message-ID: <0fd58251-f615-484b-aee3-5306809c3e15@netcologne.de> On 23.11.23 02:11, Maxim Ganetsky via lazarus wrote: > Hello. > > I am trying to solve > https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38786 > (Lazarus emits x86-specific assembler mode compiler option for non-x86 > CPUs). > > In order to solve it, I need to add the following function to > DefineTemplates.pas: > > function IsCPUX86(TargetCPU: string): boolean; > begin > ? TargetCPU := GetFPCTargetCPU(TargetCPU); > ? Result:=(TargetCPU='i8086') or (TargetCPU='i386') or > (TargetCPU='x86_64'); > end; ok Mattias From ganmax at narod.ru Fri Nov 24 00:38:12 2023 From: ganmax at narod.ru (Maxim Ganetsky) Date: Fri, 24 Nov 2023 02:38:12 +0300 Subject: [Lazarus] Attn. Mattias, adding x86 CPU detection function to DefineTemplates.pas In-Reply-To: <0fd58251-f615-484b-aee3-5306809c3e15@netcologne.de> References: <30236016-930b-4d16-bcbf-db64e9813400@narod.ru> <0fd58251-f615-484b-aee3-5306809c3e15@netcologne.de> Message-ID: <63589084-f190-41da-acae-06e275d5175d@narod.ru> 24.11.2023 0:55, Mattias Gaertner via lazarus ?????: > > > On 23.11.23 02:11, Maxim Ganetsky via lazarus wrote: >> Hello. >> >> I am trying to solve >> https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38786 >> (Lazarus emits x86-specific assembler mode compiler option for non-x86 >> CPUs). >> >> In order to solve it, I need to add the following function to >> DefineTemplates.pas: >> >> function IsCPUX86(TargetCPU: string): boolean; >> begin >> ?? TargetCPU := GetFPCTargetCPU(TargetCPU); >> ?? Result:=(TargetCPU='i8086') or (TargetCPU='i386') or >> (TargetCPU='x86_64'); >> end; > > ok Cool, fixed in https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/7eb6be5a2cdbd9d57ac4adb71348701f9139e709 and merged to `fixes_3_0`. -- Best regards, Maxim Ganetsky mailto:ganmax at narod.ru From don.sawtelle at gmail.com Thu Nov 30 00:59:44 2023 From: don.sawtelle at gmail.com (Don Sawtelle) Date: Wed, 29 Nov 2023 15:59:44 -0800 Subject: [Lazarus] Mac OS binary install of 3.0RC2 throws __datacoal_nt errors when building default application In-Reply-To: References: Message-ID: Having. used the 3.0RC2 prebuilt binary installers in Mac OS Monterey 12.6.7, I can run a hello world program and step through it in the debugger. But the build of the *default* example project yields a storm of deprecation warnings and hints (which may not matter?) and errors like this: Warning: /Users/sawtelle/.lazarus/lib/units/x86_64-darwin/cocoa/cocoaprivate.s:57971:10: warning: section "__datacoal_nt" is deprecated Error: .section __DATA, __datacoal_nt, coalesced Error: /Users/sawtelle/.lazarus/lib/units/x86_64-darwin/cocoa/cocoaprivate.s:57971:10: note: change section name to "__data" Error: .section __DATA, __datacoal_nt, coalesced Can anyone advise? Thanks! Don PS: My apologies for this possibly second duplicate post. The previous copy was sent before I had confirmed my subscription to this list and I didn't know whether the 1st try would have been rejected. -------------- next part -------------- An HTML attachment was scrubbed... URL: