[ThinkTank]Replacing bootanimation.

Search This thread

zaduma

Senior Member
Aug 18, 2010
246
27
Indiana, USA
Ok, so here is a bit of a preamble to stop flaming and unnecessary posts in this thread. This thread is not about changing bootdown animation for that go here.

Also do not do this if you don't understand what this all means, i am not responsible for your device, or anything else.

To the post:
I flashed back to stock last night to help everyone who wants to be able to use custom bootanimations (those like most other android phones can.) By placing a bootanimation.zip into /system/media and it should play when you boot. However as most of you know their is a proprietary format (QMG) getting called. Since I do not want to pay Quram and I also want custom bootanimations it leaves me with one choice, make it call the bootanimation.zip IN STEAD of the bootsamsung(loop).qmg. This is where what I am trying is different then other attempts I have read. Most other attempts try to break the QMG, why not just go around it and call what you want anyway.

The goodies:
I can get a custom bootanimation (specifically this one here) to play on my phone. Should work for any custom bootanimation.zip as long as it is built properly. Try to find one for our resolution or it will be tiny, but whatever I'm sure you can fix that right. You are in development forum anyways. ;) There is a weird delay between the black and white VIBRANT screen and the animation playing but since it is progress and on the stock rom (rooted of course) I am going to post what I did, and others can come in and help. ALRIGHT!

What to do:
Open up your command prompt and cd to the directory with your adb i.e. cd C:\adb\. Also place the bootanimation.zip (C:\adb\bootanimation.zip)
Then run this below in your command prompt window.
Code:
1. adb push bootanimation.zip /sdcard/bootanimation.zip
2. adb shell
3. su  (NOTE: Allow root access on actual phone)
4. mount -o remount,rw /dev/block/st19 /system (NOTE: This just allows read/write access on /system)
5. busybox cp /sdcard/bootanimation.zip /system/media/bootanimation.zip
6. cd /system/bin/
7. mv playlogo playlogoBKP
8. mv playlogos1 playlogos1BKP
9. busybox cp bootanimation playlogo
10. busybox cp bootanimation2nd playlogos1

Now go ahead and reboot and enjoy your own custom bootanimation.zip
Also when done playing around you might want to revert everything back, cause I do not know if there are other repercusions of doing this. Although none I have noticed.

Video Evidence. (Because I am not a recognized member of this forum)

Replacing the bootanimation sounds and bootdown is not something covered by this thread as it is super easy, just go here.

Q. Well it seems like you figured everything out already Zaduma, what do we need with a thinktank thread about this?
A. There is a delay that lasts between 3-5 seconds between VIBRANT Screen and actual animation playing. Let's get rid of this.


Updates (not reflected above.) -- I will try to keep this updated with important information so you can just jump in.
We might be able to remove the lag if we can edit the init.rc, it calls playlogos1 only, which pretty much means that playlogo, bootanimation, and bootanimation2nd are useless files, of course unless you rename them playlogos1. The problem with this is that playlogos1 is called like this.
Code:
service playlogos1 /system/bin/playlogos1
    user root
    oneshot
But bootanimation should be called like this (as we know from AOSP builds and from bootanimation2nd, which i think is probably samsungs first attempt to put proprietary QMG in opening)
Code:
service bootanim /system/bin/bootanimation(2nd)
    user graphics
    group graphics
    disabled
    oneshot
I am not 100% sure of why being called from user graphics (most likely a root access user, or the disabled line would have anything to do with anything, but they are there.)

Also something I have seemed to find conclusive, if you run /system/bin/bootanimation it plays the animation almost instantly, but if you run /system/bin/bootanimation2nd it plays after a bit of a delay. So after renaming bootanimation to playlogos1 I noticed no change at actual boot time. I really feel like being able to update init.rc might hold some key, this is just a hunch I'm kinda figuring out what I can as I go.
 
Last edited:

d_bot

Senior Member
Sep 15, 2009
393
7
K-Town Utah
I can confirm that this does indeed work, and the lag is annoying :) is the lag from the bootanimation & bootanimation2nd?

+1 confirmed working, plays for maybe two seconds, then displays home screen.

EDIT: in a logcat i noticed "Unable to open zip '/data/local/bootanimation.zip': No such file or directory" I tried placing the bootanimation.zip into the /data/local folder, but am still getting the lag between the white vibrant and the animation....

Edit2: I tried editing the pngs in the zip file. I wanted to know at want frame the animation was playing and what frame is was stopping at. so i just painted the frame number on top of the picture, rezipped/pushed/copied/rebooted, and now all i get is the white vibrant, followed by pure black screen for a few seconds, then the lock/home screen.........not sure if there is a file size limit, or what...if i push the original bootanimation.zip i get the animation back......
 
Last edited:

zaduma

Senior Member
Aug 18, 2010
246
27
Indiana, USA
Edit2: I tried editing the pngs in the zip file. I wanted to know at want frame the animation was playing and what frame is was stopping at. so i just painted the frame number on top of the picture, rezipped/pushed/copied/rebooted, and now all i get is the white vibrant, followed by pure black screen for a few seconds, then the lock/home screen.........not sure if there is a file size limit, or what...if i push the original bootanimation.zip i get the animation back......

Here I got it working, trick is when you put it into an archive to put archive to store, so it doesn't compress the files. I have attached a custom "Haters" bootanimation with painted frame numbers. You might notice that the files are not jpg, that is just what i saved them as. It didn't seem to reveal to much to me. I don't think the problem is with the animation, I think it is when it gets called, not exactly sure of course.

Also about your log. When it looks for a bootanimation it checks /data/local first and if it finds nothing it goes to /system/media. I believe /data/local is a legacy command and for forward compatibility you should just get in the habit of using /system/media.

This lag is very puzzling, I am gonna try and pull the bootanimation / playlogo files off of other android phones or maybe android open source and see what happens...

For anyone who happens to want to look at what bootanimation / bootanimation2nd / playlogo / playlogos1 is remember they can be opened with 7zip and viewed as an archive. Inside them are 6 files 0, 1, 2, 3, 4, 5 (if memory serves). It all looks arbitrary to me however, just a bunch of random junk.
 

Attachments

  • bootHatersCustom.zip
    1.6 MB · Views: 136

camalot

Retired Recognized Developer
Jul 25, 2007
643
138
46
Hickory Hills IL
de.codeplex.com
Here I got it working, trick is when you put it into an archive to put archive to store, so it doesn't compress the files. I have attached a custom "Haters" bootanimation with painted frame numbers. You might notice that the files are not jpg, that is just what i saved them as. It didn't seem to reveal to much to me. I don't think the problem is with the animation, I think it is when it gets called, not exactly sure of course.

Also about your log. When it looks for a bootanimation it checks /data/local first and if it finds nothing it goes to /system/media. I believe /data/local is a legacy command and for forward compatibility you should just get in the habit of using /system/media.

This lag is very puzzling, I am gonna try and pull the bootanimation / playlogo files off of other android phones or maybe android open source and see what happens...

For anyone who happens to want to look at what bootanimation / bootanimation2nd / playlogo / playlogos1 is remember they can be opened with 7zip and viewed as an archive. Inside them are 6 files 0, 1, 2, 3, 4, 5 (if memory serves). It all looks arbitrary to me however, just a bunch of random junk.

AFAIK, i don't remember seeing the "bootanimation", "bootanimation2nd", "playlogo" and "playlogos1" on any AOSP builds. I think those may be a SGS thing. Also, the /data/local/ i believe is used because it is writable by user, if i remember correctly, and would not require root to put a file there. But I could be wrong about that.

Why did you rename the bootanimation & bootanimation2nd as playlogo and playlogos1? does that tell it to load the /system/media/bootanimation.zip?


edit: ok, I was wrong... bootanimation is there, but not bootanimation2nd and not playlogo / playlogos1
 
Last edited:

j_r0dd

Senior Member
Jun 9, 2009
806
287
Last house on the block
i think editing the init.rc properly could do this how it is in aosp. the following is in our init.rc. These are the two that stick out to me. you see the 1st one is commented out.

Code:
#service bootanim /system/bin/bootanimation2nd
#    user graphics
#    group graphics
#    disabled
#    oneshot

Code:
service playlogos1 /system/bin/playlogos1
    user root
    oneshot

It looks like this in an aosp rom.

Code:
service bootanim /system/bin/bootanimation
    user graphics
    group graphics
    disabled
    oneshot
 
Last edited:

Genesis1791

Senior Member
Aug 7, 2010
62
0
i think editing the init.rc properly could do this how it is in aosp. the following is in our init.rc. These are the two that stick out to me. you see the 1st one is commented out.
Exactly what has to be done. That requires a kernal edit tho if I'm not mistaken as init.rc get reloaded every time the phone is restarted.
 

Dani897

Senior Member
Aug 16, 2010
3,615
670
Designgears at the captivate forum says he and a coworker got it working on the cappy. He didn't give details but he's including it in his next incarnation of his ever popular rom for the captivate.

Its good to see that this has been figured out. Here as well. I can't wait to try it

Sent from my SAMSUNG-SGH-I897 using Tapatalk
 

zaduma

Senior Member
Aug 18, 2010
246
27
Indiana, USA
Samsung I hate you. Edited so that people don't get silly ideas.

Trying to look through the AOSP. I can confirm that there is only bootanimation. I'm going to probably end up compiling some of it from source, it would be nice to know exactly what is happening in playlogos1, it might be just calling the animation but I find it unlikely.

Also if anyone can send me information about how to edit the initrd I would be very thankful. I guess I can just rename whatever file I want to playlogos1 but then it doesn't have the full set of options Running into problems trying to compile android from source, fricken a.

End of the day I need to figure out how to edit init.rc and have the changes be saved, because obviously it gets overwritten when you turn your phone off/on.
 
Last edited:

zaduma

Senior Member
Aug 18, 2010
246
27
Indiana, USA
it works but disable my lag fix , there's a way i can do its w/o removing the lag fix?

I don't know. If you are running any of eugene's roms edit playlogosnow and not playlogos1, because he is running a custom set of commands there and calling playlogosnow at the end.


Also: OP updated.

Edit:

Designgears at the captivate forum says he and a coworker got it working on the cappy. He didn't give details but he's including it in his next incarnation of his ever popular rom for the captivate.

Its good to see that this has been figured out. Here as well. I can't wait to try it

Sent from my SAMSUNG-SGH-I897 using Tapatalk

I'd love to see where you read this, I searched that thread and there is talk about only playing the logos through playlogos instead of using it as a place to launch lagfix's since custom kernels now support userscripts...


Just ran
Code:
cd /system/bin
ls -l playlogos1
which revealed that root.shell owned the file and it's permissions were set to -rwxr-xr-x-
so i went ahead and
Code:
mv playlogos1 playlogos1BKP
cp bootanimation playlogos1
ls -l playlogos1
which revealed that root owned bootanimation so now i ran
Code:
chown root.shell playlogos1
to fix ownership and made sure permissions were set for this owner
Code:
chmod 755 playlogos1

Effect: nothing, don't bother. ;)
 
Last edited:

j_r0dd

Senior Member
Jun 9, 2009
806
287
Last house on the block
All you need is playlogos1 removed from init.rc and uncomment bootanimation from there. Then on boot the phone will activate the bootanimation binary instead. I have no clue how to edit the initramfs to include the edited init.rc. I have ben looking all over for instructions or some script to split/repack. Maybe JAC could incorporate this into his release, but probably won't because I am sure there are many people that like the samsung bootanimation. I for one like it, I just wish it was in .zip format.

Sent from my SGH-T959 using XDA App
 

zaduma

Senior Member
Aug 18, 2010
246
27
Indiana, USA
All you need is playlogos1 removed from init.rc and uncomment bootanimation from there. Then on boot the phone will activate the bootanimation binary instead. I have no clue how to edit the initramfs to include the edited init.rc. I have ben looking all over for instructions or some script to split/repack. Maybe JAC could incorporate this into his release, but probably won't because I am sure there are many people that like the samsung bootanimation. I for one like it, I just wish it was in .zip format.

Sent from my SGH-T959 using XDA App

Nah, i have done this. It reflashes init.rc at boot and at shutdown. Without repacking it, the changes won't last long enough to see boot time.
 

ndhr3d

Senior Member
Aug 27, 2010
61
1
Kansas City
Bringing this topic back to life hopefully!!!

Has anyone looked into this anymore? I've been playing with it for a couple days now and can get the first 45 or so of my 60 frames to play using the desc file included but replacing the text

"320 480 13p 0 0 animate"

with

"480 800 60
p 0 0 animate"

(480 800 - screen resolution... 60 - frames/sec... p - ???... 0 - # of times to repeat... 0 - # of frames to pause after last frame... animate - folder png's located in)

It seems as if I'm limited to a certain amount of TIME not frames... Like the phone breaks the boot sequence into 2 separate time slots... one for T-Mobile sequence and one of Galaxy-S sequence... not a restriction on frames like the bootdown sequence has. I played with changing the frame-rate (the 13 and the 60) to different variations including 1, 30, 60, 80. I got further along in my animation with each variation, but it seemed as if it hit a time restraint wall and it hard stopped the animation.

Also, another reason I think it is alloting 2 separate time slots is that the Droid boot animation file contains 2 separate folders "part0" and "part1" with png files in both, and their desc.txt file contains text calling both folders out?? Could that have something to do with our animation pausing 3-5sec?? Is it looking for another animation call? Do we need more than one boot sequence?

It's late here and I'm not going to play with it any more tonight, but I'll skim more of the surface tomorrow. I'm no pro at this stuff as this is my first android and phone development is completely new to me, so don't poke too hard. If this is old news and someone has figured it out, a nice 'how-to' would be greatly appreciated!

One last thing... I failed to make a backup of my original stock bootanimation.zip file... would it be too much to ask someone to post one or send me a copy so I can revert without nandroid restoring??
 

Babyface1249

Senior Member
Feb 20, 2010
474
5
Salt Lake City, UT
It's late here and I'm not going to play with it any more tonight, but I'll skim more of the surface tomorrow. I'm no pro at this stuff as this is my first android and phone development is completely new to me, so don't poke too hard. If this is old news and someone has figured it out, a nice 'how-to' would be greatly appreciated!

One last thing... I failed to make a backup of my original stock bootanimation.zip file... would it be too much to ask someone to post one or send me a copy so I can revert without nandroid restoring??

I realize you said it was late, but did you mean the stock .qmg file?
 

ttabbal

Senior Member
Jul 1, 2009
2,076
723
Samsung Galaxy S21 Ultra
I have edited the init.rc and can run the bootanimation binary. The problem is, it never stops. Does anyone know how the AOSP boot animation is supposed to be halted? I have to adb shell into the phone and kill the bootanimation process.

If you want to mess with it, check out my kernel. You can run a script to replace init.rc at bootup before Android's init app loads up. :D
 

ndhr3d

Senior Member
Aug 27, 2010
61
1
Kansas City
I realize you said it was late, but did you mean the stock .qmg file?

Whichever was what the phone was calling before I started destroying everything!

The cmd code included creating BKP files of the playlogo and playlogos1 files, but both of those I've overridden. Not sure if I need those to bring back the original boot sequence.

ttabbal; said:
Does anyone know how the AOSP boot animation is supposed to be halted?

I know nothing about android development other than the few things I've been able to modify by swapping out png files or flashing with recovery... I wish I had enough time in my day to learn about it all. The one thing I remember from the Droid forum I read was that a 0 in the desc file after the p means 'infinite loops'... maybe simply change that to a 1 and see if it plays through only once??

Reference to that infinite: http://www.machackpc.com/featured/how-to-changecreate-your-boot-animation-for-droid/

If you got it all to work and play the entire loop with no 3-5sec delay prior, that is fantastic! Otherwise I guess I could Nandroid back... luckily I was smart enough to create a backup before starting to mess around in my system files!