我写故我在

I write, therefore I am

Archive for the ‘随笔’ Category

GSoC 2011 is over

Posted by ieipi 于 八月 31, 2011

Google has announced the final evaluation result and the integration work is underway—my GSoC2011 journey with Jitsi has approached to its final period. Now it’s the right time to reminisce about this unique experience.

I can’t forget the moment when I received the email from Google saying that I had been accepted by Jitsi as a GSoC2011 student. The official announcement time is 19:00 UTC April 25, which is 03:00 here in Beijing. I spent all night waiting for the final moment with butterflies in my stomach. When the announcement came, I was even too excited to fall asleep.

After immersed in the excitement for a week, coding period started.

The project is to implement support for wideband codecs, to be specific, SILK, in Jitsi. So why wideband codecs? Thanks to the advancement of Internet access technology, the available bandwidth has increased a lot, and the major concern of VoIP developers has shifted from using less bandwidth to supporting better quality. Imagine the quality of music rather than speech, that’s cool. And then why SILK? Well, to be honest, Skype has done pretty well in the VoIP industry, and they share their main audio codec, SILK, to the open source community. And we are eager to have it in Jitsi.

The main work is to import SILK from C to Java. Sounds very straightforward, right? It may be easy to start, but you may suffer to make it work well. We’ve decided to translate the C code from scratch rather than using JNI technique. There are some important notes to be taken care of in the translation process.1). Pointers. The C programs use pointers intensively. However, there is no pointer in Java. So you should be careful when encounter pointers. Generally speaking, when the pointer is of complex type, e.g. struct, you can use an object reference in Java to translate it. However, when the pointer points an array, you should use an array reference and a data offset in addition. 2). Callbacks. C supports function pointers, which make callbacks flexible and powerful. Again, no pointers in Java, so you should design carefully based on the interface technique to support callbacks.3). Unsigned data types. There is no unsigned data type in Java, so you should be careful when unsigned data is involved in the operation.4). Shift operations. Java has separated operators for logic shift and arithmetic shift operation. 5). Endianness. Java is big endian, and usually the input data is in the format of little-endian. 6).Float point arithmetic. Subtle problems will arise when float point operation is involved.

The coding work was finished nearly in the mid-term, and then came the test. I should say that test really takes time. The test and debugging can easily take more time than you expect. So I think you should always remember to assign more time than you predict for debugging and test. In the first phase, it was not difficult to clear the bugs and made the program run. Though it gave no error messages, the result was not correct. For example, when I played the music which was encoded/decoded by the codec, the last part of the audio was not clear at all. At first, I tried to find the bugs from top down—debug step by step, and compare the intermediate result with that of the C version. But I found it was really difficult to determine whether they match or not when float point arithmetic operation was involved. Since the float point operation result is not exactly the same in Java as in C, when the intermediate result doesn’t match, it’s difficult to judge whether it’s because of a bug or just because of the float point operation itself. After discussion with my mentor Lyubomir, I decided to use another approach—a down-top approach. Get the intermediate result from C, and hard-coded it into Java to test whether there are bugs in the following parts. By this approach, I finally located the bug. It resides in the re-sampler part, and this explains why only part of encoded/decoded audio is incorrect.

Finally, how to test a codec? I think there are basically two methods. The first is to write a script to compare the result with a reference signal to see whether they match with each other. And the second is by hearing. Let the user test it. You play the audio result which is processed by the encoder and decoder and compare with the original sample audio. If it’s clear enough, I think you can say the codec works correctly.

The 3 months passed quickly, but the memory will last. Thank Google, thank Jitsi, and especially thank my mentor Lyubomir. I hope I can continue to work with the community in the future.

Posted in 随笔 | Tagged: | Leave a Comment »

i9000 入手记

Posted by ieipi 于 五月 14, 2011

早就想换个手机了,酝酿了好久却没有实际行动。上次出去玩时,手机弄丢了,这下省事了,不用细想,赶紧买吧。

  1. 智能机or非智能机

这个没什么好纠结的,当然是智能机了。移动互联,应用商店,移动平台。。。天天听这些,作为一个准ITer,是该体验一下了。

  1. Android or iOS

智能机的关键可能就是系统了。苹果是智能机的鼻祖,谁不想要呢。爱美之心,人皆有之。虽不能至,心向往之。但是ip5迟迟不出,ip4价格依旧坚挺。所以摸着钱包想一想,如果买个苹果回来只是发发短信装装B太丢人。所以就选Android。有Google做保障,还开源,适合折腾。

  1. 水货or行货

之前对智能机一窍不通。现在一搜,发现各种乱象。简直比买电脑还折腾。简析如下:

国行:内地行货。各种手续齐全,全国联保。

港行:香港行货。某些机型据说可以在内地全国联保。

水货:未经海关扣税,由非正规途径流入内地。水货并不指质量水。相反某些水货由于原销地是欧洲,质量比内地行货还好(欧洲的电子产品辐射要求是最严格的)。水货最大的问题在于售后质保。由于不是正规授权经销商售出,不能享受联保。这给广大奸商提供了可乘之机。水货按原销地又分为港水、欧水、亚太等等。

其他:

刷机:更新系统

ROOT:某些功能需要系统的Root权限。

解锁:厂商与运营商合作,使得某种机型只能在某运营商网内实用。为了入其他运营商网络需要解锁。

  1. MotoHTCor Samsung

Android救活了某些厂商,如Moto;捧红了某些厂商如HTC

市场上的Android机型十分泛滥。经过一番筛选,最后集中在这三家。

MotoDefy火了很久,好像去年就经常听到,号称性价比之王,又有三防做卖点。三防是神马以前没听说过。看了一些介绍好像很诱人,水下视频、通话看起来很新鲜。但是这个到底有多实用不知道。最开始一直关注它。但是行货一直在2700~3000。为了五一促销,京东甚至玩起了升五百降两百的鬼把戏。我表示再这样下去我玩不起了,于是转投其他机型。

HTCAndroid大户。但了解不多,印象不太好。而且机型泛滥,配置唬人怎么看都有点山寨的感觉。而且电池也不给力。可能是我偏见吧,没有过多了解。

Samsung人称花瓶。但是手机花瓶一点也不是坏事。看着舒服,第一印象很重要。

  1. 淘宝or

买水货最大的问题是渠道.中关村水太深,不靠谱.想来想去只有在淘宝了.逛淘宝一点也不必逛街轻松. JS 们坑蒙拐骗的招数层出不穷.网友们验机的方法倒也很多,但是道高一尺,魔高一丈,任何一个方法时间久了也都有规避的办法.所以还是得拼一下人品.

  1. 购机验机

在淘宝上逛了一多天后终于在1号下午下单.顺风果然很快,第二天早上就到北京了.下午机器到手.

开始验机.外包装已经拆封过.这个没办法,水货嘛,要避关,要刷机拆封是必需的.有些店宣扬全新未开封原装机实在是有点坑爹.首先检查外观.,前前后后仔细检查,找不到使用痕迹;贴膜也还正常,除了边缘不太紧致外,未有气泡.,据说新机有特殊气味,使用十数天后才会消散.不过实在不知道什么才算是特殊气味.,拆开后盖,检查插槽是否有使用痕迹.确保外观没有异样后开机检查.检查各种系统记录,比如开机时间,通话记录;检查串号IMEI.与机身串号一致,但是在网上查没有正确结果;检查生产日期,查得20113月生产,奇怪的是根据机身SN 码日期为20112,竟然不一致?开机检测,屏幕测试,检查有无亮点,结果正常.最后检查配件.都说配件很容易做手脚,确实很难查.两块电池,都是产自中国,一块3月分,一块1月份,仔细检查了一会儿,没有发现使用痕迹.至于其他配件比如耳机,充电器就更难判断了.

总之,对于验机,感觉还是靠观察使用.所谓工程模式的各种测试指令,其有效性值得怀疑.系统已经刷过,很多信息已经更新.仅凭几个指令应该是难不倒JS.好在支付宝有10天的窗口期,在这个时间内努力的挑毛病.如果使用没问题,验机也就没多大意义了.

最后感叹一下淘宝商户的进货渠道,每天几十台的销量都能支撑,他们是怎么采购怎么入关的呢?

尤其要感叹一下国内的苛捐杂税,内地行货普遍要比水货贵上前元.虽然部分是由于各级代理,但内地消费税偏高也是不争的事实.各种成本税赋最终都转嫁到了消费者头上.刺激居民消费已经喊了很多年,也必将再喊更多年.如今这年头,老百姓真正能做主的恐怕也只有口袋里这点零花钱了,要想他们掏出来消费,不来点实际行动,光喊口号是没用的.

Posted in 随笔 | Tagged: | Leave a Comment »

感谢郭佳 GSoC中了

Posted by ieipi 于 五月 10, 2011

gsoc结果公布已经快两周了,还是写点什么吧。

大概是在今年刚开学的时候就看到了来自Google的新闻,似乎今年Google在二月份就启动gsoc项目了。当时没怎么在意,主要是幻想今年能出去找找实习。后来逐渐认识到了现实的残酷,身不由己。。。。。。

既然不能出去实习,gsoc似乎是最好的选择了。无奈去年失利的阴影还在,万一这回又挂了咋办,上次失败的日志还在那儿尸骨未寒,总不能这回又写个失败总结吧?

318日,周五,Google公布了所有入选的开源组织。周末晚上回去浏览了一下,发现去年的那个组织还在,本着试一试又不犯法的精神,我发出了第一封邮件。忐忑间,mentor已经有了回复,很热情的回复。这下我的热情也上来了,于是接下来数天,邮件往来,不亦乐乎。

下一周就是提交proposal了。在这里,很有必要喷一下GFW。狗日的GFW,连gsoc的官网都被墙了。宁可错杀一千,也不放过一个。头几天,用了个GApp代理能上。刚好在临提交时却发现这个代理不行了,难不成让我为了这事去买个VPN?鼓捣了一个晚上,尝试各种翻墙术,总算可以上了。但是有GFW在,心里总归不踏实。

屋漏偏逢连阴雨,这时老板突然心血来潮,让写一篇paper投稿。只差一个月就截稿了。我委婉的表示无米之炊难为,但是老板坚持说只是一个小paper,可以投。可是再小的paper它也是paper啊,麻雀虽小,五脏俱全啊。我也知道双线作战乃兵家大忌,两手抓,往往两手都硬不起来。但是没办法,我还得先应承下来。

为了赶时间,早早提交proposal后就开始等回应了。心想着先抢得先机,再根据mentor的意见慢慢完善。但是邮箱却开始沉寂下来了。这时清明假期来了。出去玩了几天。这期间,gsoc官网不能上了,也不知道进展如何。也亲身体验了一把Gmail抽风的问题,邮箱经常连不上。话说它们真的会对Gmail全面动手吗?God bless gmail

放假回来后就发现邮箱有动静了。原来就在假期中,组织的大头目给我comment了。怎么就没有邮件通知呢?我连忙去仔细看了一下他的留言。大事不妙!他对我之前的有些问题不太满意,feel uncomfortable,似乎觉得我说了大话,骗了他们。他只是uncomfortable,我却是非常的terrible,赶紧想办法补救。马上就回了留言。然后就开始coding,这时候恐怕只有source code才能证明我的清白。没等他们回复我的留言,我就把我的代码给附了上去,又balabala说了一大推。然后就静候佳音。一连几天过去了,仍然没有消息,我开始坐不住了。只有直接联系我的mentor,探探口风。Mentor实在是个好人,他让我不要多想,专注于项目本身。我总算稍微能宽宽心。

就这样,在忐忑中,48日,application deadline到了。接下来就是更为煎熬的evaluation period

我这边却还是没什么动静,也没收到有什么test。在channelmailing list里面问了,得到的回复是他们很忙,正在evaluate我们的proposal。也不知道他们是怎么evaluate的。不能干等,于是我就不断的自己找问题主动联系mentor。这个周末,16号,戴同学和占同学来北京玩,于是乎我又放了几天假。玩的很happy。回来之后,还是没谱。眼看着两个deadline都要到了,心里万分捉急。终于忍不住在周三的时候,又找了一下mentor。这个时候,他们的人选应该也定的差不多了。在我一再焦虑的逼问下,他总算给了一些积极的回应。先是说我的proposal在他看来acceptable,接着说我提交的code看起来promising。我承认我看到这两个词时很是心花怒放了一会。但是老外有时太gentlemen了,习惯说赞语。我还是不敢太当真。接下来他竟然跟我聊起了中西方文化差异,这当然是我感兴趣的话题。无奈英文不给力,连first namelast name都差点搞错了,伤不起啊。但是心里一阵窃喜,他既然跟我聊这些,莫非有戏了。又不敢直接问他我中没中,显得中国人不守规则,好打听。之前就发生了一件小插曲。还是在申请阶段的时候,有个阿三在channel里面不无得意的说因为中国政府和Google之间的紧张关系,Google禁止中国学生参加,所以印度成为除美国本土以外申请人数最多的国家。搞得我很紧张,连忙去问。结果引来一帮人对文凭含金量的议论。说什么虽然Google只接受大学生和研究生申请,但是各个学校的文凭含金量不一样。还建议Google今后是不是也得对学校进行一些资格审查。难不成我们国家文凭泛滥已经名声在外了?莫非又成功输出价值观了。

第二天,周四。这回mentor主动找我聊了。他上来就整一句how are you?我差点条件反射般跟一句fine, thank you, and you?想起了网上那些段子,觉得不可。可是他来这么一句到底是一种什么样的思想感情?初中英语瞎学了。是让我汇报工作吗?于是我就老老实实的说最近在憋论文,他很nice地祝我成功。然后他就问我什么时候可以开始工作,我当然说随时可以。到了最后,他就开始嘱咐我了,说他从周五到周一要回去度假,有什么事该找哪些人等等。这下我终于可以心花怒放了。看来至少在他那里是没什么大问题了,而且既然他周末可以去度假,那我是不是也可以放松放松。。。

然后我就等着过个愉快的周末,去了趟798,然后就把手机弄丢了。然后就买了个android

原本以为是周日晚上出结果,做好了准备熬通宵。结果发现我把时间搞错了,是UTC时间42519:00,相当于北京时间周二凌晨三点。

于是周一整天心神不宁。到了晚上,不得不靠看电影消磨时间。大概凌晨一点时,电影也看不下去了,电视剧也不行。还有两个小时,可怎么熬?于是开始dota,打了一半发现竟然连dota都难以让我集中精力。接下来的时间就变成了垃圾时间,不断的刷屏。

大概差三分钟三点时,Google发来贺电,Congratulations, 你的申请已通过!赶紧上channel等着开会庆祝,却发现一点锣鼓喧天鞭炮齐鸣的喜庆气氛也没有,冷静的很。为啥大家都这么淡定呢。心里有点不踏实,又上官网去求证。上面明白无误的有我的名字和我的proposal。应该不会有错。于是进到我们组织的channel,感谢cctv,感谢mtv,瞎感谢一通,终于可以上床睡觉了。

Google官方规定的时间是从五月底开始,但是我之前给过他们承诺,所以现在就得提前开始,毕竟要为我们曾经吹过的NB负责啊。

开始coding吧。

Posted in 随笔 | Tagged: | Leave a Comment »

GSoC2011 announcement

Posted by ieipi 于 四月 26, 2011

At April 25, 19:00 UTC, the accepted student proposals have been announced.

It’s 3:00 am here in Beijing. I have to hold up late again. But this time it’s more difficult.I just can’t calm down and concentrate after 1:00 am. I tried watching movie, TV plays and even dota, but all failed.

At about 3 mininutes to the final time, I got an email from Google. Congratulations! your proposal has been accpeted as the GSoC 2011 project. Is that ture?! I went to the gsoc webpage, and searched my proposal. Yes, i made it!All work has paid.

Thanks Jitsi community! Thanks Lyubomir!

Posted in 随笔 | Tagged: | Leave a Comment »

GSoC application deadline

Posted by ieipi 于 四月 10, 2011

The GSoC2011 application deadline is 19:00 UTC, April 8, which is 3 am here in Beijing. I have hold on to the last minute, and submitted my final application.Hope i will get positive feedback from mentors.

Posted in 随笔 | Tagged: | Leave a Comment »