 If you enjoy my tutorials and would like to see more, please think about contributing to my Patreon account at patreon.com forward slash metalx1000. Okay, continuing this series on advanced Android shell commands. We're going to be looking at going into a chur route today of a Debian system on an Android device and starting up mPlayer. So I'm already logged into my shell and again these tutorials assume that you already know the basics of a Linux system or at least a Unix system of some sort. You know a little bit about ADB, Android, debugging shell and your device story rooted. Be sure also to back things up so you can recover if you screw stuff up. But you should be doing that anyway. Okay, so I'm on my Android device here in a shell. I'm going to go to my internal storage SD card here. And the first thing I'm going to do is I'm going to mount my chur route image. So if I list here you can see I have a couple of files in here. I have one called Debian arm image. I made that yesterday using the bootstrap. I have videos on that. I'm going to mount that to this folder, Deb. So if I list out right now the Deb folder, there's nothing in there. So what I'm going to do is I have a full version of busybox on here which gives me true and mounting capability. So I'm going to say mount dash o loop and type. In this case it's an ext4. That's just how I formatted the image, the image name and where I want to mount it. Now if I list out that Deb folder again you can see the Debian file system. Now before I chur route into that I'm going to go into that directory and I'm going to mount again. I'm not going into detail on chur routing but depending on what you're doing there's a couple of things you probably want to mount when starting a chur route. Your Deb folder, your PTS devices, your proc folders and your sysfs are a few. But really today with what we're doing all we need to do is mount the Deb folder. So to do this I'm going to use the busybox version of mount because the default one on Android won't allow me to do this. So I'm going to say busybox mount dash dash bind forward slash dev so that's saying mount the real folder on our Android device and I'm going to say to the Dev folder that we're currently in on this Debian file system. That way we have access to all the hardware, all the devices on the Android system. Done. Another thing we want to do here and I think I'll probably mention this in the last video. If we list out our dev folder for FB which is our framebuffer it says no devices, no such file or directory. It's because by default on most Android devices the framebuffer device is actually under a graphics folder. So what we're going to do here since mplayer is going to look for it under device fb0 we're going to use a link and make a symbolic link to device graphics fb0 and we're going to link that to fb0 in our device folder. And of course that will also associate it inside our churroot since we mounted our dev folder right here to our churroot environment. So basically when mplayer in this case or whatever program you're using looks for the framebuffer device here it's saying yeah we have that it's not here, look here. Okay. So we did that. Now let's do one last thing. At one point in the tutorial we're going to need to know our screen resolution of our Android device. There's a few different ways you can do that. The way I have found that has worked on most devices for me is dumpsys window and then we'll grep because that outputs a lot of information. We're just going to say screen with a capital S and it gives us a few options here but we want this unrestricted screen which in the case of my tablet is 800 by 480. Now that we know that we can go into our churroot environment. So I'm going to say churroot and again you have to be root to do this dot meaning the current directory because I am in the directory of my file system. And I'm going to say we're going to start up bin bash to give us a bash shell. I am now going to go into my root directory. I am root and I'm going to say list I have a bunny dot mp4 that's big buck bunny that I downloaded off of YouTube. I downloaded a lower resolution version. First off my display is only 800 by 480 but also we're going to be writing to the frame buffer which is a little bit slower than other techniques. But that's how we're going to have to do it here because even the way I know how to do it on an Android device. And if you've watched the last video on frame buffer device I explained that a little bit more in detail there. Well in this Debian environment I have already installed mPlayer so let's go ahead and give it a try. If I type in just mPlayer and give it the name of the file and try to start it it's going to tell me here in a second there we go. It's trying uh oh couldn't open x11 display because we're not running x11 and it's here you can see vo for video out. It's trying to use an x display which doesn't exist. So I'm just going to kill that and what I'm going to do is I'm going to run the same command but add something to it. I'm going to say dash vo for video out and I'm going to tell it to use fbdev. Use the frame buffer device which it will look for again under dev forward slash fb0. I will hit enter at this point and as you can see we get the video playing on top of our Android interface. Now we can't really interact with it because we're just writing raw information to the screen. You can see there's a little bit of flickering going on. If we try to do anything you can see that I'm still moving the Android desktop and it's flickering because they're trying to overwrite. They're both writing to the frame buffer so that's an issue we're going to take care of here in a moment. But just so you know that we are writing to that. But you notice it's up in the top left corner now. I just killed it and it took a second to clear because it's going to stay there until something rewrites to the video device, the frame buffer device. Let's say we want it centered. What we can do is we go dash fs which stands for full screen and it doesn't really go full screen because we're writing to the frame buffer device. So it's writing it at whatever resolution the video is. We still have this right now it's a black border but if anytime the Android interface tries to update the frame buffer as if I move it here now we can see the Android interface in the background. And again anything on the Android device trying to update the frame buffer will make our video flicker. Let's go ahead and control Z to kill that and add one more thing. Let's say we did want to try to make it full screen. What we can do is we can add the zoom command and we can say dash x and as we looked up the resolution of my device is 800 dash y by 480. And here you can see it is full screen but you also notice it's playing a little bit slower. Again we're writing directly raw information to the frame buffer device. It's not the most efficient way to do it and I don't know how to make it full screen without running slow. The only thing I can think of and I haven't tried this is actually saving the video at the resolution I want. So I could resave this video as 800 by 480 and it might work. As you can see this video itself is 640 by 360. I don't know if the larger file size would make it run slow and in this case it's just the zoom that's making it run slow. So I did try adding to this dash frame drop which should drop frames if it's running slow but it doesn't seem to make a difference. It still runs slow so that didn't work. But maybe someone a little more familiar with M player configurations would know a little bit more about how getting that to work efficiently. But how do we fix this whole flickering of the Android interface? Well what we can do is we can kill the Android interface and the way we can do that is exiting out of our chur route and running this command. Set prop ctl.stop media and also another command set prop ctl.stop zygote. Now zygote is the process that Android uses to spawn all the other Android processes. So killing that will kill all the Android applications, all the interfaces. So we'll do that and as you can see on the tablet everything has gone black because we killed the Android desktop. Now we can go back into our chur route, go to the folder the video is in and run our M player command again. And as you can see we have the video playing here. No flickering. I can do this. We're not touching anything. Now another thing since we killed the Android interface we've also killed all the buttons. So I can hit the power button, the volume buttons, the menu buttons over here. Nothing happens because they've all been disconnected from any software. So why would you want to do this? Well besides just understanding a little bit about how things work and having fun. One practical use I could think of is if I wanted to hand this tablet to my daughter so she can watch a video. If I gave her an irregular video application if she touched the screen or the home button or the menu button or the power button or the volume button or the back button it would stop the video or she would fast forward in the video. But here I can hand this to her and besides throwing it on the ground and breaking it she's not going to mess up what's going on there. So that's just one thought I had and I'm sure there's other ways to do that. But you might be saying well that's kind of a pain in the butt how do I do this without using the Android debugging bridge to get into the device. Well first off let's exit out of our char route. By the way I hit control C to kill M player. And as you can see the picture is still up on the screen because the frame buffer hasn't been refreshed. But what I'm going to do here is I'm going to run the same command before that we used to kill the Android display. But instead of stop I'm going to say start so I'm going to start both those services up which is going to start all the other Android services up. There we go. Now you can run shell scripts on Android. Again it is a Linux environments and Linux kernel. So what I'm going to do here is show you that I have in the folder above this a file I called video.sh. Go into that. There we go. And with three lines of code we can kill the Android interface. Start the char route. By the way you would have to have the char route already mounted for this to work which you could put in another script or at the top of this script. But if it's already mounted we can kill the Android interface. Go into our char route start M player and play this video with the commands that we put in earlier. And then as soon as that video is done playing we can restart the Android interface. And you can run the shell script from the Android interface using connect bot or some other terminal or shell interface that you can get for Android. So I'm going to run it from here just to make it a little bit easier but I'm going to say sh. Now because the folder I'm in is the storage on Android which uses a FAT32 I can't change mod plus x to change the permissions of that file. So I'm going to have to say sh to run the shell but we're going to say run this. So you can see as soon as I start running that script it kills the Android interface and it starts up our video. And now this video will continue playing until it reaches its end. So if it's a two hour video it will go two hours. If it's 10 minutes it will go for 10 minutes. But as soon as that video is done playing M player will escape and I'll hit up arrow here to try to jump ahead in the video which will kill M player in this particular case. Right away it continues our script and resarts the Android interface. So you can put that in a shell script start it from within the Android interface which will kill the Android interface. When you restart M player when M player is done it will restart the Android interface. And that is one option. I also believe and I haven't tested this even though the buttons don't seem to be working when we're in that M player with the Android killed they don't seem to be working. I think that if you do a long hold on the power button for 10 seconds or whatever it would still restart the device so you can always get out of it that way as well. Because otherwise you just have to wait till the video ends there's no other way to stop it without hooking up a USB device to it or USB to your computer. So that's just a quick look a little bit of fun with M player and the Android interface using a Debbie and Cherute or whatever distribution of lengths you like that's compiled for ARM. You can mount that image and go ahead and start running whatever programs you want. Now in the next tutorial we're actually going to get into starting up a full X org session so you can have multiple windows open. It'll be a very basic look at that and then the basic concept of it killing the Android interface starting X org. There'll still be some configuration that I'm not going to get into in that video as such as touchscreen configuration but you will see that it is possible without any VNC interface which is something some people do. But you can really truly kill the Android interface and start up X org and have a true Linux environment running on the Android kernel using a, in this case we'll use a Debbie and file system. So that will be next week. I hope you're enjoying this series of Android videos. They were voted on by my Patreon viewers as this series. If you like this topic or other topics you can have a say on what videos coming up by becoming a patron of mine over at patreon.com. It's patreon.com forward slash Melix 1000. There should be a link in the description. And there you can become a patron of mine and help support my video, my work and all the tutorials I do. And you also have a little more say on what videos I do. I listen to all my Patreon viewers. You can suggest stuff. And each time I start a new series, patrons in a certain level get to vote on the topics that I do next. And Android was what was picked last time around. And so if you want to see more of these you can definitely have a say if you're one of my patrons. So I thank you for watching whether you're a patron or not. I appreciate your views. And as always I hope that you have a great day and please visit filmsbychrist.com. That's Chris with the K and as always have a great day. Today we're going to be looking at using bootstrap to create arm images for devices such as Bogo plugs or to get Debbie in the picture. This is my download profile. You could do four connections and speed up your download. Another option would be sometimes servers have mirrored servers. So even though you have that original server you may have another server here and here that you can download from. And Axel allows you to do that too. You have the same file on multiple servers.