buyukbang
23-05-2010, 02:54 PM
PRIORITY MANAGER V1.3 BY BUYUKBANG
I'm very tired of all coding, testing and bug fixing process, I can have a rest now.
:party:
PLEASE READ "INSTALLATION" AND "IMPORTANT NOTES" SECTIONS BEFORE ASKING OR COMPLAINING ABOUT SOMETHING!, THANKS....
DESCRIPTION:
------------------------------------------------------------------------------------------
This plugin is written by BUYUKBANG to improve total performance of Azbox HD !
Here is the short list of jobs Priority Manager does:
1. Priority Manager automatically changes the priorities of the processes to give optimal
performance for the menu being used. I tested all processes one by one, decided their
effects on the performance of all modules and prepared a bug-free (hopefully) and complex
logic to cover all possible usage cases.
2. Priority Manager provides power saving! Smudger's power measurements show that
Priority Manager decrease power consumption of the box from 25W to 23W while watching an
SD channel and from 28W to 24W while watching an HD channel.
3. Priority Manager optionally automatically mounts CIF and NFS shares when remote server
is online and automatically unmounts CIF AND NFS shares when remote server is offline, so
protects file manager from freezes when remote goes offline after the shares mounted.
4. Priority Manager optionally creates swap file on your HDD/Flash disk which will help
RAM by caching some part of the memory. Priority Manager not only supports creating swap
file on internal HDD or usb HDD/Flash disk connected before Azbox boots, it also supports
creating swap file on usb HDD/Flash disk connected after Azbox boots by continuously
checking for new USB devices.
5. Priority Manager can execute user selected programs after going into SLEEP mode and
the kill them after return from SLEEP mode. By using this feature running resource
intensive programs like transmission, aMule, azepgmgr in only SLEEP mode will be
automatically managed without user intervention.
6. Priority Manager increases internal storage (DOM) speed speed up to 20% by changing
its working parameters.
7. Priority Manager provides "Deep Sleep Mode" which automatically kills all unnecessary
applications and improve downloading speed when box goes to sleep mode.
SPECIAL THANKS TO:
------------------------------------------------------------------------------------------
Smudger for the all information, tests and power measurements, his tests killed the bugs!
Kanber Kav for his permission for the usage and modification of his Multicas Info plugin
and for the idea of increasing internal storage (DOM) speed!
HISTORY:
------------------------------------------------------------------------------------------
v1.3
-----
NEW : Packed the script as a plugin. You can look at the script logs, activate,
deactivate, restart the script simply from Plugins Menu without having to use TELNET.
Special thanks to Kanber Kav for his permission for the usage and modification of his
Multicas Info plugin!
NEW : Increasing internal storage (DOM) speed up to 20% by changing its working
parameters! (Thanks to Kanber Kav for the idea!)
NEW : Full automated cleanup mechanism: After deleting this plugin from Plugins Menu,
Priority Manager will be deactivated and process will be stopped, all installed files and
log file will be deleted, all process priorities will be set to their default values. No
reboot or user intervention needed!
NEW : Reserved programs are now supported. When a scheduled recording starts, TV
prioritization will be applied until it ends.
NEW : CIF mount support for those who want want to mount CIF shares of your network to
Azbox. (auto-mounts shares when the file server is online, auto-unmounts share when the
file server is offline)
NEW : NFS mount support for those who want want to mount NFS shares of your network to
Azbox. (auto-mounts shares when the file server is online, auto-unmounts share when the
file server is offline)
NEW : Swap file support for Azbox. You can activate this option so that to Priority
Manager creates swap file on your HDD or Flash disk which will help RAM by caching some
part of the memory. Swap usage file helps large file operations like recording.
NEW : "Deep Sleep" option. You can activate this option if you want to kill all
unnecessary applications when box goes to sleep mode to improve downloading speed. There
are some side effects of deep sleep. For more information please read DEEP_SLEEP section
of settings.txt .
NEW : Automatic management of execution and killing of sleep mode programs. Priority
Manager can execute user selected programs after going into SLEEP mode and the kill them
after return from SLEEP mode with the new feature. For more information please read
PROGRAM section of settings.txt .
NEW : CCcam EMU prioritization. (Thanks to Smudger for the information!)
NEW : NewCS EMU prioritization. (Thanks to Smudger for the information!)
NEW : Transmission (torrent client) sleep mode prioritization.
NEW : aMule (eD2K client) sleep mode prioritization.
NEW : Verbose log generation for debugging added. Please read "IMPORTANT NOTES - 4" for more information.
NEW : Better TV recording and channel switch speed.
NEW : Better performance for some process priorities.
NEW : All settings are moved from script file to a separate file : settings.txt
FIX : "CANCEL" option in sleep menu is now detected as it should be.
v1.2
-----
NEW : azepgmgr support to protect TV/Media applications from the glitches caused by its
initial process. (Thanks to Smudger for all tests and information!)
NEW : Client/Server mode switch parameter for those who want to this script on a box
being used as a CAM server.
NEW : Audio menu prioritization.
NEW : Settings menu prioritization.
NEW : Plugins menu prioritization.
NEW : Cheops EMU prioritization.
NEW : SBox EMU prioritization.
NEW : All process priorities fine tuned.
NEW : Better menu detection.
NEW : Better sleep mode detection.
NEW : Loop sleep time decreased from 60 seconds to 30 seconds.
FIX : Sometimes CRTVCore collects all CPU power and this slows down everything. So I
decreased priority of CRTVCore.
FIX : Fixed a bug in restart: /DISK2/etc/start.d/S99PriorityManager.sh restart
v1.1
-----
NEW : RSS and Browser components stay in memory after first usage. Added support for
automatically killing RSS and Browser components when using other menu.
v1.0
-----
NEW : All process priorities updated according to the results of my long tests. IP TV,
Mediaplayer, Recording, ECM Time (for EMUs) performances are optimized.
NEW : Old scripts use "snice +XX" command to give processes positive nice values (lower
priority). But this command does not guarantee to decrease the priority and system
sometimes ignore this command. You can check old scripts by top command while changing
menu modes. "<" sign means negative nice value and high priority, "N" sign means positive
nice value and low priority. After a few times changing the menu modes everything has "<"
sign and this is really nonfunctional situation. To fix this problem I used "snice STOP"
which cannot be ignored by the system.
NEW : massimo1167's script is not compatible with the option "Always Start in TV Mode"
and this causes totally wrong prioritization. This is fixed.
NEW : Old scripts block firmware upgrades and upgrade process sticks at "Extracting".
Priority Manager fixes this issue and fully compatible Opensat upgrades. Just wait 45
seconds at "Extracting", then upgrade process will continue.
NEW : ftp,samba,telnet prioritization in sleep mode. I suggest you to transfer your files
with FTP during sleep mode prioritization. This is the fasted method.
NEW : Photo menu prioritization.
NEW : Browser menu prioritization.
NEW : RSS menu prioritization.
NEW : Use this command to stop the script (does not work in old scripts):
/DISK2/etc/start.d/S99PriorityManager.sh stop
NEW : Use this command to restart the script (does not work in old scripts):
/DISK2/etc/start.d/S99PriorityManager.sh restart
NEW : Logging. Use this command to see log file:
tail -n100 -f /tmp/PriorityManager_IsRunning
INSTALLATION:
------------------------------------------------------------------------------------------
1. Extract PriorityManager.plugin and plugins.lst files from the archive file.
2. Copy PriorityManager.plugin and plugins.lst to USB or simply transfer them by FTP to
/tmp folder of your Azbox.
3. Enter Plugins menu, press Red Button on remote controller to add plugin. If you're
using USB select to install it from USB, or if you transferred files to /tmp folder
install it from tmp folder.
4. Check user defined parameters in /PLUGINS/PriorityManager/settings.txt and edit
parameters if you want, save the file.
5. Activate plugin from the plugins menu: PLUGINS-->PriorityManager-->Activate/Reactivate
6. After the first run of the script standby.sh and wakeup.sh scripts will be created
under /DISK2/etc . These scripts will help to main script for the decision of the sleep
mode by creating and deleting a file ( /tmp/PriorityManager_Sleep ) If you have already
standby.sh and wakeup.sh in /DISK2/etc, they will be backed up by installation process
in the same directory. Then you may want to manually add below commands to scripts
before running Priority Manager:
echo 0 > /tmp/PriorityManager_Sleep = to standby.sh
rm /tmp/PriorityManager_Sleep = to wakeup.sh
IMPORTANT NOTES:
------------------------------------------------------------------------------------------
1. Priority Manager script works in a loop with 30 seconds sleep times. So wait max 30
seconds for prioritization. You can decrease this to 15-20 secs if you want, but values
below 10 may cause a small performance loss.
2. A looped script in /DISK2/etc/start.d/ will block the other scripts with a higher
heading value. So do not use any looped script. This is the reason why I used "99" in the
script name. This will not block any script with two digits but will block scripts with
higher values as heading value.
3. Please do not use any folder in HDD to mount shares. This will cause HDD not to sleep
because of continuous folder checks by Priority Manager. Even without Priority Manager,
it's not recommended, since share access always triggers HDD. Instead I would recommend
you to use folders in internal storage (DOM). If you need to access this mounts directly
from Menus (under main directories of Video, Music, Picture), you can use symlinks
created under HDD pointing mount folders in DOM.
4. If you have any problems with Priority Manager, change VERBOSE_MODE=1 in settings.txt
and reactivate Priority Manager from PLUGINS-->PriorityManager-->Activate/Reactivate.
This will create a verbose log file /PLUGINS/PriorityManager/PriorityManager_Verbose_Log
Collect data with this option set to 1, without stopping, restarting, reactivating and
deactivating Priority Manager, because all this operations will delete all old log files.
Then send an e-mail to author (you can find my e-mail adress in readme.txt) containing
PriorityManager_Verbose_Log with the approximate time that problem occured. Don't forget
to reset VERBOSE_MODE=0 and restart priority manager or logfile size will continuously
increase which may cause internal storage (DOM) to run out of disk space.
UPDATE:
I added PriorityManagerv1.3_by_Buyukbang_ Extracted_Plugin_Version.zip for those having difficulties with azbox plugin installation mechanism. It's really unstable.
Instructions for this verion:
1- Extract PriorityManagerv1.3_by_Buyukbang_ Extracted_Plugin_Version.zip
2- Upload PriorityManager folder to azbox under /PLUGINS folder.
3- chmod 755 everything.
4- Copy S99PriorityManager.sh under /DISK2/etc/start.d/ and chmod 755
5- Copy wakeup.sh and standbye.sh under /DISK2/etc/ and chmod 755
6- Edit settings.txt if you want
7- Activate Priority Manager from plugins menu
DOWNLOAD:
You can download this from attachment or from the alternative link:
hxxp://uploaded.to/file/hkp3s7
I'm very tired of all coding, testing and bug fixing process, I can have a rest now.
:party:
PLEASE READ "INSTALLATION" AND "IMPORTANT NOTES" SECTIONS BEFORE ASKING OR COMPLAINING ABOUT SOMETHING!, THANKS....
DESCRIPTION:
------------------------------------------------------------------------------------------
This plugin is written by BUYUKBANG to improve total performance of Azbox HD !
Here is the short list of jobs Priority Manager does:
1. Priority Manager automatically changes the priorities of the processes to give optimal
performance for the menu being used. I tested all processes one by one, decided their
effects on the performance of all modules and prepared a bug-free (hopefully) and complex
logic to cover all possible usage cases.
2. Priority Manager provides power saving! Smudger's power measurements show that
Priority Manager decrease power consumption of the box from 25W to 23W while watching an
SD channel and from 28W to 24W while watching an HD channel.
3. Priority Manager optionally automatically mounts CIF and NFS shares when remote server
is online and automatically unmounts CIF AND NFS shares when remote server is offline, so
protects file manager from freezes when remote goes offline after the shares mounted.
4. Priority Manager optionally creates swap file on your HDD/Flash disk which will help
RAM by caching some part of the memory. Priority Manager not only supports creating swap
file on internal HDD or usb HDD/Flash disk connected before Azbox boots, it also supports
creating swap file on usb HDD/Flash disk connected after Azbox boots by continuously
checking for new USB devices.
5. Priority Manager can execute user selected programs after going into SLEEP mode and
the kill them after return from SLEEP mode. By using this feature running resource
intensive programs like transmission, aMule, azepgmgr in only SLEEP mode will be
automatically managed without user intervention.
6. Priority Manager increases internal storage (DOM) speed speed up to 20% by changing
its working parameters.
7. Priority Manager provides "Deep Sleep Mode" which automatically kills all unnecessary
applications and improve downloading speed when box goes to sleep mode.
SPECIAL THANKS TO:
------------------------------------------------------------------------------------------
Smudger for the all information, tests and power measurements, his tests killed the bugs!
Kanber Kav for his permission for the usage and modification of his Multicas Info plugin
and for the idea of increasing internal storage (DOM) speed!
HISTORY:
------------------------------------------------------------------------------------------
v1.3
-----
NEW : Packed the script as a plugin. You can look at the script logs, activate,
deactivate, restart the script simply from Plugins Menu without having to use TELNET.
Special thanks to Kanber Kav for his permission for the usage and modification of his
Multicas Info plugin!
NEW : Increasing internal storage (DOM) speed up to 20% by changing its working
parameters! (Thanks to Kanber Kav for the idea!)
NEW : Full automated cleanup mechanism: After deleting this plugin from Plugins Menu,
Priority Manager will be deactivated and process will be stopped, all installed files and
log file will be deleted, all process priorities will be set to their default values. No
reboot or user intervention needed!
NEW : Reserved programs are now supported. When a scheduled recording starts, TV
prioritization will be applied until it ends.
NEW : CIF mount support for those who want want to mount CIF shares of your network to
Azbox. (auto-mounts shares when the file server is online, auto-unmounts share when the
file server is offline)
NEW : NFS mount support for those who want want to mount NFS shares of your network to
Azbox. (auto-mounts shares when the file server is online, auto-unmounts share when the
file server is offline)
NEW : Swap file support for Azbox. You can activate this option so that to Priority
Manager creates swap file on your HDD or Flash disk which will help RAM by caching some
part of the memory. Swap usage file helps large file operations like recording.
NEW : "Deep Sleep" option. You can activate this option if you want to kill all
unnecessary applications when box goes to sleep mode to improve downloading speed. There
are some side effects of deep sleep. For more information please read DEEP_SLEEP section
of settings.txt .
NEW : Automatic management of execution and killing of sleep mode programs. Priority
Manager can execute user selected programs after going into SLEEP mode and the kill them
after return from SLEEP mode with the new feature. For more information please read
PROGRAM section of settings.txt .
NEW : CCcam EMU prioritization. (Thanks to Smudger for the information!)
NEW : NewCS EMU prioritization. (Thanks to Smudger for the information!)
NEW : Transmission (torrent client) sleep mode prioritization.
NEW : aMule (eD2K client) sleep mode prioritization.
NEW : Verbose log generation for debugging added. Please read "IMPORTANT NOTES - 4" for more information.
NEW : Better TV recording and channel switch speed.
NEW : Better performance for some process priorities.
NEW : All settings are moved from script file to a separate file : settings.txt
FIX : "CANCEL" option in sleep menu is now detected as it should be.
v1.2
-----
NEW : azepgmgr support to protect TV/Media applications from the glitches caused by its
initial process. (Thanks to Smudger for all tests and information!)
NEW : Client/Server mode switch parameter for those who want to this script on a box
being used as a CAM server.
NEW : Audio menu prioritization.
NEW : Settings menu prioritization.
NEW : Plugins menu prioritization.
NEW : Cheops EMU prioritization.
NEW : SBox EMU prioritization.
NEW : All process priorities fine tuned.
NEW : Better menu detection.
NEW : Better sleep mode detection.
NEW : Loop sleep time decreased from 60 seconds to 30 seconds.
FIX : Sometimes CRTVCore collects all CPU power and this slows down everything. So I
decreased priority of CRTVCore.
FIX : Fixed a bug in restart: /DISK2/etc/start.d/S99PriorityManager.sh restart
v1.1
-----
NEW : RSS and Browser components stay in memory after first usage. Added support for
automatically killing RSS and Browser components when using other menu.
v1.0
-----
NEW : All process priorities updated according to the results of my long tests. IP TV,
Mediaplayer, Recording, ECM Time (for EMUs) performances are optimized.
NEW : Old scripts use "snice +XX" command to give processes positive nice values (lower
priority). But this command does not guarantee to decrease the priority and system
sometimes ignore this command. You can check old scripts by top command while changing
menu modes. "<" sign means negative nice value and high priority, "N" sign means positive
nice value and low priority. After a few times changing the menu modes everything has "<"
sign and this is really nonfunctional situation. To fix this problem I used "snice STOP"
which cannot be ignored by the system.
NEW : massimo1167's script is not compatible with the option "Always Start in TV Mode"
and this causes totally wrong prioritization. This is fixed.
NEW : Old scripts block firmware upgrades and upgrade process sticks at "Extracting".
Priority Manager fixes this issue and fully compatible Opensat upgrades. Just wait 45
seconds at "Extracting", then upgrade process will continue.
NEW : ftp,samba,telnet prioritization in sleep mode. I suggest you to transfer your files
with FTP during sleep mode prioritization. This is the fasted method.
NEW : Photo menu prioritization.
NEW : Browser menu prioritization.
NEW : RSS menu prioritization.
NEW : Use this command to stop the script (does not work in old scripts):
/DISK2/etc/start.d/S99PriorityManager.sh stop
NEW : Use this command to restart the script (does not work in old scripts):
/DISK2/etc/start.d/S99PriorityManager.sh restart
NEW : Logging. Use this command to see log file:
tail -n100 -f /tmp/PriorityManager_IsRunning
INSTALLATION:
------------------------------------------------------------------------------------------
1. Extract PriorityManager.plugin and plugins.lst files from the archive file.
2. Copy PriorityManager.plugin and plugins.lst to USB or simply transfer them by FTP to
/tmp folder of your Azbox.
3. Enter Plugins menu, press Red Button on remote controller to add plugin. If you're
using USB select to install it from USB, or if you transferred files to /tmp folder
install it from tmp folder.
4. Check user defined parameters in /PLUGINS/PriorityManager/settings.txt and edit
parameters if you want, save the file.
5. Activate plugin from the plugins menu: PLUGINS-->PriorityManager-->Activate/Reactivate
6. After the first run of the script standby.sh and wakeup.sh scripts will be created
under /DISK2/etc . These scripts will help to main script for the decision of the sleep
mode by creating and deleting a file ( /tmp/PriorityManager_Sleep ) If you have already
standby.sh and wakeup.sh in /DISK2/etc, they will be backed up by installation process
in the same directory. Then you may want to manually add below commands to scripts
before running Priority Manager:
echo 0 > /tmp/PriorityManager_Sleep = to standby.sh
rm /tmp/PriorityManager_Sleep = to wakeup.sh
IMPORTANT NOTES:
------------------------------------------------------------------------------------------
1. Priority Manager script works in a loop with 30 seconds sleep times. So wait max 30
seconds for prioritization. You can decrease this to 15-20 secs if you want, but values
below 10 may cause a small performance loss.
2. A looped script in /DISK2/etc/start.d/ will block the other scripts with a higher
heading value. So do not use any looped script. This is the reason why I used "99" in the
script name. This will not block any script with two digits but will block scripts with
higher values as heading value.
3. Please do not use any folder in HDD to mount shares. This will cause HDD not to sleep
because of continuous folder checks by Priority Manager. Even without Priority Manager,
it's not recommended, since share access always triggers HDD. Instead I would recommend
you to use folders in internal storage (DOM). If you need to access this mounts directly
from Menus (under main directories of Video, Music, Picture), you can use symlinks
created under HDD pointing mount folders in DOM.
4. If you have any problems with Priority Manager, change VERBOSE_MODE=1 in settings.txt
and reactivate Priority Manager from PLUGINS-->PriorityManager-->Activate/Reactivate.
This will create a verbose log file /PLUGINS/PriorityManager/PriorityManager_Verbose_Log
Collect data with this option set to 1, without stopping, restarting, reactivating and
deactivating Priority Manager, because all this operations will delete all old log files.
Then send an e-mail to author (you can find my e-mail adress in readme.txt) containing
PriorityManager_Verbose_Log with the approximate time that problem occured. Don't forget
to reset VERBOSE_MODE=0 and restart priority manager or logfile size will continuously
increase which may cause internal storage (DOM) to run out of disk space.
UPDATE:
I added PriorityManagerv1.3_by_Buyukbang_ Extracted_Plugin_Version.zip for those having difficulties with azbox plugin installation mechanism. It's really unstable.
Instructions for this verion:
1- Extract PriorityManagerv1.3_by_Buyukbang_ Extracted_Plugin_Version.zip
2- Upload PriorityManager folder to azbox under /PLUGINS folder.
3- chmod 755 everything.
4- Copy S99PriorityManager.sh under /DISK2/etc/start.d/ and chmod 755
5- Copy wakeup.sh and standbye.sh under /DISK2/etc/ and chmod 755
6- Edit settings.txt if you want
7- Activate Priority Manager from plugins menu
DOWNLOAD:
You can download this from attachment or from the alternative link:
hxxp://uploaded.to/file/hkp3s7