Re: [fpc-pascal] Smart Link definition ?

2016-10-12 Thread fredvs
Hello. OK, after check (adding -s parameter to have ppas.sh script for ld), it appears that -XX fpc parameter sent this option to ld: --gc-sections And this produce, sorry FreeBSD, bad linked 32 bit executable in FreeBSD, that is not possible to run in a 64 multi-arch FreeBSD. So, I maintain th

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-13 Thread fredvs
Thanks Graeme. To know what is sent to the linker, there is the -s parameter. # fpc -XX -s test.pas This will compile the object and create a script file for the linker. Here the script with -XX parameter: /usr/bin/ld -b elf32-i386-freebsd -m elf_i386_fbsd *--gc-sections* -s -L. -0 ./test ./lin

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-16 Thread fredvs
I feel so lonely. Nobody in the world to confirm (or not) that *--gc-sections* option is added to ld when -XX is used ? Did I do something wrong against fpc community ? If yes I apologize a lot and a lot and a lot. Fre;D - Many thanks ;-) -- View this message in context: http://free-p

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-17 Thread fredvs
Thanks Michael. > No, simply probably no-one knows the answer or the few knowledgable people > didn't see your message. OK I agree the problem is complicated it is the reason why I ask this to fpc + freebsd forum. But here I ask something simple : What option is added to linker when -XX paramet

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-17 Thread fredvs
Yeh, the cavalry finally arrives, I am saved. ;-) > it is then the linkers job to link only the object files that are needed > (and really used in the application) to make the executable. Yes, yes, yes and re-yes. > I guess showing them the content of the ppas.sh file is all that they > should

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-17 Thread fredvs
> Just curious. If you don't compile with Smart-Linking enabled, does your binary then run fine? Yes, without Smart-linking, a 32 bit fpc application runs fine in a multi-arch 64 bit system. With Smart-linking a 32 bit application runs fine only in a mono-arch 32 bit. Fred. - Many thanks

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-17 Thread fredvs
Oops, I did not see this... > Is only Smart-Linking causing the problem? Yes I agree it is only a detail, all the rest is working perfectly. And I will survive, even with smart-link 32 bit not working in one of my system. ;-) Thanks a lot for helping. @fpc-team: Why not register the concep

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-18 Thread fredvs
> Maybe if you supply two small binaries Maybe or, better, supply two clean new glasses to those two "developers". Sorry Graeme but I am tired to fight. The honor of fpc is saved, the problem is or *ld* or FreeBSD multi-arch design. Many thanks Graeme for your opened mind and your impressing c

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-19 Thread fredvs
Hello Marco. Huh, I decided to forget FreeBSD but ok I will re-install it and test your propositions. Write you later. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Smart-link-in-FreeBSD-multi-arch-tp5726375p5726636.html Sent fr

Re: [fpc-pascal] Smart link in FreeBSD multi-arch ?

2016-10-19 Thread fredvs
Hello Marco. > Do you see differences between ppas.sh and link.res with and without > smartlinking ohter than --gc-sections? For link.res => no differences. For ppas.sh => only "--gc-section" was added. > If you compile without smartlinking but with -s and add --gc-sections > to the ppas.sh fil

Re: [fpc-pascal] FreeBSD distro with fpc as star.

2016-11-04 Thread fredvs
@ Paul & Graeme: many thanks ;-) Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FreeBSD-distro-with-fpc-as-star-tp5722535p5726761.html Sent from the Free Pascal - General mailing list archive at Nabble.com.

Re: [fpc-pascal] FreeBSD distro with fpc as star.

2016-11-05 Thread fredvs
> so does polYdev not include lazarus Hello. polYdev is a "Pure X" OS. "Pure X" because it does not use big widgetset like Gnome, Qt, ... for gui applications. Lazarus needs those big widgetsets. But if you install Qt or Gnome on polYdev (pkg install qt), of course you may install Lazarus. fpG

Re: [fpc-pascal] FreeBSD distro with fpc as star.

2016-11-07 Thread fredvs
> I understand that you suggest you can't build the Lazarus IDE with defining fpGUI or CustomDrwan instead of Qt or Gnome (or Windows or Cocos). Maybe I did not understand well. AFAIK, for Unix os, Lazarus and LCL-widget-set need a "big native" widget-set, like GTK, KDE or Qt. IMO (maybe I am

Re: [fpc-pascal] FreeBSD distro with fpc as star.

2016-11-08 Thread fredvs
> if you want Lazarus support, it means you need to install large 3rd > party dependencies and Lazarus itself, which will bloat the OS by > 500MB-1000MB more hard disk space. Huh, yes but this only for the main system. If you want a poly-compiling system (like polYdev) you need to install also al

Re: [fpc-pascal] FreeBSD distro with fpc as star.

2016-11-09 Thread fredvs
> Does ideU support multiple programming languages as an editor? Yes, MSEide (and ideU) has syntax highlighter for Pascal, C, Python, Ipf, sql. I am busy with a Java syntax highlighter. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.c

Re: [fpc-pascal] Other linkers support

2016-11-18 Thread fredvs
Hello. What linker is used for Windows ? Does it exist some (dis)advantage(s) to use Gold or lld vs ld in Unix systems ? Thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Other-linkers-support-tp5726880p5726882.html Sent fr

Re: [fpc-pascal] Other linkers support

2016-11-18 Thread fredvs
> FPC has a built-in linker for Windows. Ha, I understand now why fpc-Windows creates perfect binaries. ;-) Hum, is there plan for a "pure fpc unix linker" ? Thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Other-linkers-s

Re: [fpc-pascal] Other linkers support

2016-11-18 Thread fredvs
Thanks Jonas for your bright light. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Other-linkers-support-tp5726880p5726887.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___

Re: [fpc-pascal] Using the LCL without Lazarus

2016-11-30 Thread fredvs
Hello. > My attempts to use the following software has proven to be unsuccessful > because of the "unfriendly" nature of their video displays: > IDEU IDE What do you mean with "unfriendly" nature of their video displays" ? Did you enable "Voice Assisted" feature of ideU ? What would you want to

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-01 Thread fredvs
Hello BobJ. >> Did you enable "Voice Assisted" feature of ideU ? > Yes, after much trial and error or, probably more accurately, much trial > and failure. Did you download the release version of ideU here : https://github.com/fredvs/ideU/releases/tag/1.3.0 ? All is

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-01 Thread fredvs
>That was my concern too when Fred started with the accessibility options > for MSEgui. I suggested to use and extend the "iassistiveclient" and > "iassistiveserver" interfaces of MSEgui in order to connect to standard > screen readers instead to implement own reader functionality. Hum, not sur

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-01 Thread fredvs
Huh, this fast before fpc moderators begin to shout... > Say a README.txt file telling you exactly what to do, once ideU started up > for the first time. +1 (I will add a ASSISTED_README.txt) > Fred, BobJ has a valid point about... BobJ has extremely valid points about assisting and if he agre

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-01 Thread fredvs
> I definitely believe you are not the right track though. Ha, ok. (and what would be the right-better track) ? Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Using-the-LCL-without-Lazarus-tp5726979p5727004.html Sent from the Free

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-03 Thread fredvs
Hello Bobj. We are all with you in that difficult moment. When you will come back, there will be a new binary release of ideU, with fixes that you wanted. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Using-the-LCL-without-Lazar

[fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-08 Thread fredvs
Hello. In a audio library, it uses a buffer to record audio. There is a main loop that store the audio-data given by the audio-input device into the buffer. For this TFileStream.WriteBuffer() is used. Ok, all works well. But I noted that the ram used increase at each loop and when the max ram i

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-09 Thread fredvs
Hello. Thanks Michael for answer. > What happens with the buffer in which you had data, this we do not know. Here is the schema of recording: 1) At creation: DataRec := TMemoryStream.Create; 2 ) In loop: ... DataRec.WriteBuffer(InputBuffer[0], Length(InputBuffer)); // RAM used increase at eac

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-10 Thread fredvs
Hello Michael. > The RAM increase is normal... OK, I was thinking that too but... is it normal that the app crash if there are no more ram available ? If so, how to know how many ram is disponible (and then create a temporally file if too few). One minute of recording stereo 16 bit is +- 10 meg

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-11 Thread fredvs
@ Jonas and Michael: OK, to resume: it is not so simple... ;-) Before i find a good solution, I will block the recording to maximum one hour. If the user want to record more, he should do other recording each hour. @ Jose : uos uses PortAudio library to grap input from devices. I will deeply stud

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-12 Thread fredvs
@ Jose : Wow many thanks. I will test and commit your code (with your name as contributor, of course). https://github.com/fredvs/uos Fre;D. - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-used

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-12 Thread fredvs
Hello José. I have study your code. It is nearly the one used by uos. But I do not see how it can resolve the too less RAM available. IMO, the problem does not come from PortAudio but from TFileStream.WriteBuffer that does not have enough RAM for writing. But maybe I do not catch something :-(

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-13 Thread fredvs
Hello Jose. Many thanks for your help. I will deeply study your code tonight. Write you later. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-used-tp5727062p5727096.html Sent from the Free Pascal

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-14 Thread fredvs
Hello Jose. Huh, of course, your code is more logical. OK, I understand what you mean. I will commit your idea asap. Many thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM-used-tp5727062p572

Re: [fpc-pascal] TFileStream.WriteBuffer() and RAM used ?

2016-12-15 Thread fredvs
Hello. Ok, your idea is committed. https://github.com/fredvs/uos commit da316a2..5f11b62 You are added in the list of contributors. Many thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TFileStream-WriteBuffer-and-RAM

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-17 Thread fredvs
Hello. The new release of ideU is ready to download: https://github.com/fredvs/ideU/releases/tag/1.4.0 For voice assisted, please read README_voice_assisted.TXT. All comment and suggestion are highly appreciated. Have fun. Fre;D - Many thanks ;-) -- View this message in context: http

[fpc-pascal] fpc and voip ?

2017-01-14 Thread fredvs
Hello. I have lot of success to play mp3 files with library mpg123+portaudio and fpc unit fphttpclient.pas. Andrew Haines did a perfect work with his TThreadHttpGetter (that is now included in https://github.com/fredvs/uos). So getting the voice over ip is not a problem. For sending the voice

Re: [fpc-pascal] Size of program vs library ?

2017-01-14 Thread fredvs
>> Sorry to insist on that, but the size of fp library is very too big vs other libraries (C for example). > The size of FPC libraries will always(*) be bigger then e.g. C ones, > because in FPC the RTL is statically linked into the program/library, > while C libraries link against the C runtime l

Re: [fpc-pascal] Size of program vs library ?

2017-01-14 Thread fredvs
>> Sorry to insist on that, but the size of fp library is very too big vs other libraries (C for example). > The size of FPC libraries will always(*) be bigger then e.g. C ones, > because in FPC the RTL is statically linked into the program/library, > while C libraries link against the C runtime l

Re: [fpc-pascal] fpc and voip ?

2017-01-16 Thread fredvs
Hello. Thanks Lucaz for the link. But this is too complete ! I will try to explain what i want and if it is possible to do it with fphttpclient/server.pas. I can successfully save to file input from mic/wav/mp3/ogg/flac to wav file. Is it possible that this file, while recording, could be acce

Re: [fpc-pascal] fpc and voip ?

2017-01-16 Thread fredvs
> I thought about it a bit... isn't this how YouTube Live Stream or Twitch and alikes somehow works? > Maybe your inspiration can come from there ? Maybe or maybe from web-radios... For example, I can (via uos) connect and do streaming to url-mp3 like this: 1) uos_AddFromURL(PlayerIndex1,pchar

Re: [fpc-pascal] fpc and voip ?

2017-01-17 Thread fredvs
@ Jose => many thanks I will deeply study your advices. > In the other side, mp3 is not a suitable format for voIP, as it have a big > latency. Huh, what format would be better for voice over ip ? @Lukasz > Yeah, Fred mentioned VoIP, that's why I thought of a real VoIP application > to look

Re: [fpc-pascal] fpc and voip ?

2017-01-17 Thread fredvs
> For conversation: > G.7* (G.711 - G.7229) > Speex > Opus Ha, ok. But I have to find the headers for those libraries... > And maybe some others. https://en.wikipedia.org/wiki/Comparison_of_audio_coding_formats What do you think about the flac format ? It seams to have all the feature nee

Re: [fpc-pascal] fpc and voip ?

2017-01-17 Thread fredvs
> I think that if you like to continue this discussion we should move it to fpc-other. OK. Then, back to fpc. Does fpc have, with fphttpclient.pas/fphttpserver.pas, all the tools to make that (live)file ready to use for url-clients ? Or is a external web package + libraries needed ? Thanks.

Re: [fpc-pascal] fpc and voip ?

2017-01-17 Thread fredvs
> Maybe you may think in Opus http://opus-codec.org/ Huh and the header is already translated for Delphi... https://github.com/DelphiForAudio/delphi-opus-wrapper/blob/master/uLibOpus.pas That Opus format (very-young: 2012) seems very-promising. Ok, I will convert the Delphi wrapper into fpc (wi

[fpc-pascal] Array as result in function.

2017-01-19 Thread fredvs
Hello. With this code, the result of the function does not have same format as the array input: Why ? type TArFloat = array of cfloat; function array_in_out(arrayin: TArFloat): TArFloat; begin result := arrayin; end; Some more explaination. If in a code I use: var thebuffer: TArFloat; /

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread fredvs
Thanks very much for answers. @ silvioprog: > using that function as callback with some (C/C++) library? Yes and check its parameter calling convention is ok. @ Martin. > result:= copy(arrayin); Ha, I did not know this one. I will try it (and write you asap). Many thanks. Fre;D -

Re: [fpc-pascal] fpc and voip ?

2017-01-20 Thread fredvs
ple. https://github.com/fredvs/uos Ok, All the tools for voip and soip (sound over ip) are ready and working. Maybe I will need some help for Opus server-web-streaming. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/fpc-and-v

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread fredvs
amic arrays gives me lovely results). > Maybe show us how the original C function looks like. All the audio-wrappers use buffers to store the data. I use dynamic arrays for that buffers. In https://github.com/fredvs/uos there are Pascal wrappers to C libraries: uos_Portaudio.pas uos_Mpg12

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread fredvs
Hello. Hum,... I am guilty. ;-( There was a SetLength(Bufferin, x) hidden. So the length of bufferin into the function was not the same as the "pure" one. So, to resume: If using: function arraycopy(arrayin : Tarrayfloat): Tarrayfloat; begin result := arrayin; end; ==> Perfect, the inp

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread fredvs
Here, for example from OpusFile.h => OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of, float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); Translated in fpc with: op_read: function(OpusFile: TOggOpusFile; var pcm; SampleCount: Integer; li: pointer): Integer; And used like this: Bu

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread fredvs
Hello Silvio. Wow, thanks, I will study it deep. By the way, the Opus Pascal wrappers are working. You may listen, seek, saving to file, apply dsp,.. to Opus files. You may try SimplePlayer demo in uos (all libraries and Opus-audiofile included): https://github.com/fredvs/uos PS: BufferIn is

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread fredvs
Re-hello. Ok, thanks Silvio, I will take this one from your advice, it works like charm: type TOggOpusFile = THandle; TDArFloat = array of cfloat; PDArFloat = ^TDArFloat; op_read: function(OpusFile: TOggOpusFile; pcm : PDArFloat; SampleCount: Integer; li: pointer): Integer; op_read_float:

Re: [fpc-pascal] Array as result in function.

2017-01-21 Thread fredvs
@ Silvio > Try two tests: >$ echo -e '#include \nint main(){printf("size of float: %zu\\n", sizeof(float));return 0;}' > fredvs.c && gcc -o fredvs fredvs.c && clear && ./fredvs # it prints "size > of float: 4" on your terminal ==

Re: [fpc-pascal] Array as result in function.

2017-01-21 Thread fredvs
Hello everybody. Do you agree with this ? : type TOggOpusFile = ^OggOpusFile; OggOpusFile = record end; op_read: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount: Integer; li: pointer): Integer; op_read_float: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount: Integer;

Re: [fpc-pascal] Array as result in function.

2017-01-21 Thread fredvs
And this one ? op_read: function(OpusFile: TOggOpusFile; pcm : pcint; SampleCount: Integer; li: pcint): Integer; op_read_float: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount: Integer; li: pcint): Integer; op_read_stereo: function(OpusFile: TOggOpusFile; pcm : pcint; SampleCount: Inte

[fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-22 Thread fredvs
Hello. Is it possible to connect with 'https:// files with fphttpclient ? For example, I can access this: http://broadcast.infomaniak.net:80/alouette-high.mp3 but not this: https://github.com/fredvs/uos/blob/master/examples/sound/test.mp3 Thanks. Fre;D - Many thanks ;-) -- View

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-22 Thread fredvs
Ooops, in previous mail, please read this: Hello. Is it possible to connect with 'https:// files with fphttpclient ? For example, I can access this: http://broadcast.infomaniak.net:80/alouette-high.mp3 but not this: https://sites.google.com/site/fredvsbinaries/test.mp3 Fre;D - M

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello Michael and thanks for answer. I have try with fpc 3.1.1 without success. Huh, is there a brave heart that could download this: https://github.com/fredvs/uos/blob/master/examples/sound/test.opus and place it to a http:// server ? This because I want to test opus-file streaming but I

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Re-hello. Aaargh, same error than in first post (wrong url). Please read this: Hello Michael and thanks for answer. I have try with fpc 3.1.1 without success. Huh, is there a brave heart that could download this: https://sites.google.com/site/fredvsbinaries/test.mp3 and place it to a http

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
AAArgh, wrong url again in previous post. Please, read this: Hello Michael and thanks for answer. I have try with fpc 3.1.1 without success. Huh, is there a brave heart that could download this: https://sites.google.com/site/fredvsbinaries/test.opus and place it to a http:// server ? Thi

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello Graeme. Yep, many thanks. (and you place the good one ;-)) Ok, I have something for makeing nights white now. PS: uos_SimplePlayer can play opus file in FreeBSD64 too (file =ok, url=must test it). Thanks Graeme. Fre;D - Many thanks ;-) -- View this message in context: http://free

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello Graeme. Thanks for the mp3 too. I have try it, I can download and access it but... audio-streaming is not working here. Must your server do something special to enable audio-streaming ? Thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-genera

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello Michael. > just tried with the httpget sample program, works just fine. To access a "https" file ? If so, there is something that must be done to the server to allow file streaming (or I miss something). Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello. I develop with Linux64 bit. But I have try with FreeBSD64 and same result. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Connect-to-https-url-with-fphttpclient-tp5727404p5727422.html Sent from the Free Pascal - General mai

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello. Some news from the front. There is a library included with opus package: libopusurl.so This without any c header. Ok,I did a pascal header for that library and use this method in code: op_test_url: function(path: PAnsiChar; out error: Integer): TOpusFile (in place of op_test_file: fun

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-23 Thread fredvs
Hello Michael. This will close the topic: uos_AddFromURL('https://sites.google.com/site/fredvsbinaries/test.opus') ; => WORKS... So, conclusion, yes fphttpclient can connect to 'https://...' and uos can play 'https://... Opus streaming files. Thanks for all your help. Fre;D - Many

Re: [fpc-pascal] Connect to 'https://...' url with fphttpclient ?

2017-01-25 Thread fredvs
> I can listen to http://geldenhuys.co.uk/~graemeg/temp/test.opus in web-streaming with fpc code! > I will release a working demo in uos asap. Huh, no, sorry, I said victory too fast. I uos can listen in streaming "https" mp3 but not opus files. The opus method op_test_url does not work here.

[fpc-pascal] Pipe vs Memory buffer.

2017-01-25 Thread fredvs
Hello In a C method: OP_WARN_UNUSED_RESULT OggOpusFile *op_test_memory(const unsigned char *_data, size_t _size,int *_error); translated in Pascal with this: var op_test_memory: function(const _data; const size: cuint; out error: cint): TOggOpusFile; How to use a pipe for _data ? The pipe i

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-25 Thread fredvs
>That will never work. > OP_WARN_UNUSED_RESULT OggOpusFile *op_test_memory(const unsigned char > *_data, size_t _size,int *_error); > expects a memory buffer; you cannot pass it a stream. Ha, ok. And how to convert a pipe into a memory buffer ? Thanks. Fre;D - Many thanks ;-) -- Vi

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread fredvs
Thanks Michael. OK, I know the way, I will try it (but code example is very welcome). Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Pipe-vs-Memory-buffer-tp5727435p5727444.html Sent from the Free Pascal - General mailing list arc

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread fredvs
> didn't understand the software structure / problem behind the C-> > Pascal translation Huh, IMO, the translation is ok. The problem is that the method ask for a memory buffer and I give a pipe. > but for me named pipes work very well for many kinds of interprocess > communication. Yes, for ex

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread fredvs
Hello. Some news from the front: var BufferURL : array of float; . PipeBufferSize := $4000 ; CreatePipeHandles(InHandle, OutHandle, PipeBufferSize); InPipe := TInputPipeStream.Create(InHandle); OutPipe := TOutputPipeStream.Create(OutHandle); httpget := TThreadHttpGetter.Create(opus_ur

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread fredvs
Thanks Silvio, I will try it tonight. Write you later. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Pipe-vs-Memory-buffer-tp5727435p5727457.html Sent from the Free Pascal - General mailing list archive at Nabble.com.

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread fredvs
Hello Silvio: Yes, we are on the good way. Following your advice, here from https-url-opus the result of : var BufferURL: tbytes; setlength(BufferURL, PipeBufferSize); CreatePipeHandles(InHandle, OutHandle, PipeBufferSize); InPipe := TInputPipeStream.Create(InHandle); OutPipe := TOutpu

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-27 Thread fredvs
Hello. > Some streams requires you set its cursor to 0 before writing/reading > buffer, so you need to check it: > OutPipe.Seek(0, soBeginning); > InPipe.Seek(0, soBeginning); > InPipe.Read(BufferURL[0],PipeBufferSize); => "Exception at 0043A720: EPipeSeek: Cannot seek on pipes." >

[fpc-pascal] Something like TProcess.Environment for libraries ?

2017-01-27 Thread fredvs
Hello. If you are using a TProcess and your executable depends on libraries, there is TProcess.Environment to define the library path, example: AProcess.Environment.Text := 'LD_LIBRARY_PATH=' + alibrarypath; For library, LoadLibrary(alibrary) loads dynamicaly it-self but if the library depends o

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-28 Thread fredvs
Hello. Some other news from the front: var BufferURL, buffadd: tbytes; ... setlength(BufferURL, PipeBufferSize); setlength(buffadd, PipeBufferSize); CreatePipeHandles(InHandle, OutHandle, PipeBufferSize); InPipe := TInputPipeStream.Create(InHandle); OutPipe := TOutputPipeStream.

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-29 Thread fredvs
Hello Lars. Thanks for your brilliant light. > (and can you look into the actual source code of opus or is this closed > source?) ==> https://github.com/xiph/opus And translation into fpc-Pascal: ==> https://github.com/fredvs/uos/blob/master/src/uos_opusfile.pas Fre;D -

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-29 Thread fredvs
> you should specify {$PACKRECORDS C} Nice tip ! Added in each unit that deal with c libraries. Many hanks. Fre;D PS: But this did not help ;-( - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Pipe-vs-Memory-buffer-tp5727435p5727494.h

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-29 Thread fredvs
@ Lars: The library used for op_memory_open and op_seek is libopusfile.so: https://github.com/xiph/opusfile Translation into fpc-Pascal of the header: https://github.com/fredvs/uos/blob/master/src/uos_opusfile.pas And Opusfile.so depends on libopus.so : https://github.com/xiph/opus

Re: [fpc-pascal] Something like TProcess.Environment for libraries ?

2017-01-29 Thread fredvs
Hello. After googling, I found that it is possible to use a parameter for the linker: http://stackoverflow.com/questions/2726993/how-to-specify-preference-of-library-path For a c program: "Use the rpath option via gcc to linker - runtime library search path, will be used instead of looking in st

Re: [fpc-pascal] Something like TProcess.Environment for libraries ?

2017-01-30 Thread fredvs
Hello Jonas. > -k-rpath -k$(DEFAULT_LIB_INSTALL_PATH), or "-k-rpath > $(DEFAULT_LIB_INSTALL_PATH)" Ok, excellent. Does it work while linking libraries too ? Thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Something-l

Re: [fpc-pascal] Something like TProcess.Environment for libraries ?

2017-01-30 Thread fredvs
Re-hello. Is it cross-platform (does it work for Windows too) ? Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Something-like-TProcess-Environment-for-libraries-tp5727468p5727525.html Sent from the Free Pascal - General mailing li

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-30 Thread fredvs
Hello Lars. Many thanks to spent your time for us. But after lot of test and re-test, my conclusion is: op_open_memory() is buggy. It looses the pointer assigned to the input-buffer of bytes. And when using op_read() it points to nil in place of buffer-in. Voila. (But maybe I m wrong...). F

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-31 Thread fredvs
> op_open_memory() is buggy. > (But maybe I m wrong...). Yes I was wrong. Opus needs a bigger buffer than mp3, increasing the size fixed it. It works, sound is perfect from a https too. Only remain a problem: after 10 seconds of playing, op_read_float() does not give output. I must study deep

Re: [fpc-pascal] Something like TProcess.Environment for libraries ?

2017-01-31 Thread fredvs
Many thanks for your light Jonas. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Something-like-TProcess-Environment-for-libraries-tp5727468p5727536.html Sent from the Free Pascal - General mailing list archive at Nabble.com.

[fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Hello. I have done lot of search on internet about pipes without success. Even for Delphi. no demo nor explanation. The same in fpc wki page. For example, how to use bytesavailable with pipes ? In: CreatePipeHandles(InHandle, OutHandle, APipeBufferSize); InPipe.Read(Bufferout[0],BPipeBufferSi

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Many thanks Mattias. Huh, and about bytesavailable ? See here: CreatePipeHandles(InHandle, OutHandle, PipeBufferSize); InPipe := TInputPipeStream.Create(InHandle); OutPipe := TOutputPipeStream.Create(OutHandle); httpget := TThreadHttpGetter.Create(url, OutPipe); // is length ok ? setlength(B

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Hello. Some more explanation. With that code, only +- 10 loops are working, after, no more Ouframes... why ? const FramesWanted : 640; PipeBufferSize : 10240; BufferURL, BufferTemp : tbytes; BufferFloat : array of float; ... setlength(BufferURL, PipeBufferSize); setlength(BufferTemp, FramesWa

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Ho Andrew, nice to read you. ;-) I battle hard to use your Thttpgetter for Opus, like you did for mpg123. The difference with mpg123 is that Opus needs a buffer (mpg123 a named pipe). I am nearly sure that the problem comes from my code to get the buffer from the pipe: while (outst2 < FramesW

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Hello Jose. >The fact that op_read_float is zero is not an error, simply the amount of samples read by opus engine is zero Exactly. I know that isnot a error otherwise OutFrames < 0. >simply the amount of samples read by opus engine is zero. Exactly too and this because my conversion pipe into

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Re-hello. Some more news: OK, I make work a other method: op_open_callbacks(InPipe, op_callbacks, BufferURL[0], PipeBufferSize, err); This method use a named pipe and can be use of the box with Andrew's THttpgetter. No need to do complicated conversion of pipe into buffer. op_callbacks does

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread fredvs
Huh, sorry to monopolize but... I get it. ;-) Changing the built-in read-callback method with this: function OpusReadCB(stream: Pointer; var buffer; nbytes: cint): cint; cdecl; begin if nbytes<>0 then result := TInputPipeStream(stream^).read(Buffer, nbytes) else result := 0; end; Do

Re: [fpc-pascal] fpc and voip ?

2017-02-02 Thread fredvs
Hello. I am happy to announce that uos does internet-streaming with opus files. Take a look at conswebstream and simplewebplayer demos. https://github.com/fredvs/uos Here demo (ok, the sound is not perfect because the video recorded the sound from the mic, but in real the sound is perfect

Re: [fpc-pascal] fpc and voip ?

2017-02-02 Thread fredvs
> Hi freedvs, does it mean with UOS I can create an audio streaming server via HTTP?. If you convert your audio file into opus-file, no problem. But for live audio streaming server... I take a little break and then, it is the next battle. I can already encode the incoming pcm into Opus file. B

Re: [fpc-pascal] fpc and voip ?

2017-02-02 Thread fredvs
> Anyway mp3 technology is surpassed a lot by others. Hum, first shots with Opus: - For same quality, size of Opus is 20 % smaller than mp3. - You may encode in different modes (voice, audio,..). - Tag is much easier to access/edit than mp3. - Opus: only one sample-rate: 48k (easier for mixing

[fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-10 Thread fredvs
Hello. There is myprogram.pas in /home/me/myproject/example. This program uses myunit.pas from /home/me/myproject/src. myunit.pas uses myunit2.pas and myunit3.pas that are also in home/me/myproject/src. Using this: program myprogram; ... uses myunit in '../src/myunit.pas'; load indeed /home/m

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
> Why is using -Fu hard? Yes, of course it could be a solution but I would prefer something inside the code. By the way, IMO, and it is valable for lot of languages, the way to define/use the path (of units or libraries or dependencies) is very archaic. Only LD_LIBRARY_PATH for libraries and fo

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
> Loading libraries is handled by the OS, not by the compiler or the RTL > and every OS has its own way to deal with dependencies. Yes but the compiler could give some command to the os too... Of course every OS has its own way to deal with dependencies but that is the power of fpc, he knows ho

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
> But thinking that the compiler itself will automagically determine the path: that's simply not realistic. Really ? When the compiler reads uses section and find a "in" like here : uses myunit in '/thepath/src/myunit.pas'; He could do something like: ... if fpcword = 'in' then begin IncludeS

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
>> For example, TProcess also is very os dependent and it uses "environnement" >> parameter (that is also very os dependent). > No it is not. Every OS has an environment ? So it is exactly what I propose: a TLoadLibrary with some features adapted for libraries that TProcess uses for executable

<    1   2   3   4   5   6   >