All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Qt application on Xenomai
@ 2019-04-04  1:50 demon.han
  0 siblings, 0 replies; 8+ messages in thread
From: demon.han @ 2019-04-04  1:50 UTC (permalink / raw)
  To: xenomai

Hi, Alec

Sorry for my confused email.
The src files are in mail-attachment now.
Many thanks for your quick response!!

demon.



demon.han@aliyun.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xenomai.pro
Type: application/octet-stream
Size: 3323 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20190404/309a14ef/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: application/octet-stream
Size: 1065 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20190404/309a14ef/attachment-0001.obj>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Qt application on Xenomai
  2019-04-03 12:10 demon.han
@ 2019-04-04  0:39 ` Alec Ari
  0 siblings, 0 replies; 8+ messages in thread
From: Alec Ari @ 2019-04-04  0:39 UTC (permalink / raw)
  To: demon.han, Xenomai

Can you post your source files somewhere? I can't see what's going on because all the code is a paragraph and word wrapped.

Alec


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Qt application on Xenomai
@ 2019-04-03 12:10 demon.han
  2019-04-04  0:39 ` Alec Ari
  0 siblings, 1 reply; 8+ messages in thread
From: demon.han @ 2019-04-03 12:10 UTC (permalink / raw)
  To: xenomai

Hi, Stéphane 
I want to compile RT-task with QT-5.8-linux.
The application build well,but the app break when I run it.
Here are some mesg:
[ 1856.686076] xenomaipro[22438]: segfault at 7ffea0117ff8 ip 00007fef26a3ae17 sp 00007ffea0118000 error 6 in libcobalt.so.2.0.0[7fef26a2f000+1f000]

I can find the program break when it runs : rt_task_create().
How can I fix this? I think the .pro is something missing, but can you fix it please? Many thanks!

My platform is ubuntu16 、linux4.4 and xenoam 3.0.5,using QT 5.8.

My qt project:
main.c:
#include <QCoreApplication> #include <stdlib.h> #include <math.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <sched.h> #include <time.h> #include <unistd.h> #include <signal.h> #include <alchemy/task.h> #include <alchemy/timer.h> RT_TASK task; static void latency(void *cookie) { RTIME start_ns; int ret; start_ns = rt_timer_read() + 1000000; ret = rt_task_set_periodic(NULL, start_ns, 10000000); if (ret) { printf("rt_task_set_periodic error\n"); return; } while(1){ rt_task_wait_period(NULL); printf("0\n"); } } int main(int argc, char *argv[]) { int ret; QCoreApplication a(argc, argv); ret = rt_task_create(&task, "task_name", 0, 99, 0); //break here!!! if (ret) { printf("rt_task_create error\n"); return 0; }
ret = rt_task_start(&task, &latency, NULL); if (ret) { printf("rt_task_start error\n"); return 0; } return a.exec(); }


and .pro is:
QT += core
QT -= gui

CONFIG += c++11

TARGET = xenomaipro
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app

SOURCES += main.cpp

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
#LIBS += -L/usr/xenomai/lib -lalchemy -lanalogy -lcobalt -lcopperplate -lmodechk -lpsos -lsmokey -ltrank -lvxworks -lpthread -lrt
INCLUDEPATH += /usr/xenomai/include
INCLUDEPATH += /usr/xenomai/include/cobalt

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lalchemy

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libalchemy.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lcobalt

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libcobalt.a


unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lanalogy

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libanalogy.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lcopperplate

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libcopperplate.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lmodechk

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libmodechk.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lpsos

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libpsos.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lsmokey

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libsmokey.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -ltrank

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libtrank.a

unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lvxworks

INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include

unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libvxworks.a


demon.han@aliyun.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Qt application on Xenomai
  2019-03-04  7:55     ` Stéphane Ancelot
@ 2019-03-04  8:38       ` C Smith
  0 siblings, 0 replies; 8+ messages in thread
From: C Smith @ 2019-03-04  8:38 UTC (permalink / raw)
  To: Stéphane Ancelot; +Cc: Sumitabh Ghosh via Xenomai

QT will allocate/destruct memory and its overhead and timing are
unpredictable because of its signal/slot architecture - don't try to run QT
in RT space.
Instead, run your QT (C++,etc) application in userspace. Have your QT
application attach to a static shared memory segment which a xenomai RT
thread creates, and put any time-critical code into the RT thread. Send
messages on XDDP sockets (or similar fifos) between the two processes if
necessary. Your UI and multimedia graphics don't really need determinism,
they have only 'soft real time' timing requirements (they can drop frames
or finish late and the human viewer doesn't care). We've done this
architecture for years, on uniprocessor systems, it works well.
- C Smith

On Sun, Mar 3, 2019 at 11:56 PM Stéphane Ancelot via Xenomai <
xenomai@xenomai.org> wrote:

> Hi,
>
> I will share some points from my viewpoint :
>
> The Xenomai impact will depend on the processor architecture selected
> (uniprocessor or multiprocessor).
>
> In uniprocessor context, while your rt application will consume cpu
> time, meanwhile the other scheduled application will be waiting for
> their time slice.
>
> And thus GUI application is interrupted and may be slow in some cases
> (that really depends on the impact of the RT process). In multiprocessor
> context, this becomes no more a problem.
>
> Performance is then dependant on the cpu architecture (x86/x64/arm...)
> and their graphics chip device.
>
> Depending on the graphics chip, the performance needed to drive a 19inch
> size display is not the same as driving a 7inch size display.
>
> There are two kinds of Qt applications these days : Native Qt and QML
> applications.
>
> * Qt is native and can use 2D OpenGL or display framebuffer,
>
> * QML is no more than a javascript application layer running in a
> javascript web engine , in this case you will be performance mainly
> impacted by the QML architecture.
>
> If your GUI application fits only few buttons in a display, then, that's
> not a problem.
>
> Regards.
>
> Stéphane ANCELOT
>
>
> Le 02/03/2019 à 06:57, Sumitabh Ghosh via Xenomai a écrit :
> > Hi Henning,
> >
> > Thanks for your confirmation. Just to understand your set up further,
> does
> > the POSIX layer used by QT is of the Xenomai skin ? Is This the way Qt is
> > leveraging the rt features ?
> >
> > I guess the rendering of graphics is handled through non rt Linux
> > framebuffer /opengl apis.
> >
> > Let me know if my above understanding is correct.
> >
> > Thanks,
> > Sumit
> >
> >
> >
> >
> > On Fri, Mar 1, 2019, 18:02 Henning Schild <henning.schild@siemens.com>
> > wrote:
> >
> >> Hi,
> >>
> >> i am not sure i fully understand the question. In case you are worried
> >> about combining Xenomai and Qt, i can assure you that it is possible.
> >> We do have big c++/Qt applications running both rt and non-rt on
> >> xenomai.
> >>
> >> regards,
> >> Henning
> >>
> >> Am Fri, 1 Mar 2019 14:10:42 +0530
> >> schrieb Sumitabh Ghosh via Xenomai <xenomai@xenomai.org>:
> >>
> >>> Hi,
> >>>
> >>> I have a generic question not specific to any platform. If I want to
> >>> run a small graphics application on Xenomai 3.x what would be the
> >>> correct approach. e.g. Qt application framework which needs POSIX
> >>> apis and a linux frame buffer to be able to render 2D applications.
> >>>
> >>> Kindly provide me some pointers.
> >>>
> >>> Thanks in advance.
> >>>
> >>> Cheers!
> >>> Sumit
> >>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Qt application on Xenomai
  2019-03-02  5:57   ` Sumitabh Ghosh
@ 2019-03-04  7:55     ` Stéphane Ancelot
  2019-03-04  8:38       ` C Smith
  0 siblings, 1 reply; 8+ messages in thread
From: Stéphane Ancelot @ 2019-03-04  7:55 UTC (permalink / raw)
  Cc: Sumitabh Ghosh via Xenomai

Hi,

I will share some points from my viewpoint :

The Xenomai impact will depend on the processor architecture selected 
(uniprocessor or multiprocessor).

In uniprocessor context, while your rt application will consume cpu 
time, meanwhile the other scheduled application will be waiting for 
their time slice.

And thus GUI application is interrupted and may be slow in some cases 
(that really depends on the impact of the RT process). In multiprocessor 
context, this becomes no more a problem.

Performance is then dependant on the cpu architecture (x86/x64/arm...) 
and their graphics chip device.

Depending on the graphics chip, the performance needed to drive a 19inch 
size display is not the same as driving a 7inch size display.

There are two kinds of Qt applications these days : Native Qt and QML 
applications.

* Qt is native and can use 2D OpenGL or display framebuffer,

* QML is no more than a javascript application layer running in a 
javascript web engine , in this case you will be performance mainly 
impacted by the QML architecture.

If your GUI application fits only few buttons in a display, then, that's 
not a problem.

Regards.

Stéphane ANCELOT


Le 02/03/2019 à 06:57, Sumitabh Ghosh via Xenomai a écrit :
> Hi Henning,
>
> Thanks for your confirmation. Just to understand your set up further, does
> the POSIX layer used by QT is of the Xenomai skin ? Is This the way Qt is
> leveraging the rt features ?
>
> I guess the rendering of graphics is handled through non rt Linux
> framebuffer /opengl apis.
>
> Let me know if my above understanding is correct.
>
> Thanks,
> Sumit
>
>
>
>
> On Fri, Mar 1, 2019, 18:02 Henning Schild <henning.schild@siemens.com>
> wrote:
>
>> Hi,
>>
>> i am not sure i fully understand the question. In case you are worried
>> about combining Xenomai and Qt, i can assure you that it is possible.
>> We do have big c++/Qt applications running both rt and non-rt on
>> xenomai.
>>
>> regards,
>> Henning
>>
>> Am Fri, 1 Mar 2019 14:10:42 +0530
>> schrieb Sumitabh Ghosh via Xenomai <xenomai@xenomai.org>:
>>
>>> Hi,
>>>
>>> I have a generic question not specific to any platform. If I want to
>>> run a small graphics application on Xenomai 3.x what would be the
>>> correct approach. e.g. Qt application framework which needs POSIX
>>> apis and a linux frame buffer to be able to render 2D applications.
>>>
>>> Kindly provide me some pointers.
>>>
>>> Thanks in advance.
>>>
>>> Cheers!
>>> Sumit
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Qt application on Xenomai
  2019-03-01 12:32 ` Henning Schild
@ 2019-03-02  5:57   ` Sumitabh Ghosh
  2019-03-04  7:55     ` Stéphane Ancelot
  0 siblings, 1 reply; 8+ messages in thread
From: Sumitabh Ghosh @ 2019-03-02  5:57 UTC (permalink / raw)
  To: henning.schild; +Cc: Sumitabh Ghosh via Xenomai

Hi Henning,

Thanks for your confirmation. Just to understand your set up further, does
the POSIX layer used by QT is of the Xenomai skin ? Is This the way Qt is
leveraging the rt features ?

I guess the rendering of graphics is handled through non rt Linux
framebuffer /opengl apis.

Let me know if my above understanding is correct.

Thanks,
Sumit




On Fri, Mar 1, 2019, 18:02 Henning Schild <henning.schild@siemens.com>
wrote:

> Hi,
>
> i am not sure i fully understand the question. In case you are worried
> about combining Xenomai and Qt, i can assure you that it is possible.
> We do have big c++/Qt applications running both rt and non-rt on
> xenomai.
>
> regards,
> Henning
>
> Am Fri, 1 Mar 2019 14:10:42 +0530
> schrieb Sumitabh Ghosh via Xenomai <xenomai@xenomai.org>:
>
> > Hi,
> >
> > I have a generic question not specific to any platform. If I want to
> > run a small graphics application on Xenomai 3.x what would be the
> > correct approach. e.g. Qt application framework which needs POSIX
> > apis and a linux frame buffer to be able to render 2D applications.
> >
> > Kindly provide me some pointers.
> >
> > Thanks in advance.
> >
> > Cheers!
> > Sumit
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Qt application on Xenomai
  2019-03-01  8:40 Sumitabh Ghosh
@ 2019-03-01 12:32 ` Henning Schild
  2019-03-02  5:57   ` Sumitabh Ghosh
  0 siblings, 1 reply; 8+ messages in thread
From: Henning Schild @ 2019-03-01 12:32 UTC (permalink / raw)
  To: Sumitabh Ghosh via Xenomai

Hi,

i am not sure i fully understand the question. In case you are worried
about combining Xenomai and Qt, i can assure you that it is possible.
We do have big c++/Qt applications running both rt and non-rt on
xenomai.

regards,
Henning

Am Fri, 1 Mar 2019 14:10:42 +0530
schrieb Sumitabh Ghosh via Xenomai <xenomai@xenomai.org>:

> Hi,
> 
> I have a generic question not specific to any platform. If I want to
> run a small graphics application on Xenomai 3.x what would be the
> correct approach. e.g. Qt application framework which needs POSIX
> apis and a linux frame buffer to be able to render 2D applications.
> 
> Kindly provide me some pointers.
> 
> Thanks in advance.
> 
> Cheers!
> Sumit



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Qt application on Xenomai
@ 2019-03-01  8:40 Sumitabh Ghosh
  2019-03-01 12:32 ` Henning Schild
  0 siblings, 1 reply; 8+ messages in thread
From: Sumitabh Ghosh @ 2019-03-01  8:40 UTC (permalink / raw)
  To: Xenomai

Hi,

I have a generic question not specific to any platform. If I want to run a
small graphics application on Xenomai 3.x what would be the correct
approach. e.g. Qt application framework which needs POSIX apis and a linux
frame buffer to be able to render 2D applications.

Kindly provide me some pointers.

Thanks in advance.

Cheers!
Sumit

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-04  1:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04  1:50 Qt application on Xenomai demon.han
  -- strict thread matches above, loose matches on Subject: below --
2019-04-03 12:10 demon.han
2019-04-04  0:39 ` Alec Ari
2019-03-01  8:40 Sumitabh Ghosh
2019-03-01 12:32 ` Henning Schild
2019-03-02  5:57   ` Sumitabh Ghosh
2019-03-04  7:55     ` Stéphane Ancelot
2019-03-04  8:38       ` C Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.