這個突出來還真的討厭。
ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
2015年11月16日 星期一
2015年10月5日 星期一
ipv6 test
ipv6 有 128 bit.(16x8)
address 的寫法改用 :
然後用 16 進制。
例如:fe80::204:9fff:fe03:5011
因為 byte 太多,所以其中有可能有很多 word是0。
為方便起見,連續的0 就用 :: 來取代。
但是為了避免混淆,只能取代一次。
kernel 有 support ipv6 的話,/proc/net/ 下,會有.. if_inet6 這個 file
然後就可以用 ip 這個 command 操作..
顯示目前 ipv6 的 address:
看 ipv6 的 routing..
雙方都設好routing.. 就可以用 ping 了,ipv6 的 ping 叫 ping6
有時候,ping6 會出現 "connect: Invalid argument
..要加上 " -I eth0 "
還有... lollipop 的 ping6 好像有問題(還是 argument 不一樣?), 所以用 busybox ping6 比較 OK..
address 的寫法改用 :
然後用 16 進制。
例如:fe80::204:9fff:fe03:5011
因為 byte 太多,所以其中有可能有很多 word是0。
為方便起見,連續的0 就用 :: 來取代。
但是為了避免混淆,只能取代一次。
kernel 有 support ipv6 的話,/proc/net/ 下,會有.. if_inet6 這個 file
然後就可以用 ip 這個 command 操作..
顯示目前 ipv6 的 address:
ip -6 addr show
1|root@sabreauto_6q:/ # ip -6 addr show 1: lo:mtu 65536 inet6 ::1/128 scope host valid_lft forever preferred_lft forever 3: eth0: mtu 1500 qlen 1000 inet6 fe80::204:9fff:fe03:5123/64 scope link valid_lft forever preferred_lft forever
看 ipv6 的 routing..
ip -6 route show
root@sabreauto_6q:/ # ip -6 route show fe80::/64 dev eth0 metric 1024這是說, fe80::/64 的 subnet,都從 eth0進出
雙方都設好routing.. 就可以用 ping 了,ipv6 的 ping 叫 ping6
有時候,ping6 會出現 "connect: Invalid argument
..要加上 " -I eth0 "
還有... lollipop 的 ping6 好像有問題(還是 argument 不一樣?), 所以用 busybox ping6 比較 OK..
1|root@sabreauto_6q:/ # busybox ping6 -I eth0 fe80::ba27:ebff:feff:b123 PING fe80::ba27:ebff:feff:b123 (fe80::ba27:ebff:feff:b123): 56 data bytes 64 bytes from fe80::ba27:ebff:feff:b123: seq=0 ttl=64 time=2.527 ms 64 bytes from fe80::ba27:ebff:feff:b123: seq=1 ttl=64 time=0.719 ms 64 bytes from fe80::ba27:ebff:feff:b123: seq=2 ttl=64 time=0.777 ms ^C --- fe80::ba27:ebff:feff:b123 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.719/1.341/2.527 ms
Nexus 9
解析度不錯 , 當電子書ok 了。
看美漫也不會太小不清楚。
缺點是後面凸出來的鏡頭。要擺在桌上很麻煩 ,怕被磨到。
充電好慢。電池好像也不夠。應該沒辦法連續播放8小時。
拍照就標準 htc 那樣,軟體感,加上 google原生的對焦慢。
重量還好,但是加上附送的 磁性 cover 就太重了。
聲音應該算不錯吧,很大聲,以平板來說。
玩一下 game, 右上背面就會有點熱熱的。
更新到 6.0 以後,Launcher 常常會 freeze 住。
配合google books 來看電子書很 OK, 即使 pdf 也不錯,
新的 google books 好像會自動把文字區域放大對其中央,
配上這麼高的解析度,看起來很 OK
影片..當然是沒話說,可席看電子書 OK 的 4:3 在看電影就會多兩條黑線。
一堆撥放器的字幕黨都不 OK, 最後還是 MX player 正常波放。
hardware decode 也 OK
看影片的時候,果然,機器不會熱,耗電也號不多。
--------------
用了一個月,升級到6.0,機器常常自動重開,然後在這個畫面卡很久
2015年9月22日 星期二
古老的...
如果不對 structure 內 field 操作。
就不需要知道 structure 的內部宣告。
所以像 tinyalsa 中 struct control
雖然 control_open 的傳回值是 struct control*
但是alsa stub 只會把 得到的 control struct*交給 tinyalsa 的 function 來操作。
所以 alsa stub 只需要宣告:
count_p 的 p 是 playback
coubt_c 是 capture
count 是數量,也就是 play, capture 的數量。
如果不對 structure 內 field 操作。
就不需要知道 structure 的內部宣告。
所以像 tinyalsa 中 struct control
雖然 control_open 的傳回值是 struct control*
但是alsa stub 只會把 得到的 control struct*交給 tinyalsa 的 function 來操作。
所以 alsa stub 只需要宣告:
struct control;就可以。
struct control {
int fd;
struct snd_ctl_card_info *card_info;
struct ctl_pcm_info *pcm_info_p;
unsigned int count_p;
struct ctl_pcm_info *pcm_info_c;
unsigned int count_c;
};
count_p 的 p 是 playback
coubt_c 是 capture
count 是數量,也就是 play, capture 的數量。
2015年9月18日 星期五
NuPlayer.cpp 的
這個 kWhatStart 是由:
這邊的 caller:
void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
..
..
case kWhatStart:
{
..
..
mOffloadAudio =
canOffloadStream(audioMeta, (videoFormat != NULL),
true /* is_streaming */, streamType);
if (mOffloadAudio) {
flags |= Renderer::FLAG_OFFLOAD_AUDIO;
}
這個 kWhatStart 是由:
void NuPlayer::start() {
(new AMessage(kWhatStart, id()))->post();
}
送出。這邊的 caller:
android::NuPlayerDriver::start() android::MediaPlayerService::decode(..) ..Binder..mediaserver
typedef int snd_pcm_hw_param_t;
#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
* interrupts in us
*/
#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
* interrupts
*/
#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
* interrupts
*/
#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
* buffer
*/
#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
* in us
*/
#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
把有範圍的歸在一起,再用:
#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME然後就可以用這個function :
static inline int param_is_interval(int p)
{
return (p >= SNDRV_PCM_HW_PARAM_FIRST_INTERVAL) &&
(p <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL);
}
決定該參數是有範圍的 (upper, lower) 還是就一個值。然後 structure:
struct snd_pcm_hw_params {
unsigned int flags;
struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
struct snd_mask mres[5]; /* reserved masks */
struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
struct snd_interval ires[9]; /* reserved intervals */
unsigned int rmask; /* W: requested masks */
unsigned int cmask; /* R: changed masks */
unsigned int info; /* R: Info flags for returned setup */
unsigned int msbits; /* R: used most significant bits */
unsigned int rate_num; /* R: rate numerator */
unsigned int rate_den; /* R: rate denominator */
snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
unsigned char reserved[64]; /* reserved for future */
};
也可以直接用 array ..---- 所以適當安排 IOCTL code 還是有幫助的
標籤
- 3g (19)
- 工作的備worklog (93)
- 自言自語 (36)
- 草稿 (1)
- 亂亂寫 (8)
- 翻譯 (3)
- administration (76)
- alsa (7)
- android (299)
- apple (5)
- application (42)
- archlinux (1)
- audio (3)
- avr (6)
- backup_restore (2)
- bluetooth (5)
- bookmark (38)
- bootloader (21)
- browser (5)
- cellphone (28)
- command (8)
- Configuration (27)
- debug (7)
- django (1)
- driver (15)
- earphone (1)
- editor (1)
- EFL (1)
- ffmpeg (18)
- Filesystem (4)
- GCC (8)
- Gentoo (1)
- google (1)
- Graphic (3)
- hardware (40)
- hero (7)
- hibernation (9)
- iMX51 (38)
- Info (3)
- Install (30)
- java (4)
- Kernel (102)
- language (2)
- life (2)
- make (11)
- MantainLog (38)
- MCU_P (9)
- memo (8)
- microcontroller (3)
- MINGW (7)
- network (19)
- OpenCL (1)
- OS (11)
- package (3)
- pad (1)
- ProblemAndSolve (15)
- programming (8)
- Python (7)
- raspberry_pi (23)
- SDL (2)
- sensation (13)
- setup (3)
- software_package (36)
- SQL (1)
- suspend (2)
- ToDo (5)
- tool (3)
- ubuntu (1)
- VersionControl (45)
- Virtualization (15)
- VLC (5)
- wheezy (1)
- wifi (3)
- Windows (16)
- xiaomi (1)
- xperia (1)






