Apple gives U2’s new album free. How to download it step by step.

Apple gives U2’s new album “Songs of Innocence” to all iTunes users. (detailed info from http://www.apple.com/pr/library/2014/09/09Apple-U2-Release-Songs-of-Innocence-Exclusively-for-iTunes-Store-Customers.html)

Here we listed the steps to get it on your devices.

1. First, check if the album is yours now.
Search its name “Songs of Innocence” in iTunes or Music App.
photo 1
2
. If it shows Purchased, then check “More” -> “Music”. (After enter More, it should shows the title “Purchased”)
photo 2
3. Find the songs, it is under “Varicus”, hit it, then you can see the “Cloud” figure
photo 3
4. Hit the clould,  it shows “downloads”. and you can check in the “Download” tab.
photo 4photo 5

Congratulations! Enjoy your music!

Posted in Uncategorized | Leave a comment

CPUFreq Intro

The file is based on http://blog.csdn.net/droidphone/article/details/9346981 , from section 1 to 3.

CPUFreq系统把一些公共的逻辑和接口代码抽象出来,这些代码与平台无关,也与具体调频策略无关,内核的文档把它称为CPUFreq Core(/Documents/cpufreq/core.txt)。另外一部分,与实际的调频策略相关的部分被称作cpufreq_policy,cpufreq_policy又是由频率信息和具体的governor组成,governor才是具体策略的实现者,当然governor需要我们提供必要的频率信息,governor的实现最好能做到平台无关,与平台相关的代码用cpufreq_driver表述,它完成实际的频率调节工作。最后,如果其他内核模块需要在频率调节的过程中得到通知消息,则可以通过cpufreq notifiers来完成。

policy 该变量可以取以下两个值:CPUFREQ_POLICY_POWERSAVE和CPUFREQ_POLICY_PERFORMANCE,该变量只有当调频驱动支持setpolicy回调函数的时候有效,这时候由驱动根据policy变量的值来决定系统的工作频率或状态。如果调频驱动(cpufreq_driver)支持target回调,则频率由相应的governor来决定。
governor 和governor_data 指向该policy当前使用的cpufreq_governor结构和它的上下文数据。governor是实现该policy的关键所在,调频策略的逻辑由governor实现。

cpufreq_driver_target是带锁的版本,而__cpufreq_driver_target是不带锁的版本,如果确定是在governor的上下文中,使用不带锁的版本,否则需要使用带锁的版本。

cpu_dbs_common_info  该结构把对计算cpu负载需要使用到的一些辅助变量整合在一起,通常,每个cpu都需要一个cpu_dbs_common_info结构体,该结构体中的成员会在governor的生命周期期间进行传递,以用于统计当前cpu的负载
(dbs缩写,实际是:demand based switching)

Odroid XU  Android default Ondemand code: https://github.com/hardkernel/linux/blob/odroidxu-3.4.y/drivers/cpufreq/cpufreq_ondemand.c

HotPlug In case: (Freq > 1.6GHz boost level count is over BOOST_LV_CNT)
static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq){
……
if ((consecutive_boost_level > BOOST_LV_CNT) &&(freq > HOTPLUG_TRANS_H)) {
freq = HOTPLUG_TRANS_H;
hotplug_in = true;
}
……
if (!cpumask_empty(&out_cpus) && hotplug_in) {
mutex_lock(&hotplug_mutex);
hotplug_out = false;
__do_hotplug();
mutex_unlock(&hotplug_mutex);
}
}

Check CPU Freq logic is in:
/*
* Every sampling_rate, we check, if current idle time is less
* than 20% (default), then we try to increase frequency
* Every sampling_rate, we look for a the lowest
* frequency which can sustain the load while keeping idle time over
* 30%. If such a frequency exist, we try to decrease to this frequency.
*
* Any frequency increase takes it to the maximum frequency.
* Frequency reduction happens at minimum steps of
* 5% (default) of current frequency
*/
static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info){
…..
//Calulate each CPU load, find the maximum
load = 100 * (wall_time idle_time) / wall_time;
…..
load_freq = load * freq_avg;/* Get Absolute Load – in terms of freq */
if (load_freq > max_load_freq)
      max_load_freq = load_freq;

/* Hotplug out case : Frequency stay over maximum quad level */

/*
* If policy->cur >= 1.6Ghz(HOTPLUG_TRANS_H) and next transition is
* ascending check cpu_util value for each online cpu.
* If cpu_util is less than 10%(HOTPLUG_OUT_LOAD) for
3(HOTPLUG_OUT_CNT_H)
* times sampling rate(100ms), plugged out on this cpu.
*/

//Increase Freq

/*
* If current freq is under 600MHz, and load freq is bigger than
* up_threshold 60, increase freq by step level 600MHz.
*/
/*
* If current freq is same or over 600MHz, and load freq is bigger than
* up_threshold 95, increase freq as below conditions.
* Condition 1: current freq is under 1.2GHz, apply step level to 1.2GHz
* Condition 2: current freq is same or over 1.2GHz, increase to max freq.
*/

/*
* Hotplug Out:
* – Frequency stay at lowest level
*/

//Descrease Freq

/*
* If current freq is over 800MHz, and load freq is smaller than
* 92(by 95-3), decrease freq as below condition.
* Condition: next freq is under 800MHz decrease to 800MHz
*/
/*
* If current freq is same or under 800MHz, and load freq is smaller than
* 40(by 60-20), decrease freq.
*/

 

 

Posted in Uncategorized | Leave a comment

ODROID-XU+E

1. Attach eMMC, backup battery according to the second video listed on homepage: http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137463363079&tab_idx=1 Boot Loader code can be found on http://odroid.com/dokuwiki/doku.php?id=en:odroid-xu, there is switch for the boot load media.

2. Input the power, when insert the power cable, the red light is static and another light is green for some time then change to static blue about 10s. Finally, it becomes flash blue, the red light always static. (http://forum.odroid.com/viewtopic.php?f=78&t=4023)

3. For smartpower (http://odroid.com/dokuwiki/doku.php?id=en:odroidsmartpower), I think it cut the power supply cable to insert the monitor item, similar power monitoring device can also be connected in this way.

4. CPU information, the board is big.LITTLE processor, 4 core A15 and 4 core A7. Can check in /proc/cpuinfo and /dev/bL_status, http://forum.odroid.com/viewtopic.php?f=65&t=2580
The build-in sensor info can be found in the first video, http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137463363079&tab_idx=1, in developer options -> Monitoring -> CPU usage. Now it shows on screen, do not know how to log out the info.

5. Trobleshooting Guide: http://forum.odroid.com/viewtopic.php?f=51&t=936 , includes light and power supply info.

Posted in Uncategorized | Leave a comment

Platforms

1. ARM bigLittle board http://www.arm.com/products/processors/technologies/biglittleprocessing.php     The underlying big.LITTLE software automatically moves workloads to the appropriate CPU based on performance needs, in microseconds, so quickly that it is completely seamless to the user.

It works in tandem with Dynamic Voltage and Frequency Scaling (DVFS), clock gating, core power gating, retention modes, and thermal management to deliver a full set of power control for the SoC. big.LITTLE technology takes advantage of the fact that the usage pattern for smartphones and tablets is dynamic: Periods of high processing intensity tasks, alternate with typically longer periods of low processing intensity tasks. The graph shows the usage of the big CPU cores in burst mode, or for short duration at peak frequency, while the majority of runtime is managed by LITTLE cores at moderate operating frequencies. User space software on a big.LITTLE SoC is identical to the software that would run on a standard SMP processor. ARM has developed a kernel space patch set gives the Operating System awareness of the big and LITTLE cores, and the ability to schedule individual threads of execution on the appropriate processor based on dynamic run-time behavior.  The software also keeps track of load history for each thread that runs, and uses the history to anticipate the performance needs of a thread the next time it runs. This software is called Global Task Scheduling.
Hardware coherency with CoreLink CCI-400 is an important part of ARM big.LITTLE processing and allows a single operating system to run across two processor clusters simultaneously. With big.LITTLE Global Task Scheduling (GTS) processes and applications can move dyanmically between the high performance ‘big’ and the high efficiency ‘LITTLE’ cores as demand requires. This technolgy allows can allow up to 8 cores to run at the same time.

http://www.arndaleboard.org/wiki/index.php/Main_Page
http://www.pyrustek.com/us/?menuType=product&mode=view&act=list&page=&searchField=&searchKey=&lcate=001&mcate=001&scate=&fcate=&sort=&prodCode=2014052600002&searchIcon6=&searchIcon7=&searchIcon8=&searchIcon9=&searchColor=&searchSize=&pr_no=&searchStartPrice=&searchEndPrice=

Snapdragon 805 MDP Tablet
https://developer.qualcomm.com/mobile-development/development-devices/snapdragon-mobile-development-platform-mdp/snapdragon-805-mdp-tablet

PandaBoard
http://pandaboard.org/content/buy

Versatile Express Platform
http://www.arm.com/products/tools/development-boards/versatile-express/index.php

ODROID-XU+E
http://hardkernel.com/main/products/prdt_info.php?g_code=G137463363079&tab_idx=3

big.LITTLE uses Global Scheduling Task http://www.linaro.org/blog/hardware-update/big-little-software-update/

Some definitions: Memory Level Parallelism or MLP is a term in computer architecture referring to the ability to have pending multiple memory operations, in particular cachemisses or translation lookaside buffer misses, at the same time.http://en.wikipedia.org/wiki/Memory-level_parallelism
Instruction-level parallelism (ILP) is a measure of how many of the operations in a computer program can be performed simultaneously. The potential overlap among instructions is called instruction level parallelism.http://en.wikipedia.org/wiki/Instruction_level_parallelism
cycles per instruction (aka clock cycles per instructionclocks per instruction, or CPI) is one aspect of a processor’sperformance: the average number of clock cycles per instruction for a program or program fragment.[1] It is the multiplicative inverse of instructions per cycle.http://en.wikipedia.org/wiki/Cycles_per_instruction
Symmetric multiprocessing (SMP) involves a symmetric multiprocessor system hardware and software architecture where two or more identical processors connect to a single, shared main memory, have full access to all I/O devices, and are controlled by a single operating system instance that treats all processors equally, reserving none for special purposes.http://en.wikipedia.org/wiki/Symmetric_multiprocessing

Posted in Uncategorized | Leave a comment

Android App sharedUserId=”android.uid.system”

I want to get screen pixels information, while we can not get it directly from /dev/graphics/fb0 when we use nexus 4/galaxy s4 Android 4.3.  I googled it seems the file is abandoned, the screen is not render from that file, even I get root permission, I still can not read data, all returned value is 0.

So I want to know how the screenshot gets the photo. The analysis is read from http://my.eoe.cn/viver120/archive/5448.html.  The Surface.screenshot() is the key function. So I write the code according to http://blog.csdn.net/hk_256/article/details/7306590.

In the implement process, there are several problems that cost me some time to solve.

1. There is no Surface.screenshot(), in the latest android source code, the function is changed to SurfaceControl.screenshot(). If use the old, eclipse will tell there is no function. Actually, the first one in early android version is hidden api, the latter is hidden class. The hidden api and internal api used in eclipse: http://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/

2. If we run the app, it will give null results. That may caused by the hidden class. Although it goes through eclipse, it is not actually works. We need add system permission to the app.   a.) Add android:sharedUserId=”android.uid.system”  in manifest attribute AndroidManifest.xml.
To make sure it works. There are two ways as listed in http://hi.baidu.com/eastream/item/8b86140df304f0f5a1103448. I took first which works. The key is that it is ROM related, you need to compile your app in the same Android source code that compile your custom ROM.
b.) In Android.mk,add LOCAL_CERTIFICATE := platform
c.) Move your app folder to Android source code  /packages/apps/yourApp
d.) Run . build/envsetup.sh  then cd yourApp folder Run mm
e.) After compile, it shows the .apk path, then you can install it from adb
adb install -r testscreenshotactivity.apk  use -r if you reinstall the app, if not, just ignore -r.

If your ROM is not same with your android source code, the installation may not success, otherwise, it shows SUCCESS on your terminal.

Code: https://github.com/lyhz/AndroidScreenShot.git

Posted in Uncategorized | Leave a comment

Forget Windows7 password

For mac and windows two os devices, if the windows password is forget, we can setup another user account and give it administration power.

1. Install “Paragon NTFS for mac”, so that mac can modify ntfs files, which is used in windows os.

2. In mac, rename “cmd.exe” to “narrator.exe”, rename “narrator.exe” to “narrator1.exe”.

3. Restart the machine, hold “option” key, until the interface that you can choose different os .

4. Choose windows, click the left corner ‘Assistant’, check the first one which said (narrator). Then the cmd window shows, key in the following command: (‘Enter’ is the key on the keyboard)

net user admin 123 /add  ‘Enter’

net localgroup administrators admin /add  ‘Enter’

5. Restart the device, enter windows, now you can choose the new added account and enter the windows os.

6.(Optional) You can delete the old user in Control Panel, User and accounts.

7. In mac, change the Narrator1 back to Narrator, and Narrator back to cmd.

 

Posted in Uncategorized | Leave a comment

Change Android cpu freq

To change the cpu freq, first make sure the governor is “userspace”.

check it under the /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:

# echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

It also shows the available governor in ‘scaling_available_governors’
Then modify the ‘scaling_setspeed’

# echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

Verify:

run a cpu hungry app, monitor the cpuinfo_cur_freq and scaling_setspeed.

By test, it works on Nexus 4, while failed on Galaxy S4.

Posted in Uncategorized | Leave a comment