galaxysite / gorg64

The organizer includes a clock with an alarm, a scheduler, a notebook and a tool for working with a clipboard. For GNU/Linux 64 bit version.
GNU Affero General Public License v3.0
4 stars 1 forks source link

Release? #25

Open fredvs opened 1 week ago

fredvs commented 1 week ago

Hello.

Maybe it is time to publish a release... https://github.com/galaxysite/gorg64/releases With the deb file (maybe, if possible, compiled with fpc-ootb so it should be installable on old, present and future Linux os). Also give the tar file produced by make ootb (also, if possible, compiled with fpc-ootb). ?

(Or better wait to finish the language for some other forms, like flash, people and organization, settings ...?)

And what is the format of your *.speaker files? Do you think it would be possible, for new laptops that does not have the pc-speaker pins, to use the root libasound.so.2 like demos there: https://github.com/fredvs/alsa_sound ?

galaxysite commented 1 week ago

I made first test release.

fredvs commented 1 week ago

Congratulation!

galaxysite commented 1 week ago

Same to you!

I tried to make a player, but alsa_sound was too slow. I'll still attach it for testing.

The format consists of pairs of words and is very simple. First comes the tone, then the duration. And then in a cycle. Duration in FPC Sleep units. Tone directly in PC-Speaker units: tone = 1193182 / frequency. gorg64_spkplay_alsa.zip

fredvs commented 1 week ago

gorg64_spkplay_alsa.zip I tried to make a player, but alsa_sound was too slow.

But... here on my laptop Lenovo i5 it is perfect. The only thing that I changed is to set the last parameter CloseLib: boolean of ALSAbeep() and ALSAsilence() to false.

If you set it to "true" the library will be unloaded after the method is done calling as_unload . And so, each call to a new ALSAbeep() or ALSAsilence() in the loop will need to reload the library and it can take a certain delay + delay to close it.

Usually the last parameter CloseLib=true is used for the last call of a ALSAbeep() in a loop (see demo alsa_sound_test.pas.)

Or let do it by alsa_sound and his finalization:

unit alsa_sound;
...
finalization  // in case if library was not unloaded.
as_unload;

Here your updated gorg64_spkplay_alsa.zip

gorg64_spkplay_alsa.pas_nofree.zip

[EDIT] I did test many of your *.speaker files, it works perfectly here, what do you mean with _but alsasound was too slow. ? Here the tempo is normal (even that I find that BACH1.speaker is played a few too fast, but the sound is clear and wow).

galaxysite commented 1 week ago

On my computer, it's slower. I checked this file playing with normal priority 1.04 minutes (speaker via I/O ports) against 1.55 (ALSA). At maximum priority (nice -20) 1.04 minutes against 1.09. But it still sounds good. In this variant, it can be used. I made a version with an attempt to detect the laptop and enable playback via Alsa.

fredvs commented 1 week ago

On my computer, it's slower. I checked this file playing with normal priority 1.04 minutes (speaker via I/O ports) against 1.55 (ALSA).

Not sure to understand. Are you saying that if you play amusic.player file with your speaker app via I/O ports, the duration of playing the file is shorter than if you play it via alsa (and so the tempo is faster but the frequency is ok?) If so, it is indeed strange sadly I cannot test it on my laptop. Maybe there is a problem with duration in alsa_sound.pas, I will check it.

I made a version with an attempt to detect the laptop and enable playback via Alsa.

Great, I will test it tonight!

fredvs commented 1 week ago

About the duration of alsa_sound.pas.

Could you try this, in line 159, comment the line as follow:

function EnsureDuration(const AValue: cint): cint; inline;
begin
 result := abs(AValue);
//  if result < 50 then result := 50;   // comment this line
end;

Is it better?

galaxysite commented 1 week ago

Is it better?

Not.

frequency is ok

Yes. Good frequency. Bad tempo.

I make video: http://soft.self-made-free.ru/out.mp4

fredvs commented 1 week ago

Indeed on your system it is different as mine:

alsa_gorg.mp4.zip

?

fredvs commented 1 week ago

OK, I did test your last commit. When using make ootb, all is ok, the *.player music is playing nicely when the alarm comes.

Here the message from console:

IdeaPad ~/g/gorg64 (main)> /home/fred/gorg64/gorg64/gorg64
Error get ports access. h42-43, h61 Ошибка открития портов.
RetVal1=-1, RetVal2=-1
Need root access. Нужен режим   пользователя root.
GALAXY ORGANIZER SPEAKER PLAYER Version 3
Artyomov Alexander 2024  License: GNU AGPLv3 and above
Use: gorg64_spkplay or gorg64_spkplay somemusic.speaker somemusic2.speaker ...
UID=1000 EUID=1000
Now UID=1000 EUID=1000
renice: failed to set priority for 76490 (process ID): Permission denied
May be running on notebook ? File platform-pcspkr-event-spkr not exists.
Not access to PC-Speaker. Use ALSA.
* Playing file: /home/fred/gorg64/gorg64/music/TEAPOT.speaker

But when trying the version from make deb install, the *.player are not played. This are the message from console:

fred@fred-IdeaPad ~> gorg64
Error get ports access. h42-43, h61 Ошибка открития портов.
RetVal1=-1, RetVal2=-1
Need root access. Нужен режим   пользователя root.
GALAXY ORGANIZER SPEAKER PLAYER Version 3
Artyomov Alexander 2024  License: GNU AGPLv3 and above
Use: gorg64_spkplay or gorg64_spkplay somemusic.speaker somemusic2.speaker ...
UID=1000 EUID=0
Now UID=0 EUID=0
77006 (process ID) old priority 0, new priority -20
May be running on notebook ? File platform-pcspkr-event-spkr not exists.
Not access to PC-Speaker. Use ALSA.
* Playing file: /home/fred/.gorg64/music/TEAPOT.speaker
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! 
(This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, 
over the native protocol. Don't do that.)
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
galaxysite commented 1 week ago

I try InitSpk after fpSetUID. May be in Ubuntu need SetUID ?

gorg64_spkplay.zip

fredvs commented 1 week ago

No, did not help.


fred@fred-IdeaPad:~/gorg64_work$ gorg64
GALAXY ORGANIZER SPEAKER PLAYER Version 3
Artyomov Alexander 2024  License: GNU AGPLv3 and above
Use: gorg64_spkplay or gorg64_spkplay somemusic.speaker somemusic2.speaker ...
UID=1000 EUID=0
Now UID=0 EUID=0
82668 (process ID) old priority 0, new priority -20
Error get ports access. h42-43, h61 Ошибка открития портов.
RetVal1=-1, RetVal2=-1
Need root access. Нужен режим   пользователя root.
May be running on notebook ? File platform-pcspkr-event-spkr not exists.
Not access to PC-Speaker. Use ALSA.
* Playing file: /home/fred/.gorg64/music/TEAPOT.speaker
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave

I did try with sudo gorg64 and same error.

fredvs commented 1 week ago

Stop! I get it. After some research on the web (many people have that error), the solution is...

---> Reboot after install a deb that needs access to alsa.

;-)

Indeed, after re-boot ,now the *.player files are working. (Maybe add the tip somewhere in the help-install file.)

galaxysite commented 1 week ago

Good !

fredvs commented 1 week ago

Yes, perfect.

Now, only need to finish the (boring) work: enable translation for the forms not yet translated. Also, at the moment, a part for Russian language, when you change a language, the names of day of week and month are still the one from the system. So it could be nice (but need some more work) to have in the lang files, name of the 12 months and 7 days already translated and use this names, like you did for 'ru' language.

fredvs commented 1 week ago

Hi Alexander. If you want I can do the translation of last forms + months/days by language but not before next week. Or maybe it is better that you do it your way. It is up to you.

galaxysite commented 1 week ago

Fred, I think you can do it better.

Regarding spkplay, I made a clarification today (by running XUbuntu from a Live CD): the platform-pcspkr-event-spkr file is missing in Ubuntu at whole. And on the desktop, where the player works via ports, this file is not there. So the problem with the file is a problem of Ubuntu, and the problem of output via ports is possibly the lack of hardware capability in the laptop. And these are two different problems.

Maybe then delete spkplay and melodies altogether, leaving only the sound? And save spkplay with I/O in a separate version. Or is it okay as is? In any case, I will make a change to the text of the message.

fredvs commented 1 week ago

Fred, I think you can do it better.

I dont think so, but, ok, I will do it (asap).

Or is it okay as is?

Here on XUbuntu 22.04 LTS, spkplay gorg ootb works like charm. spkplay gorg deb works also like charm after reboot. For me it is more than ok like it is. :)

fredvs commented 1 week ago

Ooops, sorry, I clicked on the button [close]. So I said that maybe all the units used to create binary gorg64_spkplay, gorg64runner, ... could be integrated, with some modifs, into source of main gorg64 program and not call it as external. So there would be only one binary: gorg64. And you may create independent github for the independent gorg64* binary apps.

fredvs commented 1 week ago

And for our friends that dont have debian packager (deb) but use RedHat packager (rpm), like Archlinux, Mageia,... There is that nice tool: alien $ sudo apt-get install alien

To make the conversion: $ alien -r /home/fred/gorg64_work/gorg64_2.0.0-1_amd64.deb

Produce a nice and working gorg64-2.0-2.x86_64.rpm. gorg64_2.0.0-1_amd64.rpm.zip

Tested on Mageia 9 and works like charm.

galaxysite commented 1 week ago

I add to release .rpm.

Tested on Mageia 9 and works like charm.

Good ! This is where Pascal's strengths come into play: the resulting code has few dependencies and is highly portable.

galaxysite commented 1 week ago

In (long) future may be touch 3 subject about enhancement functions.

  1. Handle system shutdown process.
  2. TTA codec. And wavfix.
  3. GORG as window manager (e.g. IceWM, XFce ...) ?

1 GORG is fulltime running application and when good realization must handle system shutdown process. Currently, this function not exist and changed (as workaround, as hack) to "save where changed". (Only mmap works as it should in this sense.) But may be in future mseide+msegui and gorg obtain this function? But it's hard to make it work:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1059459 https://bugzilla.kernel.org/show_bug.cgi?id=218266 https://github.com/systemd/systemd/issues/29146 https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html https://systemd.io/INHIBITOR_LOCKS/ https://www.freedesktop.org/wiki/Software/systemd/inhibit/ https://bugzilla.mozilla.org/show_bug.cgi?id=1837907

  1. In current project (Pascal-only) not full-featured tta codec. I make on Pascal simplified and enfasted (as much as possible) compressor unit for only 16-bit sound recording. wavfix stay on C and not included in this project. Not all progs included for sound recording.

  2. GORG could be either a separate program or a window manager with a "flying" panel on top of windows, rather than reducing screen space. Possible with integrated audio player.

Also, main panel of GORG similar to screen ruler. I don't know if this makes sense, but if add (real world) centimeters and inches to the pixel measurement, it might be useful. :)

fredvs commented 1 week ago

Voila, everything has translation now. Maybe you could check if the Russian words are ok.

galaxysite commented 1 week ago

I make 2 screenshots: run from compilation directory and after installing .deb. I do not see display time control in ee.

Снимок экрана_2024-11-23_08-32-59 Снимок экрана_2024-11-23_08-26-39

fredvs commented 6 days ago

Hello Alexander. Aaaargh, I cannot reproduce it. Here, after sudo make deb install selecting Russian language is ok. Sgorg_ru

Do you have that problem with all other language? I just see that the hour-selected panel has moved, I will correct it now. But for the hidden months, I have no idea at the moment.

fredvs commented 6 days ago

It seems on your picture that you dont have the last ru_Russian.txt file. Strange if it was not copied on your system.

fredvs commented 6 days ago

Could you check after installing the deb file, if /usr/share/doc/gorg64/ru_Russian.txt is the same as /gorg64/lang_s/ru_Russian.txt ? I dont see why you have problems, maybe the last /gorg64/lang_s/ru_Russian.txt was not copied into /usr/share/doc/gorg64/?

And if so, strange if it was not copied.

fredvs commented 6 days ago

Re-hello. I try to understand the problem. So I did run it like you did from compiled directory.

fred@fred-IdeaPad:~$ cd /home/fred/gorg64_work/src/
fred@fred-IdeaPad:~/gorg64_work/src$ ./gorg64

But still ok:

alex_prob3

And run it from a other directory, (so it will use /usr/bin/gorg64) or from the Xfce menu /office/GALAXY ORGANIZER icon, the result is ok too.

?????

One thing that I suspect is that maybe when installing the deb, the last languages files from last commit in /gorg64/lang_s did not copy into /usr/share/doc/gorg64/

galaxysite commented 6 days ago

After last commit all ok.

fredvs commented 6 days ago

After last commit all ok.

Ha, ok, nice.

In the eefo there are buttons with red cross. Clicking on it show the virtual keyboard but I dont understand for what it is used. What is the goal of those buttons and the virtual keyboard?

galaxysite commented 6 days ago

GORG can running on keyboardless computers. For example, in the kitchen, where it is either inconvenient or unacceptable to place a keyboard. (If global (and all local) hotkeys working and mouseless.)

If you're interested, users in the past even used it to voice school bells. It has a very wide variety of uses.

I don't know if it's necessary, but since it came to adding a search, then maybe. There are groups in the Gorg and in the old version the search was implemented based on them. I didn't make them in the new one for simplicity, but I laid the foundation. Perhaps in one form or another this can be useful in the new version, and perhaps not. I'll show the work of the old organizer under WINE for this.

http://soft.self-made-free.ru/gorg32_demo.mp4

fredvs commented 6 days ago

Ha, ok, I see yes, maybe in the future a gorg keyboard-free.

Not related but in last pull-request, you may set the height of the main form, to have also a little like in your old gorg-wine or a big that takes all your screen ;-)

galaxysite commented 6 days ago

Excellent! Thank you!