Hello
I have made an app that displays the harmonics in 3d. I want to be able to run it in real-time; I have used the 'rtpool-test' code from the gstreamer core examples (streams->rtpool-test.c) and it works. However, I have seen that this grants me a priority of 90 with a 'RR' policy. Is it possible to change the code code to get 'FIFO' policy? If yes, please how could I do this? I have tied to use the set_schedparam code, but I got the 'Invalid argument' during 'pthread_attr_setschedparam (&attr, &sched)' error... (as well as starting the app with 'chrt -r -p my-pid') Another question : this code grants real time for Gstreamer code, but what about other code code (not Gstreamer) that follows it? The app is written like this : GTK GUI with a 'Play" button, that starts playing the sound with Gstreamer, and the 'spectrum' element send messages to the bus; everytime the "message handler" function retrives the values of the spectrum, there is a call to a function that display the values of the spectrum in a SDL/OpenGL window. My question is : is the display in the SDL/OpenGL window done also with the RR policy or back with TS policy? When I run the app (its name is 'spectrum3d', then when I run 'ps -cLe' in a terminal to see all the threads of the app, I see this : 5265 5265 TS 19 pts/0 00:00:01 spectrum3d 5265 5267 TS 19 pts/0 00:00:00 threaded-ml 5265 5268 TS 19 pts/0 00:00:00 threaded-ml 5265 5270 TS 19 pts/0 00:00:00 task0 5265 5271 TS 19 pts/0 00:00:00 spectrum3d 5265 5272 RR 90 pts/0 00:00:01 alsasrc:src The 1st pid is the Gtk GUI; the last one must be the gstreamer sound reading, since its policy is RR; but I don't know what the other pid represent... thanks for your help Victor _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Am 28.04.2011 05:34, schrieb Victor henri:
> Hello > > I have made an app that displays the harmonics in 3d. > > I want to be able to run it in real-time; I have used the 'rtpool-test' code > from the gstreamer core examples (streams->rtpool-test.c) and it works. However, > I have seen that this grants me a priority of 90 with a 'RR' policy. Is it > possible to change the code code to get 'FIFO' policy? If yes, please how could > I do this? I have tied to use the set_schedparam code, but I got the 'Invalid > argument' during 'pthread_attr_setschedparam (&attr, &sched)' error... (as well > as starting the app with 'chrt -r -p my-pid') You need to have permission to swicth your app to that (e.g. try the chrt call as root). Now the better question is why you want to do it. Before I go depper, if would be good if you could tell what your expectation is. Stefan > > Another question : this code grants real time for Gstreamer code, but what about > other code code (not Gstreamer) that follows it? The app is written like this : > GTK GUI with a 'Play" button, that starts playing the sound with Gstreamer, and > the 'spectrum' element send messages to the bus; everytime the "message handler" > function retrives the values of the spectrum, there is a call to a function that > display the values of the spectrum in a SDL/OpenGL window. My question is : is > the display in the SDL/OpenGL window done also with the RR policy or back with > TS policy? > > When I run the app (its name is 'spectrum3d', then when I run 'ps -cLe' in a > terminal to see all the threads of the app, I see this : > > 5265 5265 TS 19 pts/0 00:00:01 spectrum3d > 5265 5267 TS 19 pts/0 00:00:00 threaded-ml > 5265 5268 TS 19 pts/0 00:00:00 threaded-ml > 5265 5270 TS 19 pts/0 00:00:00 task0 > 5265 5271 TS 19 pts/0 00:00:00 spectrum3d > 5265 5272 RR 90 pts/0 00:00:01 alsasrc:src > > The 1st pid is the Gtk GUI; the last one must be the gstreamer sound reading, > since its policy is RR; but I don't know what the other pid represent... > > thanks for your help > > Victor > > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by victorvictor
Hello Stefan and thank you for your answer >> I have made an app that displays the harmonics in 3d. >> >> I want to be able to run it in real-time; I have used the 'rtpool-test' code >> from the gstreamer core examples (streams->rtpool-test.c) and it works. However, >> I have seen that this grants me a priority of 90 with a 'RR' policy. Is it >> possible to change the code code to get 'FIFO' policy? If yes, please how could >> I do this? I have tied to use the set_schedparam code, but I got the 'Invalid >> argument' during 'pthread_attr_setschedparam (&attr, &sched)' error... (as well >> as starting the app with 'chrt -r -p my-pid') > > You need to have permission to swicth your app to that (e.g. try the chrt call > as root). It doesn't work; both starting the app with "sudo chrt -r my_app" and using the 'set_schedparam' function don't work : I get the error : "pthread_attr_setschedparam (&attr, &sched)" and this has already been reported I think. I have seen a post at the gstreamer list about this, and they advised to use the 'rtpool-test' code; I did it and it worked; >Now the better question is why you want to do it. Before I go depper, > if would be good if you could tell what your expectation is. The app displays in a 3D graph the harmonics of the sound sound captured from the microphone; since it is 3d (hence cpu and gpu consuming) and a real-time analysis, I'd like to start the app with the real-time policy to ensure that is has priority about other process that may slow it down; I'm well aware that running it in real time won't decrease its CPU and GPU use though > > Stefan > >> >> Another question : this code grants real time for Gstreamer code, but what about >> other code code (not Gstreamer) that follows it? The app is written like this : >> GTK GUI with a 'Play" button, that starts playing the sound with Gstreamer, and >> the 'spectrum' element send messages to the bus; everytime the "message handler" >> function retrives the values of the spectrum, there is a call to a function that >> display the values of the spectrum in a SDL/OpenGL window. My question is : is >> the display in the SDL/OpenGL window done also with the RR policy or back with >> TS policy? >> >> When I run the app (its name is 'spectrum3d', then when I run 'ps -cLe' in a >> terminal to see all the threads of the app, I see this : >> >> 5265 5265 TS 19 pts/0 00:00:01 spectrum3d >> 5265 5267 TS 19 pts/0 00:00:00 threaded-ml >> 5265 5268 TS 19 pts/0 00:00:00 threaded-ml >> 5265 5270 TS 19 pts/0 00:00:00 task0 >> 5265 5271 TS 19 pts/0 00:00:00 spectrum3d >> 5265 5272 RR 90 pts/0 00:00:01 alsasrc:src >> >> The 1st pid is the Gtk GUI; the last one must be the gstreamer sound reading, >> since its policy is RR; but I don't know what the other pid represent... >> Regarding this, do you think running the Gstreamer thread in real-time is enough to give also real-time display with openGL, since the display function is called from the message handler function of Gstreamer Thank you for helping me Victor _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by victorvictor
I answer to myself
It was quite easy to find... In the 'testrtpool.c' file, in the 'default-push' function, I just had to replace "SCHED_RR" by "SCHED_FIFO" On the other hand, 'param.sched_priority' is set to to 50, which can be changed also according to the priority one wants to give to the process; Victor From: [hidden email] To: [hidden email] Subject: real time question : RR vs FF? Date: Thu, 28 Apr 2011 04:34:39 +0200 Hello I have made an app that displays the harmonics in 3d. I want to be able to run it in real-time; I have used the 'rtpool-test' code from the gstreamer core examples (streams->rtpool-test.c) and it works. However, I have seen that this grants me a priority of 90 with a 'RR' policy. Is it possible to change the code code to get 'FIFO' policy? If yes, please how could I do this? I have tied to use the set_schedparam code, but I got the 'Invalid argument' during 'pthread_attr_setschedparam (&attr, &sched)' error... (as well as starting the app with 'chrt -r -p my-pid') Another question : this code grants real time for Gstreamer code, but what about other code code (not Gstreamer) that follows it? The app is written like this : GTK GUI with a 'Play" button, that starts playing the sound with Gstreamer, and the 'spectrum' element send messages to the bus; everytime the "message handler" function retrives the values of the spectrum, there is a call to a function that display the values of the spectrum in a SDL/OpenGL window. My question is : is the display in the SDL/OpenGL window done also with the RR policy or back with TS policy? When I run the app (its name is 'spectrum3d', then when I run 'ps -cLe' in a terminal to see all the threads of the app, I see this : 5265 5265 TS 19 pts/0 00:00:01 spectrum3d 5265 5267 TS 19 pts/0 00:00:00 threaded-ml 5265 5268 TS 19 pts/0 00:00:00 threaded-ml 5265 5270 TS 19 pts/0 00:00:00 task0 5265 5271 TS 19 pts/0 00:00:00 spectrum3d 5265 5272 RR 90 pts/0 00:00:01 alsasrc:src The 1st pid is the Gtk GUI; the last one must be the gstreamer sound reading, since its policy is RR; but I don't know what the other pid represent... thanks for your help Victor _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Am 30.04.2011 11:24, schrieb Victor henri:
> I answer to myself > > It was quite easy to find... > In the 'testrtpool.c' file, in the 'default-push' function, I just had to > replace "SCHED_RR" by "SCHED_FIFO" > On the other hand, 'param.sched_priority' is set to to 50, which can be changed > also according to the priority one wants to give to the process; I hope you have a good reason for using SCHED_FIFO. 1st I hope you understand that you will only get scheduling priority, I you are not running fast enough, this is *not* the solution. 2nd I hope you understand the dangers of SCHED_FIFO vs. SCHED_RR. Stefan > > Victor > > -------------------------------------------------------------------------------- > From: [hidden email] > To: [hidden email] > Subject: real time question : RR vs FF? > Date: Thu, 28 Apr 2011 04:34:39 +0200 > > Hello > > I have made an app that displays the harmonics in 3d. > > I want to be able to run it in real-time; I have used the 'rtpool-test' code > from the gstreamer core examples (streams->rtpool-test.c) and it works. However, > I have seen that this grants me a priority of 90 with a 'RR' policy. Is it > possible to change the code code to get 'FIFO' policy? If yes, please how could > I do this? I have tied to use the set_schedparam code, but I got the 'Invalid > argument' during 'pthread_attr_setschedparam (&attr, &sched)' error... (as well > as starting the app with 'chrt -r -p my-pid') > > Another question : this code grants real time for Gstreamer code, but what about > other code code (not Gstreamer) that follows it? The app is written like this : > GTK GUI with a 'Play" button, that starts playing the sound with Gstreamer, and > the 'spectrum' element send messages to the bus; everytime the "message handler" > function retrives the values of the spectrum, there is a call to a function that > display the values of the spectrum in a SDL/OpenGL window. My question is : is > the display in the SDL/OpenGL window done also with the RR policy or back with > TS policy? > > When I run the app (its name is 'spectrum3d', then when I run 'ps -cLe' in a > terminal to see all the threads of the app, I see this : > > 5265 5265 TS 19 pts/0 00:00:01 spectrum3d > 5265 5267 TS 19 pts/0 00:00:00 threaded-ml > 5265 5268 TS 19 pts/0 00:00:00 threaded-ml > 5265 5270 TS 19 pts/0 00:00:00 task0 > 5265 5271 TS 19 pts/0 00:00:00 spectrum3d > 5265 5272 RR 90 pts/0 00:00:01 alsasrc:src > > The 1st pid is the Gtk GUI; the last one must be the gstreamer sound reading, > since its policy is RR; but I don't know what the other pid represent... > > thanks for your help > > Victor > > _______________________________________________ gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hello Stefan and thank you for your answer > > It was quite easy to find... > > In the 'testrtpool.c' file, in the 'default-push' function, I just had to > > replace "SCHED_RR" by "SCHED_FIFO" > > On the other hand, 'param.sched_priority' is set to to 50, which can be changed > > also according to the priority one wants to give to the process; > > I hope you have a good reason for using SCHED_FIFO. 1st I hope you understand > that you will only get scheduling priority, I you are not running fast enough, > this is *not* the solution My app is very demanding since it involves realtime (and very fast) analysis and display of the data's. Although my machine is powerfull enough, I suppose that on machine that are not powerfull enough, this could cause lock up. . 2nd I hope you understand the dangers of SCHED_FIFO > vs. SCHED_RR. > As far as I know, theĀ main difference is that the SCHED_FIFO cannot be prempted unless another process of higher priority shows up in the execution queue; and SCHED_RR can be preempted by a time quantum... I apreciate your warning and get back to the RR policy for now and investigate more. Indeed it may be more safe. Thank you so much for sharing Victor _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi
On 05/01/2011 05:54 PM, Victor henri wrote: > > Hello Stefan and thank you for your answer > >>> It was quite easy to find... >>> In the 'testrtpool.c' file, in the 'default-push' function, I just had to >>> replace "SCHED_RR" by "SCHED_FIFO" >>> On the other hand, 'param.sched_priority' is set to to 50, which can be changed >>> also according to the priority one wants to give to the process; >> >> I hope you have a good reason for using SCHED_FIFO. 1st I hope you understand >> that you will only get scheduling priority, I you are not running fast enough, >> this is *not* the solution > > My app is very demanding since it involves realtime (and very fast) analysis and display of the data's. Although my machine is powerfull enough, I suppose that on machine that are not powerfull enough, this could cause lock up. > > . 2nd I hope you understand the dangers of SCHED_FIFO >> vs. SCHED_RR. >> > > > As far as I know, the main difference is that the SCHED_FIFO cannot be prempted > unless another process of higher priority shows up in the execution > queue; and > SCHED_RR can be preempted by a time quantum... > Can you give a try to SCHED_DEADLINE for your application? Michael Trimarchi > I apreciate your warning and get back to the RR policy for now and investigate more. Indeed it may be more safe. > > Thank you so much for sharing > > Victor > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel -- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |