The What, How and Why

I’ve thought a bit about learning a skill. How to progress. What the next steps are. This is probably because I’ve moved away from what I thought I used to be, career wise, to something else, and now I’m trying to determine what I will do when I grow up.

The only way to learn a skill is to actually perform the task. To do it. This ranges from the very basics – crawling, walking, running, cleaning your room, and so on. You can get inspired from a million YouTube videos and blog posts, but to learn to do something yourself, you need to do it yourself.

If we look at programming. This is something I’ve done since I was ~12. I know how to code. I can tell when other people know how to code. They get it. Then it is not as much about what language or framework to use. Instead they understand the concept of code. How to solve problems using code.

There is a tangent here about tools and frameworks and how the volatility of this side of the trade ruins my conception about knowing how to code, but let’s save that for later.

My issue with coding is that it quickly becomes “pick another ticket”. What intrigues me is the what to do, which leads to two very interesting questions – why? and how?

The why is interesting because it moves from the art of implementing code to the mysteries of figuring out what the customer whats. This quickly leads to business and how can we have a sustainable customer relationship. Something that is even more interesting when it comes to open source, as the customer is more empowered and in many ways acts as a partner instead of a customer.

The how is also interesting. Especially when you look at the question through the lens of a large project that will take time to build, or through a corporate lens. This is where methodology comes into play. I hate to say agile, because it means so many things, but there are supports that can be used to support both agile and less agile ways of working. I’m thinking of automation. Automated builds, automated tests, automated deployments, infrastructure as code (i.e. some sense automation of the automation). There is a mountain of non-recurring engineering that each software organization must climb to be productive.

For me, these stages came as a linear progression. First I did, then I thought about what to do, when why and how, but they are interconnected. There are various feedback loops hidden, which both limits and drives the progression of the product and team.

Looping back to the original question – what do I want to do when I grow up – I’ve started to circle in towards building teams. I’m still to fully define this, but this would be to help drive the why, how and what to provide purpose and a nice work place for a development team. The question I’m asking myself right now is towards whom to define the why, how and what. It very interesting to do it directly to the end customer, but in a corporate setting, that is rarely the case. Then, instead, this must be defined in relation to the surrounding organization, and how to do this in a good way is still something where I’m in the do stage.

Do you want me to dive deeper in any particular direction, or have thoughts of your own? Reach out to me in the comments or at Mastodon.

This post is a part of my 100 days to offload effort.

A summer of catching up

The feeling of this summer is one of catching up. Last summer was intense due to changes in the family followed by decease and death, leaving with me as a full time single parent. To my great joy, I’ve met someone who is special to me, so this summer has been about getting our families to work as one. It has been fun, but also very intense.

This means that my focus on engagements that I used to do has been very focused on deadlines and what must be done, rather than what I take pleasure in doing. That means economic reporting for foss-north and such. I pushed hard to make foss-north possible this year, and am very happy that it did. However, I’m still catching up in the post event activities.

This means editing videos and such now, rather than in May, and trying to get them on-line during the fall. All speakers have been very understanding in this, so I’m sure it will be good eventually.

This also means that I’ve actively taken a step back from gbgcpp (and swedencpp), as well as not attending fosdem, nor any Stockholm meetups (tdbi, swedencpp, etc). It also means that there has been no gbgcpp activity for a very long time. Let’s see how (if?) I can reactivate that community at some point in time. Don’t hesitate to reach out to me if you want to help.

This post is a part of my 100 days to offload effort.

100 Days to Offload – take off

So, I’ve been procrastinating instead of jumping into the 100 Days To Offload bandwagon. This is something I’ve contemplated for a long time, so it is a bit ironic that I failed to get started. The idea is to just write, and that is what I intend to do from now on.

Hopefully the 100 posts during a year means that I finally get into a habit of blogging. It’s been a very on and off thing for me, but I want it to be a part of my routine.

As a part of this, I’ll probably expand a bit on what I cover in this blog. The title is Life of a Developer, and my life has been quite dramatic over the past couple of years, so I’ll try share a bit about that.

On the other hand, that does not mean that I’ll stop writing about events I’m arranging or taking part in, nor about technology that gets me excited. Perhaps this can even motivate me to do some more coding just to get contents. Let’s see.

I’ll link to my posts and use the #100daystooffload hash tag over at my Mastodon account. Feel free to follow me there, or via the good old RSS flow.

Either way, this is a first post of at least a hundred. See you on the other side!

tosemu and gen.ttp

This being a long weekend in Sweden, I decided to see if I could make some progress with the tosemu project.

First a quick recap. Tosemu is what Wine is for Windows, but for TOS from the Atari ST series of computers. I.e. not an emulator, but rather, a translation layer re-implementing the OS APIs. There is of course a bit of emulation going on, as the binaries are made for the glorius Motorola 680×0 series of CPUs, but I digress.

So, I decided to take the let’s make something work approach, so pulled out good old DevPac 3.1 and tried the command line interface to the assembler called gen.ttp. After having implemented Keytbl, Cconrs, Crawcin and Crawio, I got this far:

e8johan@xps13iv:~/projects/atari/tosemu$ make && ./bin/tosemu ../inst/devpac31/bin/gen.ttp
make: Nothing to be done for 'all'.
Enter command line:
demo

Gen Macro Assembler Copyright � HiSoft 1985-93
All Rights Reserved - version 3.10

Error: invalid pre-assembled file in assembly options

1 error found
65535 lines assembled into 0 bytes, Atari executable position-independent code
42 bytes used out of 16273361, took 0.0 seconds

This is where it turns interesting. I did a small fix to the Fseek function, treating the offset as a signed 32 bit integer instead of an unsigned one, but that didn’t get me much further. This is where the work becomes interesting, as the next step is to start following the machine code of the program being run, to figure out what is going wrong. Let’s see when I dare to dive down that rabbit hole.

foss-north – two weeks left

It is under two weeks left until foss-north, so make sure that you have your tickets at hand.

The event takes place from Sunday April 23, with a Community Day. We have a couple of workshops lined up and a social event, but there is still room for more if you want to arrange something.

Then follows two days of conference on April 24-25 where we have a whole range of awesome speakers lined up. The conference is recorded, but not live streamed. As you know – it is only live once – so make sure to secure your tickets.

First face-to-face conference since COVID, so I’m psyched and nervous. Let’s make this a great one!

foss-north – Just one month left

As I blogged about earlier, life has been challenging the past months, but now things are getting back to normal. This means that some things are late, but also that I really want to do some things. foss-north is among these things.

In one month, April 23-25, foss-north 2023 will take place at Chalmers Conference Centre, in Gothenburg, Sweden. This will be the first in-person event since 2019 and I know it will be great. The speaker line-up has been set and it will be great. We’ve got a bunch of great sponsors helping out to make this possible. What we need are projects for the community day and visitors – this is where you come in to the picture!

So, to encourage you to get yourself a ticket. Tell your friends. And if you want to do a hackaton, workshop or just hang out with fellow hackers, reach out to me to get your project to join the community day!

fossified

Magnus, Daniel, Henrik, and I have met here and there when doing various things around open source. It can range from hanging out over beers at fosdem, to doing compliance work together at customers. Regardless of context, we always have fun and lots to talk about. So what’s better than starting a podcast – that way, we need to meet up just to talk. From this, fossified was born.

Our common denominator is that we are open source people and friends. So the common denominator between fossified episodes will be just that – us and open source. The rest is up to you. Help us come up with topics over at our issue tracker at github.

We would love your input – be it ideas for topics, improvement suggestions, a jingle, a logo or even some css love for the fossified website.

And one more thing! We just released the pilot episode.

Getting back to speed

The end of 2022 and beginning of 2023 has not been much to cheer about, but life goes on and it is time to do some fun stuff, and I’ve got some lined up that just might involve you.

First of all, foss-north is back as a physical event. The 2023 event will be the 8th (9th if you consider that we had two events back in 2020 in hope of COVID to be over after the summer) and it will be the 5th physical event. Last time around, in 2019, we peaked the number of speakers, community projects and visitors, so I hope that we can continue that trend and make it even bigger this year.

If you want to participate as a speaker the Call for Paper is still open for another week, so feel free to join in. We’re also looking for projects for the community day as well as sponsors and visitors. Tickets will be made available during March.

In addition to this, me and a couple of friends are getting back to podcasting. The topic is anything open source and we’ve setup a github project for you to contribute your ideas. Feel free to drop in your suggestions.

Hibernation

So, another day, another update. Today I managed to get hibernation working on my Dell XPS13 Plus (9320) running Debian.

So, a quick recap. I’m running Debian testing. I set up the system with Guided – Use entire disk and Setup LVM. This leaves me with an encrypted root partition. What I want to do now, is to put a reasonably sized swap file there, and make the system hibernate to it.

So, first, I created a 35 GB (35840MB) large swapfile as /swapfile. I prefer to create a swapfile slightly larger than RAM, to ensure that everything fits and my machine comes with 32GB of RAM. I used the instructions in the excellent Arch Wiki to set this up. I also edited /etc/fstab, commenting out the swap partition setup by the installer and adding the swapfile.

Then, I followed these instructions to find and set the resume and resume_offset in the /etc/defaults/grub file. I changed the GRUB_CMDLINE_LINUX_DEFAULT parameter.

A quick reboot followed by a sudo swapon --show told me that the swap file was active, so time to hibernate!

sudo systemctl hibernate

This resulted in a lovely Sleep verb "hibernate" not supported error message in bright red. Lovely.

After some poking around I had a look at dmesg and found a reference to kernel lockdown. It turns out that you cannot hibernate if kernel lockdown is active. Being more concerned about battery life than some expert hacker stealing my computer and getting to all my data, I decided to try to get rid of it. Turns out that by disabling secure boot in BIOS does the trick.

So, now this works. Let’s see when I can fix the next issue. I’ve got the audio issue discussed earlier and the web cam left to fix.

Debian on the XPS13 Plus (9320)

TL;DR; Still no sound, but I learned a couple of new things…

So, I finally got around to upgrading my laptop. I decided to go for my fourth XPS13, and this time I opted for a maxed out XPS13 Plus. A really nice machine. However, the driver stack isn’t quite there yet. Yes, I should have read up more before buying, but I didn’t and I know it will be sorted out over time.

As a vim user, the touch Esc key will be a challenge. Perhaps this is where I learn to bind to capslock, but I’ve not come to that point yet.

So, after installing using the netinst image with non-free drivers (and my phone over USB tether for networking since the wifi still didn’t work), I had to move to testing for anything to work. Then I installed firmware-iwlwifi, iwlwifi and firmware-sof-signed from non-free. This got me into a graphical desktop and most things work (I could configure the touch pad for tap-to-click, and so on). I run a KDE desktop, so I installed some Plymouth stuff, breeze for SDDM and such, but that shouldn’t affect the issues described here.

My current issues are the sound, the webcam and hibernation. The two latter items aren’t huge problems, but I do need sound. Both the webcam and sound issues are known. Hibernation is mostly about getting around to configuring it with the encrypted disk setup.

So, let’s start by diving into the audio issue. The early boot process looks like this:

[   20.595666] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[   20.595750] sof-audio-pci-intel-tgl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[   20.595778] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[   20.596001] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[   20.596073] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   20.602984] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[   20.651283] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 4
[   20.652476] sof-audio-pci-intel-tgl 0000:00:1f.3: firmware: direct-loading firmware intel/sof/sof-adl.ri
[   20.652482] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[   20.652483] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[   20.652488] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[   20.747032] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[   20.747036] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[   25.758149] sof_sdw sof_sdw: snd_soc_register_card failed -517
[   25.768995] sof_sdw sof_sdw: snd_soc_register_card failed -517
[   25.799027] sof_sdw sof_sdw: snd_soc_register_card failed -517

If I later force a reload of the module, it all works:

sudo modprobe -r snd-sof-pci-intel-tgl; sudo modprobe snd-sof-pci-intel-tgl

Gives:

[  169.407671] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[  169.407784] sof-audio-pci-intel-tgl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[  169.408027] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[  169.408133] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[  169.414240] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[  169.428614] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 4
[  169.428802] sof-audio-pci-intel-tgl 0000:00:1f.3: firmware: direct-loading firmware intel/sof/sof-adl.ri
[  169.428809] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[  169.428810] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[  169.428814] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[  169.547087] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[  169.547115] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[  169.563645] sof-audio-pci-intel-tgl 0000:00:1f.3: firmware: direct-loading firmware intel/sof-tplg/sof-adl-rt1316-l12-rt714-l0.tplg
[  169.563665] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:22:1 Kernel ABI 3:23:0
[  169.564019] sof_sdw sof_sdw: ASoC: Parent card not yet available, widget card binding deferred
[  169.605390] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3
[  169.627693] input: sof-soundwire HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input26
[  169.627738] input: sof-soundwire HDMI/DP,pcm=6 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input27
[  169.631375] input: sof-soundwire HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input28

So, something happens after sof-adl.ri is loaded. This causes the driver to just stop before loading the sof-adl-rtl316-l12-rt714-l0.tplg firmware, causing the snd_soc_register_card to fail. Let’t have a look at the reasons.

First up, the excellent Arch Linux Wiki says to include the two firmware files and a bunch of modules in the initramfs. However, Arch and Debian uses different tools to build the initramfs, so let’s confirm the issue first:

lsinitramfs -l /boot/initrd.img-6.0.0-5-amd64  | grep 'intel/sof'

This call results in a list of nothing. Just to confirm, grepping for firmware or intel returns long lists of files. So, the firmware is not in the early initramfs image. How do I get the firmware files into the initramfs? Apparently I have to write what is known as an initramfs-tools hook script.

There lives a bunch of them over at /usr/share/initramfs-tools/hooks, so I started a very brute force one called intel-sof-firmware and tried to learn from the surrounding scripts and the manpage linked above. The result can be found in a gist here.

Notice that this is happy code. There is way too few sanity checks in there to make this useful to the general public. Your milage may vary.

So, I added the modules to /etc/initramfs/modules, and then updated the early initramfs images with this command:

sudo update-initramfs -k all -u

And then verified that the files made it to the image (I also had a look at the file listing in general to ensure that the image is ok):

lsinitramfs -l /boot/initrd.img-6.0.0-5-amd64  | grep 'intel/sof'

drwxr-xr-x   2 root     root            0 Dec 11 15:51 usr/lib/firmware/intel/sof
drwxr-xr-x   2 root     root            0 Dec 11 15:51 usr/lib/firmware/intel/sof-tplg
-rw-r--r--   1 root     root        28907 Dec 11 15:51 usr/lib/firmware/intel/sof-tplg/sof-adl-rt1316-l12-rt714-l0.tplg
-rw-r--r--   1 root     root       525056 Dec 11 15:51 usr/lib/firmware/intel/sof/sof-adl.ri

It all seems to work, so let’s reboot and see what comes out the other side. Notice – this can brick your computer if you make a mistake. And if something to do with a computer can brick your computer, you know that it will brick your computer. Don’t say I did not tell you.

Side note: I run an encrypted lvm setup, and if you try to fix this problem by removing all modules (go from many to netbook in the initramfs.conf) you will enjoy re-installing your machine. I’m sure you can unbrick it by booting from a USB stick and fixing stuff, but since I’ve not really installed anything, I don’t really care.

Guess what – after a couple of hours digging at this – I still have no sound…

sudo dmesg | grep sof

Results in this (yay, a new error code – that must mean that I’m doing something):

[    1.760559] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    1.760629] sof-audio-pci-intel-tgl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[    1.760643] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[    1.760785] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    3.491343] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    3.569000] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[    3.585475] sof-audio-pci-intel-tgl 0000:00:1f.3: codec #2 probe error, ret: -2
[    3.585859] sof-audio-pci-intel-tgl 0000:00:1f.3: no hda codecs found!
[    3.585990] sof-audio-pci-intel-tgl 0000:00:1f.3: firmware: direct-loading firmware intel/sof/sof-adl.ri
[    3.585996] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    3.585998] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    3.586007] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[    3.702740] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    3.702756] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    3.709727] sof-audio-pci-intel-tgl 0000:00:1f.3: firmware: direct-loading firmware intel/sof-tplg/sof-adl-rt1316-l12-rt714-l0.tplg
[    3.709742] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:22:1 Kernel ABI 3:23:0
[    3.709825] sof-audio-pci-intel-tgl 0000:00:1f.3: error: can't connect DAI HDA0.OUT stream iDisp1
[    3.709920] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to add widget id 0 type 27 name : HDA0.OUT stream iDisp1
[    3.710026] sof_sdw sof_sdw: ASoC: failed to load widget HDA0.OUT
[    3.710086] sof_sdw sof_sdw: ASoC: topology: could not load header: -22
[    3.710162] sof-audio-pci-intel-tgl 0000:00:1f.3: error: tplg component load failed -22
[    3.710247] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP topology -22
[    3.710326] sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
[    3.710447] sof_sdw sof_sdw: ASoC: failed to instantiate card -22
[    3.710692] sof_sdw sof_sdw: snd_soc_register_card failed -22
[    3.710758] sof_sdw: probe of sof_sdw failed with error -22

I suspect I’m missing another driver in the initramfs. Still, the modprobe trick shown above still fixes sound, so I guess I’ll leave it for today…