Marcus Folkesson

Embedded Linux Artist

V4L2 and media controller

V4L2 and media controller The media infrastructure in the kernel is a giant beast handling many different types of devices involving different busses and electrical interfaces. Providing an interface to handle the complexity of the hardware is not an easy task. Most devices have multiple ICs with different communication protocols... so the device drivers tends to be very complex as well. Video For Linux 2 (V4L2) is the interface for such media devices. V4L2 is the second version of V4L and is not really compatible with V4L, even if there is a compatibility mode but the support is more than often incomplete. The name Video4Linux is a counterpart to Video4Windows, but is not technically related to it at all. cover

Parsing command line options

Parsing command line options Parsing command line options is something almost every command or applications needs to handle in some way, and there is too many home-made argument parsers out there. As so many programs needs to parse options from the command line, this facility is encapsulated in a standard library function getopt(2). The GNU C library provides an even more sophisticated API for parsing the command line, argp(), and is described in the glibc manual [1]. However, this function is not portable.

Embedded Linux Conference 2019

Embedded Linux Conference 2019 Here we go again! This trip got exited even before it begun. I checked my passport the day before we should leave and noticed that my passport has expired. Outch. Fortunately I was able to get a temporary passport at the airport. I must admit that I'm not traveling that often and do not have these 'must-checks' in my muscle memory.. This time we were heading Lyon in France. The weather is not the best but at least it's not freezing cold as in Sweden as it is this time of the year. cover

ligsegfault.so

libsegfault.so The dynamic linker [1] in a Linux system is using several environment variables to customize it's behavior. The most commonly used is probably LD_LIBRARY_PATH which is a list of directories where it search for libraries at execution time. Another variable I use quite often is LD_TRACE_LOADED_OBJECTS to let the program list its dynamic dependencies, just like ldd(1). For example, consider the following output $ LD_TRACE_LOADED_OBJECTS=1 /bin/bash linux-vdso.so.1 (0x00007ffece29e000) libreadline.so.7 => /usr/lib/libreadline.so.7 (0x00007fc9b82d1000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fc9b80cd000) libc.so.6 => /usr/lib/libc.so.6 (0x00007fc9b7d15000) libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007fc9b7add000) /lib64/ld-linux-x86-64.so.2 (0x00007fc9b851f000) libtinfo.so.6 => /usr/lib/libtinfo.so.6 (0x00007fc9b78b1000) LD_PRELOAD LD_PRELOAD is a list of additional shared objects that should be loaded before all other dynamic dependencies. When the loader is resolving symbols, it sequentially walk through the list of dynamic shared objects and takes the first match. This makes it possible to overide functions in other shared objects and change the behavior of the application completely. cover

Embedded Linux Conference 2018

Embedded Linux Conference 2018 OK, time for another conference. This time in Edinburgh, Scotland. My travel is limited to Edinburgh, but this city has a lot of things to see, including Edinburgh Castle, the Royal Botanic Garden, the clock that is always is 3 minutes wrong [1] and lots of more. A side note, yes I've tried Haggis as it's a must-try-thing and so should you. But be prepared to buy a backup-meal. cover

BEER2RST - my first attempt with golang

BEER2RST - my first attempt with golang I'm using Beersmith [1] a (non-free...) software to create my beer recipes. It's written in Java and runs well on Linux. One of the biggest benefits with using Beersmith is that my brewing house [2] is taking exported recipes as input and setup mash schemes automatically - really comfortable. I brew beer several times a month and always takes notes of each brewing, both methods and results. The goal is to get reproducible results each time or to make small improvements. Instead of having all these notes in separate locations, it would be nice if I instead collected all of my brewing as blog posts. cover

Lund Linux Conference 2018

Lund Linux Conference 2018 It's just two weeks from now til the Lund Linux Conference (LLC) [1] begins! LLC is a two-day conference with the same layout as the bigger Linux conferences - just smaller, but just as nice. There will be talks about PCIe, The serial device bus, security in cars and a few more topics. My highlights this year is to hear about the XDP (eXpress Data Path) [2] to get really fast packet processing with standard Linux. For the last six months, XDP has had great progress and is a technically cool feature. cover

ath10k QCA6584 and Wireless network stack

ath10k QCA6584 and Wireless network stack ATH10K is the mac80211 wireless driver for Qualcomm Atheros QCA988x family of chips, and I'm currently working [1] with the QCA6584 chip which is an automotive graded radio chip with PHY support for the abgn+ac modes. The connection interface to the chip is SDIO which is hardly supported for now, but my friend and kernelhacker, Erik Strömdahl [2] , has got his hands dirty and is currently working on it. There has been some progress, the chip now able to scan, connect, send and receive data. There is still some issues with the link speed but that is coming. cover

Linux driver for PhoenixRC adapter

Linux driver for PhoenixRC adapter Update: Michael Larabel on Phoronix has written a post [3] about this driver. Go ahead and read it as well! A few years ago I used to build multi rotors, mostly quad copters and tricopters. It's a fun hobby, both building and flying is incredible satisfying. The first multi rotors i built was nicely made with CNC cutted details. They looked really nice and robust. However, with more than 100+ crashes under the belt, the last ones was made out of sticks and a food box. Easy to repair and just as fun to fly. cover

Patch changelogs with git-notes

Patch changelogs with git-notes Git notes [1] is a neat function that has been around since v1.6.6. Notes is a kind of metadata that belongs to a certain commit but is stored separately (different git object) from the commit itself. The fact that it's a separate git object is important, it will therefor keep the commit hash intact, and as a bonus - it has its own diff log. Basic usage git-notes has support for add, append, copy edit, list, prune, remove and show subcommands. These subcommands is rather self-explanatory, so I will not describe them any further. cover