System Sounds

Want a new feature? Discuss what you would like to see in Ultibo.
pik33
Posts: 788
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: System Sounds

Postby pik33 » Fri Nov 09, 2018 4:31 pm


So Ultibo does have already a GUI with a window manager !??



It is only a starting point for GUI. The window manager started from my another project, the retromachine. The retromachine was 8-bit, so this gui is still 8-bit. All you can see is 8-bit color depth framebuffer. This started to be annoying, the window manager can and will be rewritten for 32-bit color depth. The question is free time, but I want to use this GUI in a commercial project, so this will be done maybe in this year.

Then there is a lot to do with widgets, I have only windows, icons, buttons and nothing else.

Does the window manager follow classical atoms way (gdi or x11)?



It follows nothing :) it was written from scratch without looking at anything else.
The API is simple. The window is a class: you call create and your window will appear on the screen. The window has a canvas on which you can put pixels and call other graphic function (box, line), you can also output a text. There is a move function which moves the window on the screen. The window doesn't have to do anything to be drawn on the screen: the system redraws all windows every vblank.


All window manager stuff is here: https://github.com/pik33/ultibo_retro_g ... indows.pas

The simplest example how to use these windows is mandelbrot unit: https://github.com/pik33/ultibo_retro_g ... elbrot.pas

Huh, litle bemol, I was not able to test the programs of the desktop because the mouse and the keyboard do not respond...


Try to disconnect the keyboard, it can do nothing at the main screen, There was a bug in Ultibo caused 2 low speed devices to work incorrectly when attached to the same hub. As I can remember it was fixed but I am not 100% sure.

My mouse code is highly experimental and your mouse may be not compatible with it. Also, the mouse procedure can get confused if the mouse moves while the program starts (a known bug in my project). Or there is a bug in the project which I don't know about (yet).

Don't move the mouse while the GUI boots. Wait a second or two after the GUI started, then try to move the mouse. If it doesn't move, try another mouse. If the mouse works while the keyboard is not attached, try to attach the keyboard with and/or without external hub. Open the text editor and try to write some text.

Not all icons on the desktop are active. You can run the player, the mandelbrot, system status, calculator and the very early stage of the text editor. If you have a camera you can try a camera test. FM Synth will give you a window with some numbers - I am now developing it on PC: the proper debugger allows to do it faster. You can find the synth on my github. The rest of icons are inactive

Do you mean, for example, gcc installed on a Linux Raspbian distro?


Yes, I did all my libraries used in the project (libmad and libxmp) using standard Raspbian tools. Having Ultibo installed on Raspbian I don't need any other computer to play with it. You can find a minimp3 library in the project: I used it earlier for mp3, but I changed this to libmad as the minimp3 introduces way too much noise to the decoded sound.
fredvs
Posts: 29
Joined: Tue Sep 25, 2018 11:57 am

Re: System Sounds

Postby fredvs » Fri Nov 09, 2018 7:32 pm

Hello.

@pik33 :
I will study all this.
Write you later.

Thanks.

Fre;D
fredvs
Posts: 29
Joined: Tue Sep 25, 2018 11:57 am

Re: System Sounds

Postby fredvs » Sat Nov 10, 2018 1:09 pm

Hello.

OK, unplugging the keyboard makes the mouse work.
But not perfectly, only vertical, sometimes horizontal.
2x click works sometimes too (but very rare).
Plugin the keyboard after boot enable it.
I was not able to make the Player work.
Text editor is working and keyboard too.

About the mouse, maybe I have to buy a other.
But running the MouseCursor-Ultibo demo ---> the mouse works perfectly.

Anyway, your project is great and if MSEgui and/or fpGUI could be integrated, it would be the top.

Fre;D
pik33
Posts: 788
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: System Sounds

Postby pik33 » Sat Nov 10, 2018 3:30 pm

This seems to be unrecognized mouse :(
The Ultibo example works because it uses the mouse in the boot protocol. It is the same for all mice.

I use the report protocol because I wanted to use a wheel which the boot protocol doesn't support.
Having too low knowledge about all this USB stuf I simply get the mouse raw data and then the procedure tries to recognize what type of record it is. I tested any mouse I can get in my hand and I discovered 5 different types of mouse reports.
Seems your mouse is the sixth one. :(

If I got some free time, I will write a procedure to dump the mouse reports to the screen/file so maybe I can add this mouse type to the program.
User avatar
Ultibo
Site Admin
Posts: 2079
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: System Sounds

Postby Ultibo » Sat Nov 10, 2018 11:33 pm

fredvs wrote:Is it possible to compile libraries to arm-none from a arm-linux macine (or cross-compile from Linux x86-64 machine)?

The easiest cross compile option for many libraries is to obtain an arm-none version of GCC from https://developer.arm.com/open-source/g ... /downloads and install it on your Linux x86_64 machine.

Many makefiles and configure scripts allow passing options to specify the cross compiler target directly so it can be as simple as adding the cross compiler (above) to your path and running make with the appropriate command line.

For libraries that use ./configure you can often pass --host=arm-none-eabi as a parameter which will tell it to use the arm-none cross compiler, for makefile based projects many allow you to pass the CC parameter on the command line like CC=arm-none-eabi-gcc.

You will also need to supply the correct CFLAGS which we have documented in this HOWTO post.

For example, to compile the standard ZLib library for Ultibo (on Raspberry Pi 2 and 3) all you need is a command line like this:

Code: Select all

CC=arm-none-eabi-gcc CFLAGS="--specs=nosys.specs -O2 -mabi=aapcs -marm -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D__DYNAMIC_REENT__" ./configure --static --prefix=$HOME/zlib/armv7

Not all of them can be compiled without change but once you work out the correct parameters many don't need a lot of extra work.

fredvs wrote:Do you know what is the stage of dynamic loading of libraries (beginning/ on work/ nearly finish) ?

Dynamic libraries support (DLL and SO) is a work in progress and we have a working prototype that can load and execute code from a dynamic library.

Initially we planned to expand FPC further to allow creating libraries for the Ultibo target but the concept never seemed quite right so we didn't proceed, it was only while working on the C API for Ultibo that we finally realized how the dynamic library support should work.

Instead of extending FPC to make it create Ultibo specific libraries we are working on extending Ultibo so it supports loading Linux and Windows libraries, this will mean that almost any compiler capable of creating a dynamic library for Linux or Windows will be able to be used to create libraries for Ultibo and the C API will become the glue that supports not only developing in other languages but also the framework for dynamic linking of exported functions.

Now it won't be possible to take unmodified Linux and Windows libraries and run them in Ultibo, they will still need to be rebuilt to remove many Linux or Windows specific API calls but you will now have a choice of which compiler to use rather than being stuck with FPC only.

It's always a good idea to keep an eye on the Current Status page to see where support for new features is up to.
Ultibo.org | Make something amazing
https://ultibo.org
fredvs
Posts: 29
Joined: Tue Sep 25, 2018 11:57 am

Re: System Sounds

Postby fredvs » Mon Nov 12, 2018 1:39 pm

Ultibo wrote:
fredvs wrote:Is it possible to compile libraries to arm-none from a arm-linux macine (or cross-compile from Linux x86-64 machine)?

The easiest cross compile option for many libraries is to obtain an arm-none version of GCC from https://developer.arm.com/open-source/g ... /downloads and install it on your Linux x86_64 machine.

Many makefiles and configure scripts allow passing options to specify the cross compiler target directly so it can be as simple as adding the cross compiler (above) to your path and running make with the appropriate command line.

For libraries that use ./configure you can often pass --host=arm-none-eabi as a parameter which will tell it to use the arm-none cross compiler, for makefile based projects many allow you to pass the CC parameter on the command line like CC=arm-none-eabi-gcc.

You will also need to supply the correct CFLAGS which we have documented in this HOWTO post.

For example, to compile the standard ZLib library for Ultibo (on Raspberry Pi 2 and 3) all you need is a command line like this:

Code: Select all

CC=arm-none-eabi-gcc CFLAGS="--specs=nosys.specs -O2 -mabi=aapcs -marm -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D__DYNAMIC_REENT__" ./configure --static --prefix=$HOME/zlib/armv7

Not all of them can be compiled without change but once you work out the correct parameters many don't need a lot of extra work.


Excellent and thanks for that clear explanation.

Ultibo wrote:
fredvs wrote:Do you know what is the stage of dynamic loading of libraries (beginning/ on work/ nearly finish) ?

Dynamic libraries support (DLL and SO) is a work in progress and we have a working prototype that can load and execute code from a dynamic library.

Initially we planned to expand FPC further to allow creating libraries for the Ultibo target but the concept never seemed quite right so we didn't proceed, it was only while working on the C API for Ultibo that we finally realized how the dynamic library support should work.

Instead of extending FPC to make it create Ultibo specific libraries we are working on extending Ultibo so it supports loading Linux and Windows libraries, this will mean that almost any compiler capable of creating a dynamic library for Linux or Windows will be able to be used to create libraries for Ultibo and the C API will become the glue that supports not only developing in other languages but also the framework for dynamic linking of exported functions.

Now it won't be possible to take unmodified Linux and Windows libraries and run them in Ultibo, they will still need to be rebuilt to remove many Linux or Windows specific API calls but you will now have a choice of which compiler to use rather than being stuck with FPC only.

It's always a good idea to keep an eye on the Current Status page to see where support for new features is up to.


Ha, ok.
IMHO, if you could make Ultibo dynamic loading of library friendly it will open lot of doors and, even more, if Ultibo could load library for Linux or Windows then Ultibo will be the Winner and the King.

Many thanks.

Fre;D

Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 1 guest