PDA

View Full Version : PRIORITY MANAGER V1.3 (Plugin Version):Complete Tool to Power Up Azbox



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

leerock
23-05-2010, 04:34 PM
Thanks a lot buyukbang for your great work...
It s guys like you that keep the community alive....
the box is now performing a lot faster and zapping speed improved a bit...

the only thing i couldn t make to work is the nfs mount...

i ve put in the settings.txt
MOUNT_TYPE=1

REMOTE_IP=192.168.1.10
CHECK_PATH=/DATA/movie

and the nfs parameters are
NFS[1]="mount -t nfs 192.168.1.10:/movies /DATA/movie -o nolock,rsize=32768,wsize=32768,in tr 0 0"

if i run this command via telnet it mounts the shares fine..
now in the log i got nfs mount failed/ check path is empty...

what am i doing wrong?
thanks in advance..

zeini
23-05-2010, 05:12 PM
Many thanks for this usefull plugin.

But I must reported, my old plugins was disappeared after I installed the priority-manager. I had to install all the old plugins again.

buyukbang
23-05-2010, 05:35 PM
Sorry but there is a mistype in explanation part of settings.txt
Set it to 2 for NFS or 1 for CIF...
:

MOUNT_TYPE=2 # ==> IF YOU WANT TO MOUNT CIF SHARES OF YOUR FILE SERVER TO
# AZBOX, JUST SET MOUNT_TYPE=1, EDIT THE CIF[] PARAMETERS FOR
# SHARE PATHS, LOCAL MOUNT FOLDERS, USERNAMES AND PASSWORDS.
# IF YOU WANT TO MOUNT NFS SHARES OF YOUR FILE SERVER TO
# AZBOX, JUST SET MOUNT_TYPE=2, EDIT THE NFS[] PARAMETERS FOR
# SHARE PATHS AND LOCAL MOUNT FOLDERS. TO DISABLE MOUNT
# FEATURE SET MOUNT_TYPE=0.



Thanks a lot buyukbang for your great work...
It s guys like you that keep the community alive....
the box is now performing a lot faster and zapping speed improved a bit...

the only thing i couldn t make to work is the nfs mount...

i ve put in the settings.txt
MOUNT_TYPE=1

REMOTE_IP=192.168.1.10
CHECK_PATH=/DATA/movie

and the nfs parameters are
NFS[1]="mount -t nfs 192.168.1.10:/movies /DATA/movie -o nolock,rsize=32768,wsize=32768,in tr 0 0"

if i run this command via telnet it mounts the shares fine..
now in the log i got nfs mount failed/ check path is empty...

what am i doing wrong?
thanks in advance..

buyukbang
23-05-2010, 05:37 PM
Should be an azbug. Never experineced this, I've 4 other plugins installed...


Many thanks for this usefull plugin.

But I must reported, my old plugins was disappeared after I installed the priority-manager. I had to install all the old plugins again.

kanber_kav
23-05-2010, 05:43 PM
Güzel iş teşekkürler Arkadaşım.

leerock
23-05-2010, 05:58 PM
still doesn t mount...

this is how i got it

MOUNT_TYPE=2

REMOTE_IP=192.168.1.10
CHECK_PATH=/DATA/movie


CIF[1]="mount.cifs //$REMOTE_IP/film /DISK2/mounts/movie -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[2]="mount.cifs //$REMOTE_IP/download /DISK2/mounts/download -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[3]="mount.cifs //$REMOTE_IP/dvd /DISK2/mounts/dvd -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[4]="mount.cifs //$REMOTE_IP/mp3 /DISK2/mounts/music -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[5]="mount.cifs //$REMOTE_IP/pictures /DISK2/mounts/picture -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES

NFS[1]="mount -t nfs 192.168.1.10:/movies /DATA/movie -o nolock,rsize=32768,wsize=32768,in tr 0 0"
NFS[2]="mount -t nfs $REMOTE_IP:/download /DISK2/mounts/download -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES
NFS[3]="mount -t nfs $REMOTE_IP:/dvd /DISK2/mounts/dvd -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES
NFS[4]="mount -t nfs $REMOTE_IP:/mp3 /DISK2/mounts/music -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES
NFS[5]="mount -t nfs $REMOTE_IP:/pictures /DISK2/mounts/picture -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES

Do i have anything wrong in my nfs line?
Via telnet it s working fine though....

xanadu
23-05-2010, 06:01 PM
Many thanks for this usefull plugin.

But I must reported, my old plugins was disappeared after I installed the priority-manager. I had to install all the old plugins again.

That happened to me, but a reboot and everything was back again. :)

No need to reinstall.

maviing
23-05-2010, 06:37 PM
That's excellent, Many thanks...

buyukbang
23-05-2010, 06:44 PM
Mate,

You should delete all example definitions. As written they are just examples :) Plugin will try to mount all activated and defined shares. Not only NFS[1] that you defined, but also NFS[2] , NFS[3]...

So just use this:

MOUNT_TYPE=2
REMOTE_IP=192.168.1.10
CHECK_PATH=/DATA/movie
NFS[1]="mount -t nfs 192.168.1.10:/movies /DATA/movie -o nolock,rsize=32768,wsize=32768,in tr 0 0"




still doesn t mount...

this is how i got it

MOUNT_TYPE=2

REMOTE_IP=192.168.1.10
CHECK_PATH=/DATA/movie


CIF[1]="mount.cifs //$REMOTE_IP/film /DISK2/mounts/movie -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[2]="mount.cifs //$REMOTE_IP/download /DISK2/mounts/download -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[3]="mount.cifs //$REMOTE_IP/dvd /DISK2/mounts/dvd -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[4]="mount.cifs //$REMOTE_IP/mp3 /DISK2/mounts/music -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES
CIF[5]="mount.cifs //$REMOTE_IP/pictures /DISK2/mounts/picture -o username=XXXXX,password=YYYYY" #THESE ARE JUST EXAMPLES

NFS[1]="mount -t nfs 192.168.1.10:/movies /DATA/movie -o nolock,rsize=32768,wsize=32768,in tr 0 0"
NFS[2]="mount -t nfs $REMOTE_IP:/download /DISK2/mounts/download -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES
NFS[3]="mount -t nfs $REMOTE_IP:/dvd /DISK2/mounts/dvd -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES
NFS[4]="mount -t nfs $REMOTE_IP:/mp3 /DISK2/mounts/music -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES
NFS[5]="mount -t nfs $REMOTE_IP:/pictures /DISK2/mounts/picture -o nolock,rsize=32768,wsize=32768" #THESE ARE JUST EXAMPLES

Do i have anything wrong in my nfs line?
Via telnet it s working fine though....

buyukbang
23-05-2010, 06:46 PM
As I told, seems as an azbug, nothing I can do :(

Never experinced this, but plugins intallation module of Azbug is not so reliable. I saw other strange cases :)


That happened to me, but a reboot and everything was back again. :)

No need to reinstall.

leerock
23-05-2010, 06:53 PM
Thanks a lot m8
I though the others were disabled :)
Now it s working fine....
Wow
What a great job!!!!!

nstergi
23-05-2010, 06:54 PM
i also lost my older plugins.

reboot didnt do anything


anyway good work

:respect-046:

buyukbang
23-05-2010, 07:00 PM
Just a note ,

MOUNT_TYPE=0 disables all CIF & NFS definitions,

But when you activate them with MOUNT_TYPE=1 or MOUNT_TYPE=2, you should edit or remove all example definitions.


Thanks a lot m8
I though the others were disabled :)
Now it s working fine....
Wow
What a great job!!!!!

blackhole
23-05-2010, 07:02 PM
It seems that the script is not handling parameters to programs to be started at sleep and stopped at boot.

For example to start all torrent I must call:

/DATA/hdb1/opt/bin/transmission-remote --torrent all --start

And to stop all of them:

/DATA/hdb1/opt/bin/transmission-remote --torrent all --stop

It is possible to use, for example, /DATA/hdb1/opt/bin/transmission-daemon without parameters, but if you kill it waking up the receiver, when you go to sleep transmission will have to verify all the data, and this it will take a very long time.

buyukbang
23-05-2010, 07:08 PM
I thought this, but a bit tired to add this feature. Expect in next release...


It seems that the script is not handling parameters to programs to be started at sleep and stopped at boot.

For example to start all torrent I must call:

/DATA/hdb1/opt/bin/transmission-remote --torrent all --start

And to stop all of them:

/DATA/hdb1/opt/bin/transmission-remote --torrent all --stop

It is possible to use, for example, /DATA/hdb1/opt/bin/transmission-daemon without parameters, but if you kill it waking up the receiver, when you go to sleep transmission will have to verify all the data, and this it will take a very long time.

xanadu
23-05-2010, 10:14 PM
All the menus seem much slower than normal.

My box was faster before, but I will give it a chance.

zmpumm27
23-05-2010, 10:18 PM
Can not install PriorityManager plugin, neither from USB1, nor from /tmp : Fail to install plugin.

No other plugin on AZbox Elite HD, FW 4890, no hardware acceleration, DVB-S2 + DVB-T tuner

Any hint ?

buyukbang
23-05-2010, 10:57 PM
Another azbug :(

Same configuration, only accerelation is on for me.
Just try after a few reboots. Sometimes azbox do this and don't want to install plugins...


Can not install PriorityManager plugin, neither from USB1, nor from /tmp : Fail to install plugin.

No other plugin on AZbox Elite HD, FW 4890, no hardware acceleration, DVB-S2 + DVB-T tuner

Any hint ?

buyukbang
24-05-2010, 12:17 AM
Updated first message with PriorityManagerv1.3_by_Buyukbang_ Extracted_Plugin_Version.zip for those having difficulties with azbox plugin installation mechanism.

leerock
24-05-2010, 09:51 AM
for me the installation went fine but first i deleted the S99PriorityManager.sh from the start.d folder...
maybe this is what is causing the issue?

I m now trying to create a swap file on a memory stick but i get a failed to mount usb message..
I ve tried a memory stick in fat and fa**2 format on usb1 port...
my settings are
SWAPPER=1
SWAPSIZE=204800
SWAPDEVICE=/DATA/usb1/sda1

buyukbang
24-05-2010, 10:07 AM
are you getting "/DATA/usb1/sda1 NOT MOUNTED, CHECKS WILL CONTINUE" error? It means /DATA/usb1/sda1 is not mounted and not listed with mount command.

Just use mount command to decide your usb path, it could be /DATA/usb2/sda1 or if your usb stick has internal usb hub (ie usb+bluetoothe dongles) it even could be /DATA/usb1/sda2 or /DATA/usb1/sda3...


BTW, S99PriorityManager.sh shouldn't be a problem for the installation, it is simply overwritten.


for me the installation went fine but first i deleted the S99PriorityManager.sh from the start.d folder...
maybe this is what is causing the issue?

I m now trying to create a swap file on a memory stick but i get a failed to mount usb message..
I ve tried a memory stick in fat and fa**2 format on usb1 port...
my settings are
SWAPPER=1
SWAPSIZE=204800
SWAPDEVICE=/DATA/usb1/sda1

leerock
24-05-2010, 10:44 AM
are you getting "/DATA/usb1/sda1 NOT MOUNTED, CHECKS WILL CONTINUE" error? It means /DATA/usb1/sda1 is not mounted and not listed with mount command.

Just use mount command to decide your usb path, it could be /DATA/usb2/sda1 or if your usb stick has internal usb hub (ie usb+bluetoothe dongles) it even could be /DATA/usb1/sda2 or /DATA/usb1/sda3...


BTW, S99PriorityManager.sh shouldn't be a problem for the installation, it is simply overwritten.

Ok after some testing I ve found out that the problem is on reboot...
the usb is not mounted on reboot...
if I remove the the stick and place it back again it mounts fine and creates an sda directory...
A restart of priomanager creates the swapfile in sda
(I ve used /DATA/usb1/sda)

But after reboot the usb fails to mount.....

is this an azbug?
how can i fix this?

buyukbang
24-05-2010, 11:25 AM
Reboot is not a problem for me, azbox always remounts USBs. If I'm not wrong, even firmware update from usb needs this? There is a script in azbox firmware that's doing this. not sure, but i think it was usb_script.sh ... I think for some reason it's not working for you. Did you try another usb stick, are you using latest firmware? May be , something you installed blocks the script that I mentioned from working? A clean install may solve your problem or as a work around soution, you can add a script to start.d including just related mount command. If clean install does not solve your problem, this may be a special case that needs an opensat fix.


Ok after some testing I ve found out that the problem is on reboot...
the usb is not mounted on reboot...
if I remove the the stick and place it back again it mounts fine and creates an sda directory...
A restart of priomanager creates the swapfile in sda
(I ve used /DATA/usb1/sda)

But after reboot the usb fails to mount.....

is this an azbug?
how can i fix this?

zmpumm27
24-05-2010, 11:26 AM
My AZbug don't like PriorityManager plugin. Can't install it either way.
Even after multiple reformating of applications area, factory resets, all plugins deleting, firmware reloading, rebooting etc.

Never mind, I'll stick with S99PriorityManager v1.2, which works satisfactory.

Hat down for your achievements.

buyukbang
24-05-2010, 11:34 AM
Apparently, every azbug has different personalities and choices :biggrinjester:

Anyway, did you try extracted version. I updated my first message for those having difficulties with .plugin files. You can manually install it by applying the instructions that I wrote.


My AZbug don't like PriorityManager plugin. Can't install it either way.
Even after multiple reformating of applications area, factory resets, all plugins deleting, firmware reloading, rebooting etc.

Never mind, I'll stick with S99PriorityManager v1.2, which works satisfactory.

Hat down for your achievements.

zmpumm27
24-05-2010, 07:36 PM
Finally suceeded to install Priority Manager plugin manually.

But only after I copied (not moved!) S99PriorityManager.sh to /DISK2/etc/start.d (see item 4. of instructions for manual install).

Suggest you correct instructions accordingly.

Now testing...

buyukbang
24-05-2010, 07:59 PM
Happy to hear that. I hope you enjoy the plugin...

Edit: Sorry for the confusion, you're right. I edited the instructions for manual installation of extracted version. Thanks!





Finally suceeded to install Priority Manager plugin manually.

But only after I copied (not moved!) S99PriorityManager.sh to /DISK2/etc/start.d (see item 4. of instructions for manual install).

Suggest you correct instructions accordingly.

Now testing...

blackhole
25-05-2010, 03:06 PM
First, thank you for your work with this script. Each version is improving something.

I have been testing the script options about transmission and _azepgmgr.

I don't understand why you choose snice STOP for transmission and _azepgmgr in all menus excluding sleep. At first sight I would say that a "snice -v _azepgmgr 5" in all menus would be better (transmission can be started after the launch of the script), so I have changed the script but...

When transmission or _azepgmgr are working in TV menu the azbox will became unstable in standard and modified script, with very slow menus, video stutterings, sometime reboots. If I try to play a movie in the MOVIE menu, most of time it will not even start.

So it seems that transmission-daemon or _azepgmgr are not the real cause. For transmission, for example, I think the problem is internet downloading, that probably is a kernel question. For _azepgmgr the problem must be different. This application is downloading from internet only the first few minutes and after is sending the Epg to the memory. So this could be a question of memory management. I know that you have posed some questions about that to OpenSat but the answers were not very detailed....

My conclusion is that, for the moment, the use of transmission-daemon when azbox is not in SLEEP mode is not advisable. A solution would be to add a transmission-remote command to wakeup.sh and another to standby.sh, so that torrents downloading will start at sleep and will stop at wakeup (with the right parameters, since this is not possible for the moment with the script, as you said before).

This is not a viable solution however since, at least in my case, the box will stop transmission at sleep without problems but will crash most of times at wakeup. I think there is in this case some sort of conflict with your script, or maybe a problem of timing (I am using last firmware. other have reported reboots waking up). My guess is that PriorityManager is starting too late for "nice" optimization going from SLEEP to TV. What do you think?

buyukbang
25-05-2010, 05:03 PM
Hi,

Answers & comments are inline...


First, thank you for your work with this script. Each version is improving something.

I have been testing the script options about transmission and _azepgmgr.

I don't understand why you choose snice STOP for transmission and _azepgmgr in all menus excluding sleep. At first sight I would say that a "snice -v _azepgmgr 5" in all menus would be better (transmission can be started after the launch of the script), so I have changed the script but...

I used to maximize TV&Video watching comfort. _azepgmgr nice values are advised by Smudger and I aggree with him. For transmission, it's really a resource hog while watching TV&Video, even STOP is not enough, they should be killed. But I gave this choice to user with PROGRAMS option.

When transmission or _azepgmgr are working in TV menu the azbox will became unstable in standard and modified script, with very slow menus, video stutterings, sometime reboots. If I try to play a movie in the MOVIE menu, most of time it will not even start.

So it seems that transmission-daemon or _azepgmgr are not the real cause. For transmission, for example, I think the problem is internet downloading, that probably is a kernel question. For _azepgmgr the problem must be different. This application is downloading from internet only the first few minutes and after is sending the Epg to the memory. So this could be a question of memory management. I know that you have posed some questions about that to OpenSat but the answers were not very detailed....
internet downloading is really heavy for azbox's system. -

My conclusion is that, for the moment, the use of transmission-daemon when azbox is not in SLEEP mode is not advisable. A solution would be to add a transmission-remote command to wakeup.sh and another to standby.sh, so that torrents downloading will start at sleep and will stop at wakeup (with the right parameters, since this is not possible for the moment with the script, as you said before).
As I said before, I'll add this functionality in next version

This is not a viable solution however since, at least in my case, the box will stop transmission at sleep without problems but will crash most of times at wakeup. I think there is in this case some sort of conflict with your script, or maybe a problem of timing (I am using last firmware. other have reported reboots waking up). My guess is that PriorityManager is starting too late for "nice" optimization going from SLEEP to TV. What do you think?
After reading your comments here, I struck upon a new idea to improve this. I think I can improve menu detection speed to 1 second without much hog on the system. Expect in next version...

chrissat
25-05-2010, 06:47 PM
Thanks Buyukbang.

Your hard work, time and patience is greatly appreciated.

You're a real credit to the community. :respect-062:

buyukbang
27-05-2010, 11:26 AM
Hi all,

I want to give a status update about next version. I started V1.4 coding and even completed some parts. Smudger helps me to test it and he is creating innovative ideas :) Here is the new history file, all items listed below are completed and I'll add some others beofer its release (release date not planned at the moment). Smudger and me now testing it for stability of new functions:


v1.4
-----
NEW : Busybox can be upgraded automatically in boot from v1.0 to v1.16 with a simple
option in settings.txt (Thanks to Kanber Kav for compiling Busybox!)

NEW : Full automated Cron setup which provides you flexible UNIX scheduling mechanism.

NEW : More speed increase with some new parameter changes for internal storage (DOM) when Busybox upgrade is activated. (Thanks to Kanber Kav for the idea!)

NEW : Up on deactivating or uninstalling Priority Manager, if related features activated
in settings.txt, Busybox downgrades to the orginal version, swap file is deactivated and
all mounted shares are unmounted. Complete rollback without reboot requirement.

ceyar
27-05-2010, 12:52 PM
buyukbang, you are the man :)

massimo1167
28-05-2010, 10:50 AM
@buyukbang
I've installed your plugin with default settings without change anything, after some days I've observed that the temperature of my azbox is bigger than usual, I've understand why: the hard-disk is always working.
In standby mode I saw the hard disk working, after some minutes (the idle time is 10 minutes) stop and after 30 second start work again and so on...

I've deactived your plugin and now everything is ok.

What do you think about?
Thanks

buyukbang
28-05-2010, 12:16 PM
Hmm,

There are two possibilities:

1-
Is /DISK2/reserved.dat a zero byte file ? If you have a reserved program /DISK2/reserved.dat cannot be a zero byte file and only while waiting to record a reserved recording this can occur since script is checking the /DATA/recordfile directory. After recording, if there are no waiting reserved recording all checks stop.

If this is the problem I can examine the code and fix it in v1.4

2- Did you activate MOUNT feature? There is a warning in settings.txt

# !!!!!!!!!!!!!!!!!!! IMPORTANT WARNING !!!!!!!!!!!!!!!!!!!!!!
# 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.
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!




Could you please say me which one is the case for you?




@buyukbang
I've installed your plugin with default settings without change anything, after some days I've observed that the temperature of my azbox is bigger than usual, I've understand why: the hard-disk is always working.
In standby mode I saw the hard disk working, after some minutes (the idle time is 10 minutes) stop and after 30 second start work again and so on...

I've deactived your plugin and now everything is ok.

What do you think about?
Thanks

paasoares
28-05-2010, 03:55 PM
Hi,

Although this is my first post here, i'm following this thread and using this plugin from the first version.

All i can say is "this plugin broght a new life to my AZBOX HD ELITE"

buyukbang thank you so much for this plugin :respect-067:

just keep rocking.

buyukbang
28-05-2010, 04:16 PM
Thanks for your kind words mate. I'm trying to do something useful for Azbox HD community since I like this box as you do.


Hi,

Although this is my first post here, i'm following this thread and using this plugin from the first version.

All i can say is "this plugin broght a new life to my AZBOX HD ELITE"

buyukbang thank you so much for this plugin :respect-067:

just keep rocking.

massimo1167
28-05-2010, 05:40 PM
Hmm,

There are two possibilities:

1-
Is /DISK2/reserved.dat a zero byte file ? If you have a reserved program /DISK2/reserved.dat cannot be a zero byte file and only while waiting to record a reserved recording this can occur since script is checking the /DATA/recordfile directory. After recording, if there are no waiting reserved recording all checks stop.

If this is the problem I can examine the code and fix it in v1.4

No I have a reserved.dat about 2kB with 3 recursive event.


2- Did you activate MOUNT feature? There is a warning in settings.txt

# !!!!!!!!!!!!!!!!!!! IMPORTANT WARNING !!!!!!!!!!!!!!!!!!!!!!
# 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.
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!




Could you please say me which one is the case for you?
I don't have mounted folder.

I will try to active the plugin to test if the hard disk goes to idle mode or if always run.

buyukbang
28-05-2010, 07:01 PM
Hmm, no need to retest it. There is a bug with recursive events :( Thanks for the bug report ! It will be fixed in v1.4

Cheers...


No I have a reserved.dat about 2kB with 3 recursive event.


I don't have mounted folder.

I will try to active the plugin to test if the hard disk goes to idle mode or if always run.

airino
31-05-2010, 09:22 AM
hi,
i tried to activate in settings.txt swap file on usb flash formatted in ex** , but
the log message is:

0:52:38 05/30/10: INCREASING INTERNAL STORAGE (DOM) SPEED
10:52:48 05/30/10: USING EXISTING SWAP FILE
10:52:50 05/30/10: SWAP FILE ACTIVATION FAILED

why?

i also tried to use an usb hard disk but the error is the same.

buyukbang
31-05-2010, 09:46 AM
My understanding from the log:

1- There should a file on the HDD root named "swapfile" .

2- Check this. If it exists give telnet command:
swapon /DATA/usb1/sda1/swapfile
Change /DATA/usb1/sda1 part if it is a usb device, not internal HDD.

3- I command fails write me, if not give telnet command "free" and send me its output.



hi,
i tried to activate in settings.txt swap file on usb flash formatted in ex** , but
the log message is:

0:52:38 05/30/10: INCREASING INTERNAL STORAGE (DOM) SPEED
10:52:48 05/30/10: USING EXISTING SWAP FILE
10:52:50 05/30/10: SWAP FILE ACTIVATION FAILED

why?

i also tried to use an usb hard disk but the error is the same.

sandery
31-05-2010, 11:11 AM
I also had some problems with the swap file.

Here's my scenario:

- installed plugin - box froze
- rebooted - all OK

- swap file created but swapon command always failed

as below:
10:52:48 05/30/10: USING EXISTING SWAP FILE
10:52:50 05/30/10: SWAP FILE ACTIVATION FAILED

- deleted swapfile on HDD
- next loop of script created and activated swapfile
- free command now showed swapfile being used as expected

BTW: Great work - appreciate your efforts.

buyukbang
31-05-2010, 12:35 PM
Hmm,

I created and activated swap with PM at least a thousand time with no problem on both internal HDD and on a flash disk. with no single problem.

There should be a bug in busybox's swapon command under specific cases (but I don't know what)???

Priority Manager v1.4 will upgrade Busybox (optionally) . May be it solves?? But not sure...


I also had some problems with the swap file.

Here's my scenario:

- installed plugin - box froze
- rebooted - all OK

- swap file created but swapon command always failed

as below:
10:52:48 05/30/10: USING EXISTING SWAP FILE
10:52:50 05/30/10: SWAP FILE ACTIVATION FAILED

- deleted swapfile on HDD
- next loop of script created and activated swapfile
- free command now showed swapfile being used as expected

BTW: Great work - appreciate your efforts.

airino
31-05-2010, 03:39 PM
ok , i deleted the file and it now works.

PRIORITY MANAGER V1.3 / MNT:MOUNTED SWP:SWAPPED PRG:PROGRAMS RUNNING
14:35:55 05/31/10: INCREASING INTERNAL STORAGE (DOM) SPEED
14:36:05 05/31/10: CREATING A NEW SWAP FILE
14:36:41 05/31/10: SWAP FILE ACTIVATED

total used free shared buffers
Mem: 100484 97956 2528 0 576
Swap: 204792 0 204792
Total: 305276 97956 207320

14:36:47 05/31/10: OLD=INITIALIZING NEW=TV REC=0 TV=10 MNT=0 SWP=1 PRG=0

thanx!

buyukbang
02-06-2010, 08:49 AM
Latest update for v1.4. Release date is not decided and I'm testing this version. Not much change will be done. This is "near final" v1.4 history:

v1.4
-----
NEW : Faster menu detection alghorithm which dynamically manages sleep time between loops.

NEW : Busybox can be upgraded automatically in boot from v1.0 to v1.16 with a simple
option in settings.txt (Thanks to Kanber Kav for compiling Busybox!)

NEW : Full automated Cron setup. Cron provides a very flexible UNIX scheduling mechanism.

NEW : Moving selected plugins (or optionally all plugins) to internal HDD or USB storages.

NEW : Improvement on automatic management of execution and killing programs: Priority
Manager can start user selected programs when Azbox sleeps. When Azbox wakeups there are
3 things that priority manager can do as an opposite action: kill it, start another
script to stop it or simply do nothing which can be useful if it's a auto-terminated
program or script.

NEW : More speed increase with some new parameter changes for internal storage (DOM) when
Busybox upgrade is activated. (Thanks to Kanber Kav for the idea!)

NEW: Better and faster recording detection alghorithm.

NEW: Mount checks simplified and tuned for better performance. Now you can mount CIF/NFS
shares directly to HDD folders without using symlinks to DOM folders.

NEW: Improved swap file support. Creation of swap file is now retried when "SWAP FILE
ACTIVATION FAILED" error occurs.

NEW : Up on deactivating or uninstalling Priority Manager, if related features activated
in settings.txt, Busybox downgrades to the orginal version, swap file is deactivated and
all mounted shares are unmounted. Complete rollback without reboot requirement.

NEW : Limiting file size of PriorityManager_Verbose_Log with the given byte value.

FIX : HDD not sleeps when reserved programs are waiting to be recorded.

hfmls
03-06-2010, 05:37 AM
bring it on :)
this is just perfect.

buyukbang
06-06-2010, 03:46 PM
Small update, v1.4 testing is ongoing, release date is not decided yet. Here is the v1.4 log with every option except deep sleep activated, new features are highlited in the log:


PRIORITY MANAGER V1.4 BY BUYUKBANG
FLAGS => R:RECORD M:MOUNT S:SWAP A:ACTION B:BUSYBOX C:CRON P:PLUGINS
14:49:16 06/06/10: MOVING PLUGINS TO /DATA/usb1/sda1
14:49:17 06/06/10: GENERATING SYMLINKS TO /DATA/usb1/sda1 IN /PLUGINS
14:49:18 06/06/10: MOUNTING /DATA/usb1/sda1 TO /PLUGINS
14:49:19 06/06/10: PLUGINS MOVED
/dev/sda1 on /PLUGINS type ext2 (rw,nogrpid)

14:49:22 06/06/10: INCREASING INTERNAL STORAGE (DOM) SPEED
14:49:23 06/06/10: UPGRADING BUSYBOX
14:49:35 06/06/10: BUSYBOX UPGRADED
14:49:36 06/06/10: CRON ACTIVATED
# THESE ARE JUST EXAMPLES, ADD YOUR ENTRIES WITHOUT LEADING #
# 30 14 * * * /DATA/hdb1/EPG/cronepg.sh
# 50 20 * * 0 /opt/rsync.sh
# 0 10 * * 4 /DATA/hdb1/EPG/update.sh
* * * * * /DISK2/etc/test1.sh

14:49:49 06/06/10: USING EXISTING SWAP FILE
14:49:50 06/06/10: SWAP FILE ACTIVATED
total used free shared buffers
Mem: 100484 96772 3712 0 2588
Swap: 204792 0 204792
Total: 305276 96772 208504

14:49:55 06/06/10: NFS MOUNT COMPLETED
192.168.2.12:/film on /DATA/hdb1/movie/film type nfs
192.168.2.12:/download on /DATA/hdb1/movie/download type nfs
192.168.2.12:/mp3 on /DATA/hdb1/music/PC type nfs
192.168.2.12:/pictures on /DATA/hdb1/picture/PC type nfs

14:49:59 06/06/10: START=>TV TV=13 R=0 M=1 S=1 A=W B=1 C=1 P=1
14:50:31 06/06/10: TV=>SLEEP TV=10 R=0 M=1 S=1 A=S B=1 C=1 P=1
14:53:26 06/06/10: /bin/sh /DISK2/etc/test2.sh EXECUTED
14:53:27 06/06/10: /bin/sh /DISK2/etc/test5.sh IS NOT RUNNING
14:53:27 06/06/10: /bin/sh /DISK2/etc/test4.sh EXECUTED
14:53:29 06/06/10: /bin/sh /DISK2/etc/test6.sh EXECUTED

hfmls
06-06-2010, 04:11 PM
thank you :) hard testing going good?

buyukbang
06-06-2010, 04:54 PM
Yes, testing phase of this version will take a little more time since I don't wanna publish a defective plugin. This version includes moving PLUGINS feature which really needs a hard testing.


thank you :) hard testing going good?

hitman222
15-06-2010, 09:34 PM
Yes, testing phase of this version will take a little more time since I don't wanna publish a defective plugin. This version includes moving PLUGINS feature which really needs a hard testing.
When will the next version PRIORITY MANAGER? We can not wait. :respect-050:

hfmls
15-06-2010, 10:05 PM
buyukbang can u pls test latest priority manager 1.4 with latest firmware please and make heavy tests on that firmware? :)

thank you very much. if u need some tester, count me in

buyukbang
15-06-2010, 11:48 PM
I'll release 1.4 in this week. Just a few last days with patience :)


When will the next version PRIORITY MANAGER? We can not wait. :respect-050:


In fact I really need especially for plugin move function. Others seems OK by now.


buyukbang can u pls test latest priority manager 1.4 with latest firmware please and make heavy tests on that firmware? :)

thank you very much. if u need some tester, count me in

hitman222
20-06-2010, 06:37 AM
[QUOTE=buyukbang;730897]I'll release 1.4 in this week. Just a few last days with patience :)
We can not wait. :bowing-036::respect-063::bowing-036:

buyukbang
20-06-2010, 10:17 PM
Unfortunately, I was very busy with my job for last days, this caused an extra delay for v1.4 :( But good news is that I've new ideas for v1.5 and I'm adding its basis (not 1.5 functions, just code basis) in v1.4, so v1.5 will be easier for me and I'll publish it in less time :)