Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

development of code without its-pointless #7

Open
RalfWerner opened this issue Feb 3, 2025 · 8 comments
Open

development of code without its-pointless #7

RalfWerner opened this issue Feb 3, 2025 · 8 comments

Comments

@RalfWerner
Copy link
Owner

RalfWerner commented Feb 3, 2025

Thanks @robertkirkman for the explanations and support in setting up audacity and the mozilla tools. I had already followed the Discord dialogue. I would prefer to continue the last discussion here.

I've been using proot since the repo started, especially for packages that are not available natively. The loss in performance, which I have checked for various applications, is too high for me. But this is acceptable for my favorite editor nedit.

My complete code can be compiled in proot too (debian and ubuntu checked). But I cannot pass it on because it belongs to Airbus and I have signed a confidentiality agreement. The code in this repo I wrote privately or after I left. However, it is a work in progress and only partially up to date here.

Since I have been developing with X11 for almost 40 years, I am familiar with the possibilities. For example, with DISPLAY=192.168.178.32:0 XServer on win10 on a PC in WLAN, audacity the can also be used , as in this post. However, the sound still comes from the pad and is finished before that can be seen in the window timeline - not a good idea. X11 tools like feh can also be started from PC-ssh on the mobile phone and since stdin is also used in addition to XEvents, it can be controlled from the PC-KB as well as with Fingers on mobile.

I have done checks with lfortran, which work for small examples. However, the code from partially 60 years ago by my colleagues from Germany, France, Spain and England produces huge amounts of errors.

I can live with the fact that the installation is a bit more complicated for me, because I now know what to do - thanks again. If you are interested (and you understand me) you can have a look at the explanations for OTS and here. I am currently writing a new IP Object for the mozilla tools. its-pointless is not necessary for this, so there should be no problems and will insert audacity. I will report when I get around to it and have checked it.

@robertkirkman
Copy link

Hello,
I understand that the Fortran code might not be possible to upload here due to license restrictions.

I looked in this repository for the Fortran code, but I only see code which automates the installation of the libgfortran5 package.

h=https://its-pointless.github.io p=pointless.gpg s=u/etc/apt/sources.list.d
$e deb $h/files/24 termux extras>$s/gcc.list; wget $h/$p;apt-key add $p; rm $p; pkg up
pkg in setup-scripts gcc-9 libgfortran5 libmpc libisl htop-legacy; setupclang-gfort-9

I do see that there is a comment referencing a "issy.f" , but I do not see an issy.f in the repository.

/* TEST head -n 9 check.c|grep -v grep >makefile gfortran needed for issy.f

Would that issy.f be part of the code that you unfortunately cannot show?

@RalfWerner
Copy link
Owner Author

As I said, the source code is only partially up to date. Two scripts are needed for one object. These are bashrc and uu.sh, which are stored in an SD/sd (storage device) that is outside of Termux and in ~ are used as a symlink. The data and sources of the object are also in $SD, but vary depending on the object's purpose.

In #6 I used an object that run in termux firefox, thunderbird and soon audacity too. make is not necessary for this. So there should be no conflicts between pulseaudio and gfortran, if this is all that is needed on the device.

I recorded the following audacity-shot for you. But libmp3lame is already in my packages. Do you have an explanation for this (why download or use the lib)?
image

Are you also working with the tool or just on the installation?

You haven't said anything about this question yet!

Hidden Source

The object in the repo here could be used to develop a new Airbus. I've done this together with my colleagues with all the other variants except for the A300 (before my time). E.g. A320, A380, Beluga and also an H2 variant in the 90s and many others that were never built.

issy.f is a general management module similar to a Win Explorer or pcmanfm, but which also contains aircraft-specific components and functions.

This also includes the analysis of specific formats from functions and simulations. Comparable to PDF, which most Explorers can also do. However, the functions for generating such "PDF" data are not included. The functions, contained in issy.f, can process these formats. Which can be used to animate an aircraft crash similar to blender or to display all critical components in the aircraft in colors with their associated loads and much more.
Even if this "PDF" data is not there, the reading code could be hacked or the code for printing out an official approval report - so better not.

For new objects I would use languages ​​other than Fortran (e.g. check.c) but these are not up to date. In IP objects only sources are managed and make is done before each execution. They are also _platform independent and OTS, i.e. a virgin device, would also work. But the first time it would be a bit more than one touch. But it also contains all the required *.apk. If you want to use an object I could update the sources here.

@robertkirkman
Copy link

robertkirkman commented Feb 4, 2025

About the Audacity MP3 export problem

It is possible to export MP3s with audacity, but for now, yes, it is necessary to manually browse and select the libmp3lame.so.

You need to choose "Browse", then select "Primary shared object files" in the bottom right corner, then browse to this folder:

/data/data/com.termux/files/usr/lib

Then select libmp3lame.so, then click "Open". After that, MP3 exporting will work.

Image

You are correct that it would be more convenient if the Termux packages fixed this to be automatic, so I have opened a PR here to make that more convenient in the future.

Are you also working with the tool or just on the installation?

You haven't said anything about this question yet!

I am not sure if I fully understand this question,

I use Audacity on both GNU/Linux and Android sometimes, but I would not say I use it every single day. I use it for a wide range of tasks like audio editing and audio conversion when necessary.

About the "one touch on virgin device" Termux automation subject

If you are interested in using Termux-based technology to implement "True one touch" installers for various things,

I have a project termux-generator that is designed for the purpose of autogenerating custom Termux-based .apk files that can be installed, and once installed they do not conflict with the official Termux, which can remain installed and running separately, and an unlimited number of standalone .apks can be generated and installed alongside each other, each with custom startup scripts, custom GUI Activities, or other customizations, built into the .apk file and automatically active from the moment the App is first launched.

(This could be described as a "Termux Fork Generator")

My project is functional, however, it is intended primarily for advanced users, who understand how to compile Termux entirely from source code already, but just need a tool to speed up the process for convenience. I am not sure whether it would be useful for your needs.

@RalfWerner
Copy link
Owner Author

This could be described as a "Termux Fork Generator"

That's an interesting idea. I also described a similar process in #2 and checked it a few times. To do this, I manipulated the Termux build with the aim of overcoming the "API 28 hurdle" (#2155). First, all "ELF" files from $PREFIX are moved to the native apk area and replaced there with symlinks. So termux.apk with targetSdkVersion=31 can also be created easily.

Disadvantage: all "ELF" files must exist beforehand, the process can only be done for one arch. Subsequent make is no longer possible (>28) and the apk file may become very large. In addition, several packages change every day and X11 also changes very often.

Advantage: the installation process is easier because the update is already included in the apk. Even after many years of Termux development, such apk would still do the same if Google still supported it. The source codes do not need to be included in the object.

But this can also be achieved by a simple backup-restore of $PREFIX after the bootstrap or termux-reset. This extended bootstrap is currently the easiest way for me to stay up to date. All of the above processes are described in uu.sh.

I use Audacity on both GNU/Linux and Android sometimes

great, then you will be able to load the mp4 that I sent you (played). I pull the Win version in German over the Termux version. In X11 I use Direct touch and a pen/stylus.
Here two shots of Win (left) and Termux (right):
Image
In Win I've a lot of languages in X11 english only.

I reduced the range to 2 seconds. The play, pause and stop buttons don't work with my fingers, but they do work with a BT mouse or pen/stylus. Audacity also works without WM. The two arrows (right) can be used to move and resize. I haven't found a way to use the scroll wheel without a mouse. I can, because I have ^ in the EK line do it with. The mouseHelper (in front) unfortunately doesn't work with this touchMode, but the stylus_Helper above it does but is difficult to find (underlined in green) Is that the case for you too?

At the end of the clip there is an over-modulation that I haven't been able to fix with any effect so far. Since I got Davinci Resolve Fairlight I use it more often than Audacity but at this point also without success, except for sample size. Do you have any idea?

@robertkirkman
Copy link

robertkirkman commented Feb 5, 2025

API >28 W^X problem

Google Play Termux, which termux-generator uses, is the version of Termux where Fornwall has created and is working on a future solution to that problem. The details are very complicated, but you can see here that the current version of Termux on Google Play, and also all copies of Termux that termux-generator builds, are currently working with API level 35 thanks to that work. There is still more to be done and issues to be solved with it before F-Droid Termux will be able to contain the same solution, so F-Droid Termux will remain on API level 28 until everything is ready. I believe that make does work in most cases in the current Google Play Termux.

Audacity English only

Unfortunately, due to this part of Android operating system source code, the normal packages from pkg install in Termux that are providing the same software you see on desktop PCs cannot provide languages other than English.

the only packages in Termux that are not affected by that limitation are "glibc"-linked packages, such as the packages from inside proot-distro enter debian and also packages from pkg install that have "-glibc" at the end of their names after pkg install glibc-repo has been run, and rarely, there are sometimes individual apps that have non-standard translation backends in their code, which have a chance to work.

Audacity play, pause, record and stop buttons not working with fingers only in "Direct Touch" mode

I might be able to help someday with this problem, if I get time to, because I have experience with touchscreen application programming. I have fixed very similar bugs in a number of other applications, but I have not worked on the upstream code of Audacity yet. Unfortunately, even for me, it can take a very long time to correctly solve that type of bug, and test that the solution works correctly on all devices and operation modes.

My experience tells me that the bug technically comes from the upstream code of Audacity not being heavily tested by their developers on touchscreen devices (and therefore cannot be fully solved purely through the code of the Termux:X11 app, only worked around using alternative modes like the "Touchpad" mode). That can be confirmed if you have an Ubuntu Tablet or other non-Android Linux Touchscreen device, because you would find that if you open Audacity there, the same bug is still present.

I noticed that the Audacity developers are in fact aware of the bug, but they have officially marked it as "wontfix" because they also have limited resources and other bugs to prioritize, so they want to work on other issues and then maybe come back to this problem in the distant future.

I do not have a touch pen, so usually when using Audacity in Termux:X11, I use "Touchpad" mode, rather than "Direct Touch" mode, unless I am using Scrcpy, in which case I switch it to "Direct Touch". In "Touchpad" mode, two fingers or two thumbs scrolling works. I am not sure about the mouseHelper or stylusHelper.

overmodulation at the end of the clip

I do not know any specific way to consistently remove it in postprocessing, but I usually use hardware assistance to help reduce this problem, in the form of the "pop filter" device.

Image

@RalfWerner
Copy link
Owner Author

RalfWerner commented Feb 5, 2025

...is the version of Termux where Fornwall has created

That's good to hear. When I started working with Termux, I was often in dialogue with Fornwall and I was very happy to see him back in the team. He had said goodbye after the birth of his second "real" child - the right priority. Now he has found his "virtual" child again:)
At times I had worked in parallel with playstore and github versions with self-made apk, but this is quite time-consuming on the same device and is associated with delays. When the two versions are merged, I will come back to your suggestion.

Audacity English only

I thought so - thanks for the research. Since the problem with the Mozilla tools has been solved, I had hopes with Audacity too. But I can live with the English version. In shot above is firefox was that obviously solved.

they have officially marked it as "wontfix" because they also have limited resources

Here and here too, I had made suggestions for improving the HELPER. Actually, only one is needed for all input devices. I am currently working on an XClient that allows this but It would be better to implement this in the XServer (@twaik means: wontfix.)

I might be able to help someday with this problem ("Direct Touch" mode)

The problem also exists with X11. I've now switched my XClients to the DM="Direct mode" setting. The current XServer with Simulated touchscreen no longer has the corresponding function in 01.02.04 (simple gesture tap-move-release was still possible) but still has tap-release today remains. This means that play, pause, stop buttons with fingers is possible if movements are avoided.

Many XClients like audacity and fluxbox, assume the existence of simple gestures and therefore have some problems with DM. DM is actually intended for something else, as it processes generic events. This means that the touchscreen can be operated with 10 (small) fingers or more at the same time. For this reason, I have also removed all multi-finger actions from the X11 preferences so as not to cause conflicts. In the video below you can see this from sec 18 with 1,2, 3 heards and 8 fingers.

I usually use hardware assistance to help reduce this problem

For my 2 seconds, the simplest solution would be to record them again and have more distance from the right microphone. Even if the pan control is pushed all the way to the left (15 cm from the right), Robert can still be heard on one ear well:)
The video below show this in the first 7 seconds and try to open HELPER (Sec:8-10)

Direct-Mode.mp4

Audacity (second: 0-7 switch Audio on), change of touchMode (by Pop-EK over KB: 12-18), check my modified Example from xorg-Developer Peter Hutterer for multi-touch ('touch.c' with TEST=4).

@robertkirkman
Copy link

robertkirkman commented Mar 3, 2025

Hello, I am sorry that before, I told you that a proot would be required to install gfortran.

Today I have found out that there is actually a different build of gfortran that might be easier to install and use on Termux, and has a pathway for officially installing it into Termux without the its-pointless repository.

Here are the commands that work to do it:

pkg install glibc-repo
pkg install gcc-glibc
glibc-runner --shell
gfortran

I would have told you about this earlier if I knew about it, but I didn't realize this was available before now.

I can't test it with your specific issy.f file because of the reasons we discussed before, but maybe you could test it, particularly by entering glibc-runner --shell and running all your commands in there, and find out whether it is compatible with your Fortran code?

@RalfWerner
Copy link
Owner Author

RalfWerner commented Mar 4, 2025

Hello, I am sorry that before, ... install gfortran.

Thanks Robert for the research. "Sorry" doesn't fit here though. I could have searched myself. Since I have a stable process, that didn't occur to me. I implemented your installation suggestion and then pkg up. This leads to - see log.

With glibc-runner --shell a new shell (including .bashrc) is opened in which gfortran has a different path. I have a Makefile for issy that processes all sources. I also have 95% of them in Termux. The rest are interfaces to Airbus-specific FE/CAD and management tools (licensed) that cannot be ported. Here is :

a check with the two versions (log):
[~/i/EXE]$ type gfortran
gfortran is /data/data/com.termux/files/usr/bin/gfortran
[~/i/EXE]$ make
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic issy.f -o issy.o
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic xfinit.f -o xfinit.o
gcc -c -w -std=c99 xinit.c -o xinit.o
gfortran issy.o xfinit.o xinit.o -lX11 -lXpm -lXi -lxcb -lX11-xcb -lm -lImlib2 -o /data/data/com.termux/files/home/u/bin/issy.exe
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic pmod.f -o pmod.o
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic psub.f -o psub.o
gfortran psub.o pmod.o xfinit.o xinit.o -lX11 -lXpm -lXi -lxcb -lX11-xcb -lm -lImlib2 -o /data/data/com.termux/files/home/u/bin/pmod.exe
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic gsub.f -o gsub.o
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic lsub.f -o lsub.o
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic lmod.f -o lmod.o
gfortran gsub.o xfinit.o xinit.o lsub.o lmod.o -lX11 -lXpm -lXi -lxcb -lX11-xcb -lm -lImlib2 -o /data/data/com.termux/files/home/u/bin/lmod.exe
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic ksub.f -o ksub.o
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic kmod.f -o kmod.o
gfortran gsub.o xfinit.o xinit.o ksub.o kmod.o -lX11 -lXpm -lXi -lxcb -lX11-xcb -lm -lImlib2 -o /data/data/com.termux/files/home/u/bin/kmod.exe
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic ppscr.f -o ppscr.o
gfortran ppscr.o -lX11 -lXpm -lXi -lxcb -lX11-xcb -lm -lImlib2 -o /data/data/com.termux/files/home/u/bin/ppscr.exe
[~/i/EXE]$ u pu
compare files/packages /data/data/com.termux/files/home/u/tmp/u? /data/data/com.termux/files/home/TMP/u?, opt():u,t?
../usr files:111264 tmp/uf Package:512 tmp/ud
TMP  files:97589 TMP/uf Package:448 TMP/ud
  111264 /data/data/com.termux/files/home/u/tmp/uf
   97589 TMP/uf
  208853 total
  512 /data/data/com.termux/files/home/u/tmp/ud
  448 TMP/ud
  960 total
Diff new:13976,old:237, in /data/data/com.termux/files/home/TMP/Tlog

[~]$ type gfortran
gfortran is /data/data/com.termux/files/usr/glibc/bin/gfortran
[~/i/EXE]$ glibc-runner --shell
Version:'0.118/13=29 target=28 aarch64 192.168.178.73 sshd:13094
moin app_:14362, Xvnc:,openbox:23458
[~]$ cd i/EXE; rm *.o; make
gfortran -c -w -fno-underscoring -fno-automatic -static-libgfortran -frecord-marker=4 -fno-automatic issy.f -o issy.o
issy.f:1036:27:
 1036 |              CALL DXTDEF(0,PL,1,IPL,14,9,KR)
Error: Rank mismatch in argument 'text' at (1) (scalar and rank-1)
...

I have set the options for gfortran so that they work flawlessly on all Unix derivatives I know of. I only listet one "Error" above from one *.f. All for issy.f it's 36 and for psub.f it's 282. I just haven't checked any more than that.

When I have more time I'll investigate further. For now I'm sticking with its-pointless (works).
But with Audacity and Thunderbird I've still some problems. Could you check whether you are experiencing this too?

Audacity

with "Direct touch" could not used to Start/Stop Play or Record Buttons like using "Simulated touchscreen". But with this "touchMode" simple gestures that are often used are not possible!

Thunderbird

Editing a draft with images is not possible. They are blocked, which I cannot cancel and are lost after saving. I've prepare an example in In #6 to repeat it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants