Archive for the ‘Development’ Category
git send-email tricks
I recently found out a few awesome tricks for git send-email that have made my life much easier, so I decided to share them here
First, git send-email is an essential tool in every git guru’s arsenal, as it’s the preferred way of submitting patches. All you need to do is generate your patches with git format-patch (preferably with a cover letter), and then use git send-email to send those patches inlined in a nicely formatted email thread with your MTA.
But do you know about the different threading formats, address-book queries, or the cc-cmd option? No? Well, let’s get started.
New project: gst-dsp, with beagleboard demo image
It took me a lot more than I expected, but I finally managed to get the beagleboard booting and happy with the latest linux kernel (2.6.32-rc3), DSS2, and dsp-bridge driver.
And then I could run gst-dsp: a native GStreamer plug-in to access Texas Instruments’ DSP algorithms for OMAP3 platforms. Which marks the time for making a public release.
Here’s the video ![]()
The video playback is running on the beagleboard with gst-dsp and gst-omapfb (no X) with TI public DSP binaries; it’s a WVGA (800×480) MPEG-4 video. It’s not running as smoothly as I wanted; it seems the public binaries are a bit buggy, and there’s some problem with the dsp-bridge driver writing directly to the framebuffer, but at least it somewhat works
The video recording is done with an N900, official system (which uses gst-dsp
), and the resulting video is ; 848×480 MPEG-4.
You can find the demo image for the beagleboard, along with instructions, here.
The kernel code is on gitorious; the important tag is v2.6.32-felipec1.
And gst-dsp is hosted on Google Code, although the git repository is actually on github.
The code wasn’t written from scratch, TI’s projects: tiopenmax and libbridge, helped a lot.
And of course many other people made the first release possible (see the shortlog at the end).
Enjoy
Andriy Shevchenko (1):
base: fix a crash on send codec data
Felipe Contreras (180):
Initial commit
Register dsp node
Add README
Fix and update copyrights
Add ALLOCATE_HEAP and ALLOCATE_SN to dsp_bridge
Add handy dsp_send_message
dummy: use dsp_send_message
Rename gstdsp.* to plugin.*
Makefile: cleanup
dummy: trivial clanups
Add log utility
Use log utility
dmm_buffer: size_t improvements
dmm_buffer: always unmap when freeing
dmm_buffer: use getpagesize()
dmm_buffer: alignment improvements
dmm_buffer: add user_data field
Add MPEG-4 video decoder
README: update
mp4vdec: trivial cleanup
mp4vdec: send signal to output_loop
mp4vdec: flush output buffers too
mp4vdec: reset output port
mp4vdec: extra check for null buffer
mp4vdec: use atomic operations for status
mp4vdec: use more atomic operations for status
mp4vdec: send stop signal before
mp4vdec: re-use comm buffers
dmm_buffer: reorganize a bit
dmm_buffer: add dmm_buffer_reserve
dmm_buffer: allow to re-reserve memory
dmm_buffer: allow re-mapping
mp4vdec: trivial cleanup
dmm_buffer: unmap before unreserving
mp4vdec: re-use mappings for output buffers
mp4vdec: convert flush condition to semaphore
Remove cond.h
Rename mp4vdec to vdec
vdec: trivial cleanup
vdec: trivial reorganization
vdec: prepare for multiple algos
vdec: move create_node to dsp_start
vdec: start dsp node after getting the caps
vdec: initial support for H.264
vdec: add Juha to authors list
README: update
vdec: cleanup
vdec: make dsp_thread static
vdec: reorganize a bit
New base class
Add new video encoder
base: handle more commands
base: reorganize got_message a bit
venc: improve jpeg args
venc: send jpeg dynamic params
base: cleanup setup_output_buffers
base: remove unused buffer_count
base: reorganize a bit
base: add use_pad_alloc option
base: free mapped buffers on dsp_stop()
base: be more verbose on get_slot()
README: update
Makefile: check for missing symbols
New utility gstdsp_register()
base: detect dsp errors
base: properly handle dsp errors
base: post error in the bus
base: extra check for status in outout_loop()
base: free events array
base: reinitialize state on NULL->READY
base: use circular buffer for timestamps
base: increase ts_array
base: increase mapping cache
dummy: reorganize map_buffer
dummy: input buffers don't need alignment
dummy: cleanup
dummy: don't map buffers
venc: increase framesize limit for jpeg
base: add gstdsp_post_error()
venc: allocate a buffer when framesize is unaligned
base: decrease wait for events timeout
base: more error messages
base: re-initialize on READY->PAUSED
base: don't panic on wrong status
base: destroy node at the right time
base: catch playback completed message
base: possible memleak fixes
vdec: send codec data for MPEG-4
base: make map cache optional
plugin: set more proper ranks
vdec: add framerate workaround
vdec: remove gstdsp_send_buffer()
base: add create_node() vmethod
base: add parsing facilities
Add h263 parser
parse: update framesize only when unset
Random cleanups
base: add support for stream params
venc: add H.263
venc: use h263 by default
Reorganize encoders
base: send codec data for all the codecs
base: keep trying if parse func fails
base: trivial cleanup
Trivial cleanups
log: don't display info level
log: decrease log level for buffer allocs
log: add pr_test
base: rename array to cache
base: rename 'buffer' to 'comm'
base: event cleanup
base: reorganize a bit
base: assume output buffer is always there
base: remove out_buffer, use port buffer
base: store input buffer
base: trivial cleanup
base: flush ports on stop
base: plug some possible leaks
base: make map_buffer() more conservative
base: trigger semaphore after buffer modifications
base: re-use input buffer
base: add port index field
Add async queue
base: allow multiple buffers
base: allow child elements to configure the ports
vdec: increase the number of buffers to 2
venc: trivial fixes
log: add missing include
base: re-enable queues properly
venc: decrease input buffer size
base: wait for eos
base: possible fix
Initial MPEG-4 video encoder support
gstdspvenc.h: preemptively add H.264 to the list
base: add send_codec_data() helper
vdec: use send_codec_data()
vdec: extra checks
Add skip hack
Revert "venc: forcing mpeg4 I frame each i_frame_interval"
venc: reorganize stream/dynamic params
base: trivial cleanup
base: properly set param virt addr
Add param argument to buffer callbacks
Add buffer argument to buffer callbacks
base: add buffer recv_cb
base: add check for end addr alignment
vdec: fix extra unref for codec-data
base: trivial cleanups
Rename dmm_buffer_flush() to dmm_buffer_clean()
base: fix memory read
dmm_buffer: clean instead of flush
dmm_buffer: add cache 'flush' function back
Use more proper cache functions
base: handle bad node termination
base: make EOS alignment an option
jpegenc: enable eos align
venc: improve integer framerate calculation
venc: fix bitrate calculation
venc: cleanup bitrate calculation
venc: remove jpeg from bitrate calculation
venc: tweak bitrate calculation
venc: trivial cleanups
venc: add 'quality' field
venc: calculate smaller buffer sizes
Fix some static analysis warnings
log: avoid pr_info when gst debugging is off
base: remove use_map_cache
Trivial cleanups
Cleanup type registrations
base: improve some compiler hints
dmm-buffer: check cache flush size
base: properly free node resources
Create custom dsp_node_t
dsp-bridge: store node heap ourselves
dsp-bridge: store node msgbuf ourselves
dsp-bridge: cleanup node_free
base: copy buffers when appropriate
base: remove unnecessary cache flushing
venc: set rate-control to variable
base: post critical error mesages to the bus
Hoseok Chang (1):
venc: tune mp4v parms for better performance
Juha Alanen (5):
vdec: set profile based on the frame size
vdec: improve H.263 args
vdec: initial support for WMV9
venc: set profile correctly for H.263 and MPEG4
venc: disable single scan output for JPEG encoder
Marco Ballesio (8):
vdec: fix srcpad setup
venc: rename mp4venc_stream_params
venc: add mp4venc_out_stream_params
base: use proper buffer length
venc: forcing mpeg4 I frame each i_frame_interval
venc: reordered mp4venc_args initialization
venc: added bitrate computation formula
venc: propagate keyframes properly
Mark Nauwelaerts (2):
base: safer buffer allocation and freeing
base: fix element ref leak
Miguel Verdu (2):
venc: tune MPEG-4 parameters
venc: tune MPEG-4 parameters for quality
René Stadler (3):
base: fix thread leak
base: advance timestamp pointer for empty output buffers
base: don't use DSP flushing
Tim-Philipp Müller (1):
base: unref unused output buffer when skipping output
Ripary and linux 2.6.31
So codeswarm.rb has now been renamed to ripary and got some project hosting.
In order to celebrate I created a visualization of linux 2.6.31 development.
Here it is:
Next step is to figure out a way to render videos that don’t look so crappy on YouTube
Who wrote Pidgin’s msn? Not who you think
So, it looks like Pidgin developers have a little trouble believing that I’ve
contributed substantially to the msn prpl, so I decided to prove it once and
for all.
How msn-pecan fixed a 6 year old bug, how Pidgin didn’t, and stole the fix
The bug we are talking about is the infamous switchboard timeout error which was very elusive, it happened randomly, and very often for some users in unknown conditions. Essentially you send a message, and after one minute you receive a notification telling you the message never arrived, after which you need to resend the message, and hope it will arrive this time.
Let’s see how the two projects approached this bug.
Pidgin
There have probably been many bug reports regarding this issue, but it’s very difficult to find old historic bugs in Pidgin’s new and old tracker. The modern version is reported in Pidgin’s tracker as #3330. There you can see people saying it happens a lot, that the priority should be increased, and many tickets were marked as duplicate. Developers however stayed in denial mode: they say it doesn’t happen to them, and then turn to the usual strategy: ask for irrelevant information such as a valgrind log, and to try again as it might have been magically fixed.
Then they try a simplistic workaround; re-send the message on failure. This doesn’t work on most cases, and even when it does, the message arrives more than 1 minute late. As usual, no developer did much else about the bug.
In the mean-time, Adium had many reports (2475, 2395, 6316, 6708, 6952, 7288, 9978, 11045, 11398, 11478) of the same bug. At this point something was very clear: it happens more often in OS X.
The interesting point is when Rasmus Hummelmose, an Adium user, logged to IRC to rant about the problem. He received the same response on both #adium and #pidgin; it’s a server problem, or it’s your slow connection, there’s nothing we can do. That didn’t convince him (it wasn’t true) and he effusively tried to explain that the issue was real and was affecting many users. He didn’t achieve anything more than upsetting the developers.
This is not the way to solve an important bug.
msn-pecan
The msn-pecan team on the other hand thought: hey, there’s a bug, and this guy can reproduce it, let’s fix it. I invited him to #msn-pecan. Rasmus was a bit reluctant; Why loose time with msn-pecan developers? Surely Pidgin developers must be capable enough to do the job. He changed his mind when I explained that the core parts of libpurple’s (Pidgin) msn were either developed or refined by me anyway, and therefore, Pidgin devs probably didn’t have the expertise required to identify this problem.
With that we started an endeavour to fix the problem through the weekend. I started by providing some infrastructure changes in order to visualize what was actually happening, Devid Antonio Filoni created Adium builds, and Rasmus tested, and provided feedback. We made some conjectures and discarded them with further testing and fixed some bugs along the way until we found a reliable way to reproduce: send a message, wait for 15 minutes of inactivity, and send another message.
After this is was clear that something bogus was happening with the network connection, but since we cannot fix all the elements involved, we implemented a simple fix: close the connection after 1 minute. That worked perfectly. Rasmus was happy, and we were too
That’s how you do it.
The stealing
Logically after our success, Rasmus decided to rub the fix on the face of Pidgin and Adium developers, after all, they were the ones that said it was not a bug. But they were not impressed.
However, Daniel Ljungborg (aka Dimmuxx) was interested in the fix, and in good faith I pointed the commit message that explains the issue in detail.
Then I find out Ka-Hing Cheung, a Pidgin developer, implemented the fix as I described, but thought it was OK to not thank anybody, explain where the fix came from, or mention the msn-pecan project, or any external source at all. We (Rasmus, Devid and I) spent a weekend of our free time working hard to identify, fix, and verify the issue, and if you read the commit message you would think they came out with the solution:
Author: khc@pidgin.im
Timeout switchboard connections at 60 seconds, should Fixes #3330 for most people.
That is plagiarism, pure and simple, and unfortunately, it’s not the first time.
msn-pecan 0.1.0-rc1 ready for testing; on the way to the first serious release
The next msn-pecan release started as 0.0.20 but there are so many changes that
it’s going to be 0.1.0. It is way more stable than 0.0.19 but we still would
like to do more extensive testing, so we are rolling a release candidate in
order to fix critical bugs that might be lingering. Hopefully it will be the
only release candidate before the actual release.
The aim of 0.1.0 is going to be our “first serious release”, that doesn’t mean
the previous releases were bad, it just means that we were never truly
confident about the code being delivered until now.
Compared to 0.0.19:
- Timeout issues fixed (switchboard error)
- Better offline messages receiving support
- Offline message sending support
- Reorganization of P2P code (less crashes)
- Several crash fixes
- Adium improvements
- Performance improvements
- Massive code reorganization
Special thanks for Devid Antonio Filoni, and Andrea Piccinelli who have been
very active fixing issues and making sure msn-pecan is rock-solid. Also Rasmus
Hummelmose who was essential in fixing the timeout issues, it wouldn’t have
been possible without his testing. Also thanks to the Pidgin developers (we
picked some patches), and many other contributors.
This is the list of issues fixed so far:
- 37: Pidgin leaves handle on files after transfers
- 82: Implement sending of offline messages
- 117: Received offline messages are being cut
- 138: Translation is not whole integrated from Launchpad
- 144: Unable to chat after message timed out
- 155: Pidgin crashes after connecting (using NTLM Authorization Proxy Server)
- 156: msn-pecan crash in msg_ack() at cvr/slplink.c:321
- 157: msn-pecan crash in msn_switchboard_can_send() at switchboard.c:779
- 158: msn-pecan crash in msn_switchboard_free() at switchboard.c:262
- 159: Pidgin crash when connecting to MSN
- 161: 0.0.19 ubuntu package
- 163: Translations not working on win32
- 164: msn-pecan crash in pecan_contact_get_personal_message() at ab/pecan_contact.c:616
- 170: Crash upon sign in
- 171: crash when disabling account
- 174: Windows 7 RC and Pecan
- 177: Offline messages of blocked contacts should not be displayed
- 181: Too many timeout messages
- 183: msn-pecan should use audio:// links with pidgin 2.6.0
- 184: already showed OIM message show again using another client
- 185: Add support for receiving winks
- 133: pidgin crashed with SIGSEGV in msn_message_destroy()
- 154: Pidgin Randomly Crashes
- 166: proxy authorization support missing
- 153: User Adding Problems
The diffstat is huge:
44 files changed, 3423 insertions(+), 3116 deletions(-)
For the source tarball, win32 installer and maemo package check the usual location:
http://code.google.com/p/msn-pecan/downloads/list
And the Adium build is here:
http://code.google.com/p/msn-pecan/wiki/AdiumBuilds
So, start the testing! And please report back any issues
Here is the current list of pending issues for 0.1.0 final:
http://code.google.com/p/msn-pecan/issues/list?q=label%3Amilestone-0.1.0
Finally here’s the shortlog:
6 Andrea Piccinelli
1 Chris Stafford
1 David Geary
29 Devid Antonio Filoni
1 Devid Filoni
4 Elliott Sales de Andrade
214 Felipe Contreras
2 Mike Ruprecht
Don’t underestimate Google Chrome OS, or Google for that matter
This is somewhat a response to the post “Let’s all take a deep breath and get some perspective” which criticizes Google mostly on the basis of the “failures” of Android and Chrome. But also, everyone is talking these days about Google Chrome OS, and how it is a silly idea. Is that so?
libmtag-0.3.0: moved to git
I finally managed some time to make another libmtag release. This is mostly tiding up the code, cleanups, new codestyle, building improvements and moved to github
Also some handy features:
- strip tag: now you can remove say id3v1 tags while keeping id3v2 intact
- get specific tag: similarly, you can retrieve only id3v2 information
- get all: this function might is useful for some UIs, specify some callback, and get all the tags
I wonder why not so many people are using this, is there a better tagging library?
Any packagers interested?
Grab it while it’s hot
Response to Christian Schaller — Google, the LGPL and software patents
I read Christian Schaller’s post which says essentially that Google is evil because it’s using FFmpeg in Chromium and arguing the legality of it by using an unusual interpretation of LGPL. because Google is using an unusual interpretation of LGPL.
Let’s step back for a second and see this through the point of view of FFmpeg developers. Probably they, just like any other FOSS developer, just want to code kick-ass software, and the license (LGPL) is just a tool to make sure their software is not stolen, so if a company chooses to use FFmpeg, they must contribute the changes back.
Google is contributing back their changes, they are publicly available in their repo. So how could FFmpeg developers loose? Their code will be used in an amazing product, that they will probably use too, it’s a win-win situation. This subject was brought up on the mailing list and nobody complained; Chromium is not listed in FFmpeg’s hall of shame.
Now, is it legal? The only way to know is to bring the issue to court and see the resolution, but who will bring this to court? FFmpeg developers? No. Perhaps H.264 patent holders, but only in countries with wicked patent laws (USA), and who cares about them? If Google looses in court against H.264 patent holders, I wouldn’t consider it evil, quite the contrary.
And finally, Google lawyers said that what the FSF thinks about this movement is irrelevant… damn right! They wrote the license, so? FFmpeg choose the license, and FFmpeg can choose another license if they so wish, in fact, they can re-license to Google in any other license they see fit because they have the copyright. Of course there’s no need for that because LGPL works fine, and the explanation of Google lawyers is completely logical to me.
Personally I cheer the Google Chromium team for such a bold movement, and congratulate FFmpeg developers for making kick-ass software that might soon be even more widely used.
Installing scratchbox 1 and 2 for ARM cross-compilation
Hi,
I’ve tried many different cross-compilation methods and so far scratchbox is the simplest and most effective. Here I’ll try to introduce the benefits of using it, and how to get started as simply as possible.
Intro
If you are not familiar with scratchbox; it’s a cross-compilation toolkit which allows you to use native tools (gcc, binutils, perl) when possible and emulate the target through qemu when needed.
It’s needed because of autotools; have you seen these checks?
checking whether the C compiler works... yes
The configure script actually compiles a small program and then runs it to validate it’s working, and sometimes extract information, such a the size of certain structures which might be different depending on the platform. If you tell ‘configure’ that you are cross-compiling it will go through a different path (which is much less tested) and ultimately will end up with wrong information that you need to correct.
OpenEmbedded and other distributions go through each and every package, make sure cross-compilation works, sometimes patching configure.ac, and often providing some information that normally would be obtained by running some test program.
This is an example of a typical GLib cross-compilation
./configure ---host=arm-linux --build=i386-linux
You’ll see something like:
checking whether the C compiler works... yes checking whether we are cross compiling... yes
And then:
checking for growing stack pointer... configure: error: in `glib-2.20.3': configure: error: cannot run test program while cross compiling
Of course, ‘configure’ has no way of knowing whether the stack grows on this particular platform. So you need to tell him yourself by creating an arm-linux.cache file like this:
glib_cv_stack_grows=no
And then running:
./configure --host=arm-linux --build=i386-linux --cache-file=arm-linux.cache
Of course that is not enough, you need to specify more:
glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getgrgid_r=yes
ac_cv_func_posix_getpwuid_r=yes
And then the compilation fails because I don’t have glib-genmarshal in my system, and it’s needed by the build. Normally it’s compiled and run in the build, but now we can’t do that.
All these problems disappear with scratchbox.
Installing scratchbox 1
Many people think it’s difficult to install, but it’s not. Just follow these easy steps:
install
Download the basic packages:
wget -c http://scratchbox.org/download/files/sbox-releases/apophis/tarball/scratchbox-core-1.0.14-i386.tar.gz
wget -c http://scratchbox.org/download/files/sbox-releases/apophis/tarball/scratchbox-libs-1.0.14-i386.tar.gz
wget -c http://scratchbox.org/download/files/sbox-releases/apophis/tarball/scratchbox-devkit-qemu-0.10.0-0sb5-i386.tar.gz
wget -c http://scratchbox.org/download/files/sbox-releases/apophis/tarball/scratchbox-toolchain-cs2007q3-glibc2.5-arm7-1.0.12-9-i386.tar.gz
Extract them:
sudo tar -xf /tmp/sb/scratchbox-core-1.0.14-i386.tar.gz -C /opt
sudo tar -xf /tmp/sb/scratchbox-libs-1.0.14-i386.tar.gz -C /opt
sudo tar -xf /tmp/sb/scratchbox-devkit-qemu-0.10.0-0sb5-i386.tar.gz -C /opt
sudo tar -xf /tmp/sb/scratchbox-toolchain-cs2007q3-glibc2.5-arm7-1.0.12-9-i386.tar.gz -C /opt
Setup scratchbox, and add your user:
sudo /opt/scratchbox/run_me_first.sh
sudo /opt/scratchbox/sbin/sbox_adduser $USER yes
You'll need to re-login to be in the sbox group and have proper permissions:
sudo su $USER
target
Finally, setup an armv7 target (you can have multiple targets inside scratchbox):
/opt/scratchbox/tools/bin/sb-conf setup armv7 --force --compiler="cs2007q3-glibc2.5-arm7" --devkits="qemu" --cputransp="qemu-arm-sb"
/opt/scratchbox/tools/bin/sb-conf select armv7
/opt/scratchbox/tools/bin/sb-conf install armv7 --clibrary --devkits --fakeroot --etc
That's it, you have scratchbox setup
I explicitly mentioned all the commands, but instead you can run this script that I wrote.
start
Before running scratchbox you'll need to do some steps as root:
echo 0 > /proc/sys/vm/vdso_enabled
echo 4096 > /proc/sys/vm/mmap_min_addr
/opt/scratchbox/sbin/sbox_ctl start
And then as user:
/opt/scratchbox/login
This will get you to this screen:
Welcome to Scratchbox, the cross-compilation toolkit! Use 'sb-menu' to change your compilation target. See /scratchbox/doc/ for documentation. [sbox-armv7: ~] >
Now if you want to cross-compile GLib, you do it as in your PC:
./configure && make install
Much easier, now scratchbox does all the magic
Scratchbox 2
Scratchbox 1 serves it's purpose, but there are many corner-cases where things get overly complicated so people came up with a much more elegant approach: Scratchbox 2.
In sb1 you need to login to a target (e.g. armv7, armv6, fremantle, diablo, etc.) in order to do anything, you can use only one target at a time, and each target is independent, in order to share tools between targets you need a devkit. Also, toolchains must be packaged in a special way.
In sb2, you don't login, you can setup any toolchain easily, you can use multiple targets at the same time, and you can configure it to do pretty much anything you want.
QEMU
sb2 doesn't include QEMU, you must have it already, this is how I compile it:
git clone git://git.savannah.nongnu.org/qemu.git
cd qemu
git checkout -b stable v0.10.5
./configure --prefix=/opt/qemu --target-list=arm-linux-user
make install
sbox2
Compile and install like this:
git clone git://anongit.freedesktop.org/git/sbox2
cd sbox2
./configure --prefix=/opt/sb2
make install
Add sb2 to the PATH:
export PATH=/opt/sb2/bin:$PATH
target
Now it's time to configure a target, I have a CodeSourcery toolchain installed on /opt/arm-2008q3, so:
cd /opt/arm-2008q3/arm-none-linux-gnueabi/libc/
sb2-init -c /opt/qemu/bin/qemu-arm armv7 /opt/arm-2008q3/bin/arm-none-linux-gnueabi-gcc
You don't need to log-in, just prefix your commands with sb2 to do the magic:
sb2 ./configure --prefix=/opt/arm/
If you want to use a different target just use the -t option:
sb2 -t armv8 ./configure --prefix=/opt/arm/
How cool is that?