I2S Bus Channel Configuration in GStreamer alsasrc

A colleague recently observed a significant discrepancy in CPU usage while testing the GStreamer alsasrc and osssrc plugins. On our hardware platforms, alsasrc was consuming about 16% of CPU resources, whereas the vendor-provided test tools achieved the same task with only 1~2% overhead. This massive gap in efficiency piqued my curiosity, and I decided to investigate the root cause. After several hours of deep diving into the code, I discovered that when the plugin is set to “non-blocking mode,” it can trigger a busy-wait condition within a while loop, needlessly spiking CPU cycles. After a quick patch to optimize this behavior, I managed to bring the CPU usage down to 12%. While an improvement, it still felt far from the vendor tool’s efficiency. ...

February 8, 2013 · 2 min · 278 words · Fran Kuo

Practical Daemon Implementation in Embedded Linux

For anyone working with Linux, the concept of a “Daemon” (or service) is fundamental. Daemons are background processes that operate independently of any active user session. I recently deep-dived into this topic via Devin Watson’s Linux Daemon Writing HOWTO, which provides a fantastic primer and a clear template. Building on that foundation, I refactored several processes in my current project to run as persistent background services. Below is a code snippet demonstrating the core structural requirements for a Linux daemon: ...

September 19, 2007 · 2 min · 282 words · Fran Kuo

Reflections on Patch Files and Embedded Systems Development

Recently, I was assigned to work on a streaming server project. On our development platform, we utilize a combination of patch files and shell scripts to manage source code. We start with the upstream source, apply modifications via patch commands, and then compile the results into the necessary shared libraries or executables. Initially, I didn’t give much thought to why we adopted this specific workflow, but lately, I’ve begun to appreciate the profound advantages of this approach. ...

September 19, 2007 · 2 min · 254 words · Fran Kuo