Skip to content

Mobile

Transcoding for mobiles

transcode-icon

There are times where I need a few films on my mobile for my son to watch. For my particular mobile "Galaxy Gio" the constraints for hardware acceleration is 360p as anything bigger will cause it to switch to software which is slower and sometimes a slideshow. For the uninitiated, 360p means either 480x360 at 4:3 ratio (your old TV) or 640x360 at 16:9 ratio (your HD TV).

First we need to cleanup our file names and sometimes 'rename' doesn't work properly. We list all files and separate them by commas and then parse line by line to first remove everything between () and then everything between []. We then move from the old name to the new name. File name cleanup: IFS=","; files=`ls --format commas | tr -d '\040\011\012\015'`; for file in $files; do newfile=`echo $file| sed 's/(.*)//' | sed 's/\[.*\]_//' | sed 's/_\[.*\]//' `; mv $file $newfile; done The code above will try to remove spaces, and everything between () and [].

ls | while read -r FILE do mv -v "$FILE" `echo $FILE | tr ' ' '_' | tr -d '[{}(),\!]' | tr -d "\'" | tr '' '' | sed 's/_-_/_/g'` done The above code will convert all your spaces to underscores, remove characters like {}(),! and convert the filename to lowercase.

ls | while read -r FILE do mv -v "$FILE" `echo $FILE | tr ' ' '_' ` done The above just converts all spaces to underscores.

Mass encoding: IFS=', '; set +x; for x in `ls --format commas | tr -d '\040\011\012\015'`; do height=`mediainfo $x | egrep -i "Height " | cut -d":" -f2 | sed 's/[^0-9]*//g'`; if [ $height -gt 360 ]; then name=`echo $x | sed 's/[^0-9]*//g'`; avconv -i $x -vcodec mpeg4 -acodec copy -scodec copy -threads 4 -vb 800000 -vf scale=640:360 series_name_${name}_SD.mkv; fi done

This last bit will go through your directory looking for media files who's height is greater than 360 and then transcode it to a lower resolution MKV file. Feel free to change MKV to AVI or whatever avconv supports as a container format. This keeps the original music, fonts and subtitles intact. By lowering the resolution, we match the screen resolution of the mobile and allow for hardware acceleration which will spare your battery. This has been incredibly handy during long flights with the kids.

Update: Convert to xvid that converts the audio track to mp3, this helps with playback on low end hardware DVD players as well as mobiles. avconv -i something.HDTV.mkv -vcodec mpeg4 -vtag xvid -acodec libmp3lame -ab 128k -ac 2 -ar 44100 -scodec copy -threads 4 -vb 800000 -vf scale=640:360 something.HDTV.avi

For aac (better quality and to preserve 5.1 audio): avconv -i something.HDTV.mkv -vcodec mpeg4 -vtag xvid -acodec aac -ab 192k -ar 44100 -strict expiremental -scodec copy -threads 4 -vb 800000 -vf scale=640:360 something.HDTV.avi

Should you need to adjust the aspect ratio and/or scale down, there are tools available to help. Aspect Ratio Calculator avconv -i something.HDTV.mkv -vcodec mpeg4 -acodec aac -ab 192k -ar 44100 -strict expiremental -scodec copy -threads 4 -vb 800000 -aspect 45:22 -vf scale=640:313 something.HDTV.mkv

Upgrade Samsung Galaxy Gio to CyanogenMod 10.1

Android

After about a year of Gingerbread (2.2.3) and CyanogenMod (7.2), I thought it was time again to look at further upgrades to my Galaxy Gio. This was apparently enough time for developers to work out problems involved in dealing with Ice Cream Sandwich (4.0.x) and Jelly Bean (4.[1-2].x) such as no ICS (or greater) libs and codecs from Qualcomm for the MSM7x27 family of chips for hardware acceleration.

Thanks to the Samsung Galaxy Gio community at xda-developers, we now have CyanogenMod (10.1) which is based on Jelly Bean (4.2.2) that is usable for every day use. There are a few things that I've noticed that are not perfect, but it is a fully usable ROM. Before you do anything suggested below, it is wise to first backup anything you think important and not just to your SD as it will be overwritten to support an extra ext4 partition that can be used to store your applications and save valuable space. Make sure your SD is rated 6 or better.

You will need a new version of the Clockworkmod recovery rom for your Gio that specifically supports Jelly Bean. You should read more about the clockworkmod recovery image. Here is a wiki to answer some of your questions about it. ClockworkMod installation procedure:

  1. Download to your sd-card the cwm-6.0.2.7-itachiSan-ext4only.zip (clockworkmod 6.0.2.7) as your recovery rom image.
  2. Reboot into recovery mode, hold down the Home/OK (middle) button and press the Power button.
  3. In recovery mode, use the Volume buttons for navigation and the Home/OK button for selecting.
  4. Select “Update from SD card” from the recovery menu and drill down to cwm-6.0.2.7-itachiSan-ext4only.zip and press OK
  5. Reboot again into recovery mode and you should now have the new CWM recovery screen.
  6. Please wipe date/factory reset.
  7. Once finished head down to advanced and then to partition sdcard. Select 4096M (or smaller if your SD card is not big enough) for your new ext4 partition and hit OK, then select your swap partition size of 256M (or 0 if you do not wish to use swap on SD card) and press OK to create your new partitions.
  8. You are now ready to install CyanogenMod 10.1!

Once CWM is installed and you've created your new partitions, we should be ready to install CyanogenMod. The new partitions are purely optional, but I use them to help offset the Gio's memory is really small. You should have 3 partitions on your SD card, 1 that you can use to store applications on in ext4, 1 for swap and the last one is your normal fat32 partition. CM10.1 doesn't automatically make use of this, but I installed a separate application that makes the proper symlinks. It is advisable to install this application right after CM10.1 is installed. If you wish to read more about this particular blend of CynanogenMod, please follow the forums here: http://forum.xda-developers.com/showthread.php?t=1804646

Installation of CyanogenMod 10.1 for Samsung Gio

  1. Download last known good build:cm-10.1.0-RC6-GT-S5660-gio.zip which has been thoroughly tested and widely installed. or Download last known stable build:cm-10.1.6-GT-S5660-gio.zip is the latest build in the stable series. It is also reliable.
  2. Copy the file to your SD card
  3. Reboot into Recovery Mode (CWM)
  4. Select install zip from sd card
  5. Select "cm-10.1.*-GT-S5660-gio.zip" ROM
  6. Select Yes - Install update
  7. Wait till the Installation is finish
  8. Select 'wipe data/factory reset'
  9. Select 'reboot mobile' and enjoy

After you have settled into your new Android version, head over to XDA and download a modified version of S2E. Install S2E from clockworkmod, reboot and configure it to your liking. I check everything but Application data for performance reasons. Once you have it configured how you like it, make sure that the status is enabled and you need to restart your mobile for settings to take effect.

The next thing you should look into is getting the "Developers Options" screen to appear in settings. By pressing the "Build number" in the about section 7 times, you'll get access to an important part of the phone. I go to the CPU functions and set the min to the lowest the CPU will go and highest to a 825Mhz with the Smartassh3 governor. This creates a very smooth experience and an extra bit of raw power on top when necessary.

Some addition tips to help manage your battery: turn off any services you don't need, don't use too many widgets, the widgets you do use should not interrupt deep sleep, keep brightness to medium.

Enjoy your "new" mobile! :)

Update (20130625): Since Olddroid's project is abandoned, I've switched to using Erika's build he is a member of the androidarmv6 team.

Update (20131104): I've been running latest release from androidarm6 team for about a month now, and it has been very stable. I've not had one single unexpected restart. Cheers! cm-10.1.6-GT-S5660-gio.zip

Note: Should you ever run into a situation where your mobile is unresponsive and possibly 'bricked', then you should have a look at this thread about "one click unbricking" to try to get your mobile back in working order.

This is part 3 of a 3 part series about the Galaxy Gio. Part1: Upgrade Samsung Galaxy Gio from 2.2.x Froyo to 2.3.x Gingerbread Part2: Upgrade Samsung Galaxy Gio to CyanogenMod 7.2 Part3: Upgrade Samsung Galaxy Gio to CyanogenMod 10.1

Here are screenshots of what to expect:

Screenshot_2013-05-06-13-29-04

Screenshot_2013-05-06-13-29-16

Screenshot_2013-05-06-13-29-37

Screenshot_2013-05-06-13-29-57

Screenshot_2013-05-06-13-30-02

Screenshot_2013-05-06-13-30-37

Screenshot_2013-05-06-13-31-17

Screenshot_2013-05-06-13-31-50

Screenshot_2013-05-06-13-31-56

Upgrade Samsung Galaxy Gio to CyanogenMod 7.2

Android

Going from 2.3.x (Gingerbread) to CyanogenMod 7.2 (Gingerbread) is surprisingly simple unlike upgrading from Froyo. I'll go into more detail below, but there are two necessary bits: an updated recovery rom and a custom (non-official) CyanogenMod rom. This version of CyanogenMod is specific to the Samsung Gio.

Before upgrading your Samsung Gio, you must first be running at least 2.3.x (Gingerbread) before continuing because of the use of ext4 instead of rfs. Please follow my upgrade guide "Upgrade Samsung Galaxy Gio from 2.2.x Froyo to 2.3.x Gingerbread" first.

Warning: Caveat emptor - While I used to this process to update my phone, I take no responsibility if you brick your phone. Be sure to back up anything you wish to save, this procedure works best when your Gio is fully wiped of data.

Installation of the ClockworkMod (CWM)

  1. Download the custom CWM "px-cwm-v2.zip" and copy it to your sdcard.
  2. Reboot into the default recovery in your stock Gingerbread or with your Gio turned off, hold down the Home/OK (middle) button and press the Power button.
  3. In recovery mode, use the Volume buttons for navigation and the Home/OK button for selecting.
  4. Select “Update from SD card” from the recovery menu.
  5. Look for "px-cwm-v2.zip" which should be on your sdcard and press OK to flash.
  6. Reboot again like above into recovery mode and you should now have the new CWM recovery screen.

You can read more about CWM here.

Here is a video that shows the process: http://www.youtube.com/watch?feature=player_embedded&v=hxjxB8P9rSU

Installation of CyanogenMod 7.2 for Samsung Gio

  1. Download update-cm-7.2.0-20120710-NIGHTLY-gio-AROMA.zip from either here or here.
  2. Copy to sdcard
  3. Reboot to Recovery Mode (CWM)
  4. Select install zip from sd card
  5. Select "update-cm-7.2.0-20120710-NIGHTLY-gio-AROMA.zip" ROM
  6. Select Yes - Install update
  7. Wait till the Installation is finish
  8. Select wipe data/factory reset
  9. Select reboot mobile and enjoy

Cyanogen Mod 7.2.0 For Galaxy Gio based on Gingerbread (2.3.7) Working:

  • RIL
  • proximity sensor
  • touchscreen with multi touch
  • keychar
  • storage mode
  • gps
  • compass
  • accelerometer sensor
  • microphone (both phone & headset)
  • headset button
  • Root & Busybox
  • call,sms,mms
  • auto rotate
  • packet data with automatically apn detect
  • GPRS, EDGE, 3G, HSDPA
  • wifi
  • hardware video acceleration
  • secret code
  • bluetooth
  • camera
  • static wifi mac address
  • audio & FM Radio
  • wired & hotspot tether
  • Backlight Notification

Not Working:

  • Sim Toolkit (maybe)

Known issues:

  • some option are not working on setting (like: mute camera sound, etc)
  • slow loading png image on gallery
  • after use camera, governor force back to "ondemand"

Sources:

All thanks should go to CyanogenMod team, phiexz and all those that have put effort into ever aspect of this ROM.

This is part 2 of a 3 part series about the Galaxy Gio. Part1: Upgrade Samsung Galaxy Gio from 2.2.x Froyo to 2.3.x Gingerbread Part2: Upgrade Samsung Galaxy Gio to CyanogenMod 7.2 Part3: Upgrade Samsung Galaxy Gio to CyanogenMod 10.1

Upgrade Samsung Galaxy Gio from 2.2.x Froyo to 2.3.x Gingerbread

Android

Going from 2.2.x (Froyo) to 2.3.x (Gingerbread) is an involved process as there is always the fear that you will 'brick' your phone. This fear usually keeps most people away from upgrading. I've found a process, with Google's help and trial/error, that managed to get process done painlessly and without a dead mobile.

Here is a little back story: I was lucky enough to come across the Galaxy Gio in a bad state while at work. The mobile would turn on, give the Samsung logo then black-screen and would not boot any further. It wouldn't have made a good paperweight but if I could salvage it, it was mine.

Note: This process is a requirement before upgrading to a Cyanogenmod release.

What you need

You will need to download the Odin installer with the 'pit and ops' file which is specific to the Galaxy Gio. This process requires Windows and I have yet to find a process that will work under Linux. When browsing above for a 'Gingerbread Rom' be sure to pick one for your country or region. The latest revision as of this writing is: 2.3.6

The upgrade process

  1. If you have not already, you will need to install Samsung's USB Driver.
  2. Power off your Gio and remove your SIM and SD cards.
  3. Unzip/extract your rom, the result should be a 250MiB MD5 file. As an example: S5660XXKTL_S5660XXKT7_S5660XENLT1_HOME.tar.md5
  4. Unzip/extract odin.zip somewhere and run the ODIN executable.
  5. Select OPS file that you just extracted from odin.zip. Select 'One Package' under Option and then a few options will be greyed out. Keep 'Protect OPS' and 'Auto Reboot' checked. Select your 'One Package' at the bottom to be the 250MiB tar.md5 file.

Click to Enlarge

  • Set your Gio to 'Download Mode' by pressing 'Volume Down + OK + Power' at the same time.

Click to Enlarge

  • Connect the phone to the PC with your USB cable. Your COM port mapping will turn yellow when the device is properly detected and connected.
  • Press 'Start' and do not turn off your mobile!
  • Wait about 5 minutes ( could take longer ), when finished the 'PASS' will show up on the left when the upgrade was successful. Your Gio will reboot automatically.

You should now have a Gio with Gingerbread. You'll need this you wish to try the latest Cyanogenmod releases.

This is part 1 of a 3 part series about the Galaxy Gio. Part1: Upgrade Samsung Galaxy Gio from 2.2.x Froyo to 2.3.x Gingerbread Part2: Upgrade Samsung Galaxy Gio to CyanogenMod 7.2 Part3: Upgrade Samsung Galaxy Gio to CyanogenMod 10.1