Hier ein diff zum spielen mit den thread prios. Den 'File' Thread habe ich in der Gui ausgeblendet, da er seltsamerweise nach dem prio verstellen abschmiert.
DMX Thread und Movieplayer Thread funzen aber
Die Prioritäten und die Policy können unter den Einstellungen Aufnahme verändert werden. Normal ist SCHED_OTHER, hier spielt die Prio keine Rolle, Die beiden anderen sind dann 'realtime' mit der entsprechenden Prio.
Keine Ahnung ob es jetzt besser geht, hatte ja auch vorher wenig Probleme
Ev. könnte jtg-Riker ja ( bei Bedarf) einen Testsnap für die Tester von der IDE2-Abteilung machen
.
Hier noch ein paar infos:
policy
The scheduling class. The values permitted are:
SCHED_FIFO== 1
A First-In, First-Out real-time process. When the scheduler assigns the CPU to the process, it leaves the process descriptor in its current position in the runqueue list. If no other higher-priority real-time process is runnable, the process will continue to use the CPU as long as it wishes, even if other real-time processes having the same priority are runnable.
SCHED_RR== 2
A Round Robin real-time process. When the scheduler assigns the CPU to the process, it puts the process descriptor at the end of the runqueue list. This policy ensures a fair assignment of CPU time to all SCHED_RR real-time processes that have the same priority.
SCHED_OTHER == 0
A conventional, time-shared process.
priority (0-99)
The base time quantum (or base priority) of the process.
siehe auch hier:
http://www.oreilly.de/homepage/catalog/ ... l/chapter/
(bin ich aber auch noch nicht ganz durch)
Code: Alles auswählen
Index: apps/tuxbox/neutrino/src/neutrino.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/neutrino.cpp,v
retrieving revision 1.840
diff -u -b -B -r1.840 neutrino.cpp
--- apps/tuxbox/neutrino/src/neutrino.cpp 26 Jan 2007 23:57:38 -0000 1.840
+++ apps/tuxbox/neutrino/src/neutrino.cpp 6 Feb 2007 01:41:01 -0000
@@ -2562,6 +2562,15 @@
{ CNeutrinoApp::RECORDING_FILE , LOCALE_RECORDINGMENU_FILE }
};
+//THREADTEST
+extern int recording_dmx_thread_prio ;
+extern int recording_dmx_thread_policy ;
+extern int recording_file_thread_prio ;
+extern int recording_file_thread_policy ;
+extern int movieplayer_thread_prio ;
+extern int movieplayer_thread_policy ;
+
+
void CNeutrinoApp::InitRecordingSettings(CMenuWidget &recordingSettings)
{
CIPInput * recordingSettings_server_ip = new CIPInput(LOCALE_RECORDINGMENU_SERVER_IP, g_settings.recording_server_ip, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
@@ -2707,6 +2716,23 @@
directRecordingSettings->addItem(mf11);
directRecordingSettings->addItem(mf12);
+ //THREADTEST
+ directRecordingSettings->addItem(GenericMenuSeparatorLine);
+
+ CMenuOptionNumberChooser* num1 = new CMenuOptionNumberChooser(LOCALE_FLASHUPDATE_TITLEREADFLASH, &recording_dmx_thread_policy, true, 0, 2, 0, 0, NONEXISTANT_LOCALE, "rec dmx policy");
+ CMenuOptionNumberChooser* num2 = new CMenuOptionNumberChooser(LOCALE_FLASHUPDATE_TITLEREADFLASH, &recording_dmx_thread_prio, true, 0, 99, 0, 0, NONEXISTANT_LOCALE, "rec dmx prio");
+ CMenuOptionNumberChooser* num3 = new CMenuOptionNumberChooser(LOCALE_FLASHUPDATE_TITLEWRITEFLASH, &recording_file_thread_policy, true, 0, 2, 0, 0, NONEXISTANT_LOCALE, "rec file policy");
+ CMenuOptionNumberChooser* num4 = new CMenuOptionNumberChooser(LOCALE_FLASHUPDATE_TITLEWRITEFLASH, &recording_file_thread_prio, true, 0, 99, 0, 0, NONEXISTANT_LOCALE, "rec file prio");
+ CMenuOptionNumberChooser* num5 = new CMenuOptionNumberChooser(LOCALE_MAINMENU_MOVIEPLAYER, &movieplayer_thread_policy, true, 0, 2, 0, 0, NONEXISTANT_LOCALE, "mp policy (0:norm,1:realFIFO,2:realRR");
+ CMenuOptionNumberChooser* num6 = new CMenuOptionNumberChooser(LOCALE_MAINMENU_MOVIEPLAYER, &movieplayer_thread_prio, true, 0, 99, 0, 0, NONEXISTANT_LOCALE, "mp prio (0-99)");
+
+ directRecordingSettings->addItem(num1);
+ directRecordingSettings->addItem(num2);
+ //directRecordingSettings->addItem(num3);
+ //directRecordingSettings->addItem(num4);
+ directRecordingSettings->addItem(num5);
+ directRecordingSettings->addItem(num6);
+
recordingstatus = 0;
}
Index: apps/tuxbox/neutrino/src/driver/stream2file.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/stream2file.cpp,v
retrieving revision 1.21
diff -u -b -B -r1.21 stream2file.cpp
--- apps/tuxbox/neutrino/src/driver/stream2file.cpp 29 Dec 2005 17:22:32 -0000 1.21
+++ apps/tuxbox/neutrino/src/driver/stream2file.cpp 6 Feb 2007 01:41:02 -0000
@@ -57,6 +57,12 @@
#define INC_BUSY_COUNT busy_count++
#define DEC_BUSY_COUNT busy_count--
+//THREADTEST
+//SCHED_RR SCHED_FIFO
+int recording_dmx_thread_prio = 20;
+int recording_dmx_thread_policy = SCHED_OTHER ;
+int recording_file_thread_prio = 20;
+int recording_file_thread_policy = SCHED_OTHER ;
//#include <transform.h>
#define TS_SIZE 188
@@ -287,6 +293,16 @@
pthread_create(&file_thread, 0, FileThread, &filename_data);
+ //THREADTEST
+ if(recording_file_thread_policy != SCHED_OTHER)
+ {
+ sched_param param;
+ int policy = recording_file_thread_policy ;
+ param.sched_priority = recording_file_thread_prio;
+ int ret = pthread_setschedparam (file_thread, policy, ¶m);
+ printf("!!!!!!!!! FILE pthread_setschedparam :ret %d, policy %d, param %d\n",ret,policy,param.sched_priority );
+ }
+
if (v_arg == &dvrfd)
while (exit_flag == STREAM2FILE_STATUS_RUNNING)
{
@@ -501,6 +517,15 @@
}
exit_flag = STREAM2FILE_STATUS_RUNNING;
pthread_create(&demux_thread[0], 0, DMXThread, &dvrfd);
+ //THREADTEST
+ if(recording_dmx_thread_policy != SCHED_OTHER)
+ {
+ sched_param param;
+ int policy = recording_dmx_thread_policy ;
+ param.sched_priority = recording_dmx_thread_prio;
+ int ret = pthread_setschedparam (demux_thread[0], policy, ¶m);
+ printf("!!!!!!!!! DMX pthread_setschedparam :ret %d, policy %d, param %d\n",ret,policy,param.sched_priority );
+ }
}
else
{
Index: apps/tuxbox/neutrino/src/gui/movieplayer.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/movieplayer.cpp,v
retrieving revision 1.138
diff -u -b -B -r1.138 movieplayer.cpp
--- apps/tuxbox/neutrino/src/gui/movieplayer.cpp 31 Dec 2006 13:51:16 -0000 1.138
+++ apps/tuxbox/neutrino/src/gui/movieplayer.cpp 6 Feb 2007 01:41:23 -0000
@@ -403,6 +403,7 @@
// Stop sectionsd
g_Sectionsd->setPauseScanning (true);
+ g_Sectionsd->freeMemory(); // ??? More Memory for playback
isBookmark=false;
startfilename = "";
@@ -3023,6 +3024,10 @@
//===============================
int CMoviePlayerGui::lastParental = -1;
+//THREADTEST
+int movieplayer_thread_prio = 20;
+int movieplayer_thread_policy = SCHED_OTHER ;
+
void CMoviePlayerGui::PlayFile (int parental)
{
neutrino_msg_t msg;
@@ -3356,6 +3361,15 @@
g_playstate = CMoviePlayerGui::STOPPED;
break;
}
+ //THREADTEST
+ if(movieplayer_thread_policy != SCHED_OTHER)
+ {
+ sched_param param;
+ int policy = movieplayer_thread_policy ;
+ param.sched_priority = movieplayer_thread_prio;
+ int ret = pthread_setschedparam (rct, policy, ¶m);
+ printf("!!!!!!!!! MOVIE pthread_getschedparam :ret %d, policy %d, param %d\n",ret,policy,param.sched_priority );
+ }
}
//-- audio track selector --