2015年4月30日 星期四

好表...XDDDD


http://elinux.org/Tegra/Downstream_SW/Linux4Tegra/WebBrowsers/Hardware_Accelerated_Video_Decoding

Motivation

  • Video Acceleration is disabled by default in Linux Builds of Chromium.[1]
  • Nvidia provides Gstreamer libraries for the Tegra K1 [2]
  • Chromium doesn't support Gstreamer backend for media [3]
  • Chromium supports VA-API and VDPAU libraries through the Hardware acceleration implementation called VAVDA. [4]
  • Nvidia doesn't provide VDPAU libraries for the Tegra K1.[5]
  • Notwithstanding all the above points, Acer 13 and HP 14 Chromebooks that shipped with the same SoC supported hardware accelerated video decoding.

Jetson TK1 檢查版本

head -1  /etc/nv_tegra_release

過渡性問題 Jetson TK1 R21.3 CUDA library loading

http://blog.csdn.net/kaka20080622/article/details/40706813

error while loading shared libraries: libcudart.so.6.5: cannot open shared object file: No such file

sudo cp /usr/local/cuda-6.5/lib64/libcudart.so.6.5 /usr/local/lib/libcudart.so.6.5 && sudo ldconfig
sudo cp /usr/local/cuda-6.5/lib64/libcublas.so.6.5 /usr/local/lib/libcublas.so.6.5 && sudo ldconfig
sudo cp /usr/local/cuda-6.5/lib64/libcurand.so.6.5 /usr/local/lib/libcurand.so.6.5 && sudo ldconfig

總之如果看起來是安裝後路徑不對,沒複製好,就copy過去吧

Jetson TK1 playback h.264 hardware decode

https://devtalk.nvidia.com/default/topic/780917/jetson-tk1-mp4-video-playback-quality-from-canon-camera-recorded-videos/?offset=3

Video only:
gst-launch-0.10 filesrc location="$1" ! qtdemux name=demux demux.video_00 ! queue ! nv_omx_h264dec ! nv_omx_hdmi_videosink



Video and Audio:
gst-launch filesrc location="$1" ! qtdemux name=demux demux.video_00 ! queue ! nv_omx_h264dec ! nv_omx_hdmi_videosink demux.audio_00 ! queue ! nv_omx_aacdec ! alsasink

2015年4月29日 星期三

NVIDIA Jetson TK1 Development Guide

一塊實驗版名叫Jetson,內含Tegra K1處理器,CUDA運算能力
有32-bit與64-bit版本之分,後者使用ARMv8架構晶片

原價屋買的到

簡易版NVIDIA L4T Quick Start
http://developer.download.nvidia.com/embedded/L4T/r21_Release_v3.0/l4t_quick_start_guide.txt

Jetson TK1 Development Kit Quick Start
http://developer.download.nvidia.com/embedded/jetson/TK1/docs/2_GetStart/Jeston_TK1_QuickStartGuide.pdf

以下為官方StartGuide章節筆記(2014年末版本)

開箱使用

插電,按Power鈕,看到綠色LED燈
登入用的帳號密碼:
Username: ubuntu
Password: ubuntu

安裝NVIDIA Linux driver binary

cd ${HOME}/NVIDIA-INSTALLER
sudo ./installer.sh
Reboot system

Re-Flash your Jetson

準備好可用的rootfs
Tegra_Linux_Sample-Root-Filesystem_Rxx.x.x_armhf.tbz2
下載新的L4T Drivers
Tegra124_Linux_Rxx.x.x_armhf.tbz2

解開後
cd Linux_for_Tegra/rootfs/
sudo tar xpf ../../[你的rootfs.tbz2]
cd ..
sudo ./apply_binaries.sh
最後看到Success!

進入Reset Recovery Mode
按住RECOVERY鈕不放,按一下RESET鈕

用USB線連接host主機跟Jetson

sudo ./flash.sh -S 8GiB ${target_board} mmcblk0p1
${target_board}, 尋找目錄下$(target_board}.conf, 官方檔案取名為 jetson-tk1

JetPack TK1 (Jetson TK1 Development Pack)
載點 https://developer.nvidia.com/jetson-tk1-development-pack-archive
http://docs.nvidia.com/jetpack-tk1/index.html#developertools/mobile/jetpack_install.htm
執行 XXX.run
照指示設定平台,並燒入Jetson

2015年4月24日 星期五

[盜轉文]Linux platform总线(1):总体框架

原文 http://blog.chinaunix.net/uid-7859076-id-2552433.html

轉文整理格式 http://blog.csdn.net/qq_695538007/article/details/38092099



  1. int platform_device_add_resources(struct platform_device *pdev,struct resource *res, unsigned int num)  
  2. {  
  3.        struct resource *r;  
  4.        r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);//为资源分配内存空间  
  5.        if (r) {  
  6.               memcpy(r, res, sizeof(struct resource) * num);  
  7.               pdev->resource = r;        //并拷贝参数res中的内容,链接到device并设置其num_resources  
  8.               pdev-> num_resources = num;  
  9.        }  
  10.        return r ? 0 : -ENOMEM;  
  11. }  

2015年4月22日 星期三

[mtg] 分層系統

http://archive.wizards.com/magic/magazine/article.aspx?x=judge/article/20091105a

7大層
Copy
Control
Text
Type
Color
Ability
Power/toughness

P裡面的五小層
CDA, set to specific value
not CDA, set to specific value
modify value, but it's not a specific value
whatever counters does
switch power and toughness

作用順序
不同層多個效應  從第一層開始先作用

當某一個效應效果是remove了先前某層的持續性異能時,該持續效果仍將持續生效,並不因異能消失而中斷

同層多個  最優先作用CDA, 剩餘的多個效應  依照timestamp  舊的先作用 次舊的次之 ; 但主從關係有可能插入作用,從效應會被保留直到主效應作用完

-- 多個CDA該如何排序? 不用考慮。CDA的定義下,多個CDA只會各自作用在該卡或衍生物自己身上,不會互相作用。

-- 從效應何時會被保留? 當按照timestamp排序會把主效應放在從效應後面時,從效應就會被保留。

CDA定義: 全名 Characteristic Defining Ability
a. 只會是定義該卡/該衍生物自己特徵的異能
b. 不會是觸發式/啟動式/滿足條件式的異能 (*滿足條件式異能的名稱並不在正式異能分類中,指的是"當xxxx時,就oooo"這種異能,包含但不僅限於觸發式異能)
c. 必須是定義著一項特徵。通常那會是顏色,類別,攻防。

主從效應定義:
(加油自己看)
主從效應判斷:
做一個假想,觀察A影響的個體數量: 作用順序A, B時,其數量是否跟順序B, A時其數量相同。若為真,則其為主效應,否則其為從效應。

[筆記] 2015-2016 環境輪替


2016.1-4:
[KTK, FRF,] DTK, ORI, BFZ, OGW


2016.4:
-[KTK,FRF], +[SOI}

2016.7:
+[EMN]

2016.10:
-[ORI, DTK], +[???]

2015年4月10日 星期五

字串處理 in javascript

http://www.javascripter.net/faq/trim.htm


Question: How do I trim leading and trailing spaces of a string?
Answer: To remove all leading and trailing spaces from a string "str", you can use this code:
str = str.replace(/^\s+|\s+$/g,'')
This code example uses the regular expression "/^\s+|\s+$/g " which matches one or more occurrences of whitespace ("\s") in the beginning and at the end of string. The "g"(global) flag in the regular expression specifies that a global search should be performed (e.g. even if a match is found in the beginning of the string, the matching process must still continue and attempt to find whitespaces at the end of the string, too). The"string.replace()" method is used to replace all leading and trailing whitespace characters with an empty string.