Posted
almost 8 years
ago
During the last couple of days, I've been working on completing, cleaning up and merging a Virtual Um interface
(i.e. virtual radio layer) between OsmoBTS and OsmocomBB. After I started with the implementation and left it in an early
stage in
... [More]
January 2016, Sebastian Stumpf has been completing it around early 2017, with now some subsequent
fixes and improvements by me. The combined result allows us to run a complete GSM network with 1-N BTSs and
1-M MSs without any actual radio hardware, which is of course excellent for all kinds of testing scenarios.
The Virtual Um layer is based on sending L2 frames (blocks) encapsulated via GSMTAP UDP multicast packets.
There are two separate multicast groups, one for uplink and one for downlink. The multicast nature simulates
the shared medium and enables any simulated phone to receive the signal from multiple BTSs via the downlink
multicast group.
In OsmoBTS, this is implemented via the new osmo-bts-virtual BTS model.
In OsmocomBB, this is realized by adding virtphy virtual L1, which speaks the same
L1CTL protocol that is used between the
real OsmcoomBB Layer1 and the Layer2/3 programs such as mobile and the like.
Now many people would argue that GSM without the radio and actual handsets is no fun. I tend to agree, as I'm
a hardware person at heart and I am not a big fan of simulation.
Nevertheless, this forms the basis of all kinds of possibilities for automatized (regression) testing in a way
and for layers/interfaces that osmo-gsm-tester cannot cover as it uses a black-box proprietary mobile phone
(modem). It is also pretty useful if you're traveling a lot and don't want to carry around a BTS and phones
all the time, or get some development done in airplanes or other places where operating a radio transmitter is
not really a (viable) option.
If you're curious and want to give it a shot, I've put together some setup instructions at the
Virtual Um page of the Osmocom Wiki.
[Less]
|
Posted
almost 8 years
ago
Exactly 10 years ago, on July 9th, 2007 we started to sell+ship the
first Openmoko Neo1973.
To be more precise, the webshop actually opened a few hours early,
depending on your time zone. Sean announced the availability in this
mailing list post
I
... [More]
don't really have to add much to my ten years [of starting to work on] Openmoko anniversary blog post a year ago, but still thought it's worth while to point out the tenth anniversary.
It was exciting times, and there was a lot of pioneering spirit:
Building a Linux based smartphone with a 100% FOSS software stack on the
application processor, including all drivers, userland, applications -
at a time before Android was known or announced. As history shows, we'd
been working in parallel with Apple on the iPhone, and Google on
Android. Of course there's little chance that a small taiwanese company
can compete with the endless resources of the big industry giants, and
the many Neo1973 delays meant we had missed the window of opportunity to
be the first on the market.
It's sad that Openmoko (or similar projects) have not survived even as a
special-interest project for FOSS enthusiasts. Today, virtually all
options of smartphones are encumbered with way more proprietary blobs
than we could ever imagine back then.
In any case, the tenth anniversary of trying to change the amount of
Free Softwware in the smartphone world is worth some celebration. I'm
reaching out to old friends and colleagues, and I guess we'll have
somewhat of a celebration party both in Germany and in Taiwan (where
I'll be for my holidays from mid-September to mid-October).
[Less]
|
Posted
almost 8 years
ago
My friend and business partner has recently blogged about funding of the Osmocom Cellular Infrastructure Projects and while I want to write about the history of sysmocom s.f.m.c. GmbH I will focus on getting contributions (or as a replacement
... [More]
monetary support) for the project.
First of all I think the existence of Osmocom and Osmocom Cellular made a significant difference. It is used to provide connectivity to those previously ignored (Thank you everyone involved with Rhizomatica!) and we enabled mobile communication security research. This ranges from breaking ciphering, hijacking calls, easily fuzzing phones, the whole set of GSM MAP/CAP hacks which lead to real improvement of security and privacy for end users. We took the black out of the mobile black box and want to continue to do it.
My big question is how do we sustain such development (beyond personal sacrifice)? How do we get significant contributions to remove more black boxes and extend to 4G and beyond? If getting contributions is difficult the second best thing seems to be money. This allows to pay and hire new developers that want to spend their work hours on improving Free Software. So where can these contributions come from?
The research/security community
While OsmocomBB and OpenBSC opened up the door for university and corporate researchers to explore networks, offer penetration tests, the project didn’t get much in return though. Part of the problem seems that for research a sloppy modification is enough and when the researcher has published his paper, he is too ashamed to release the hack and moves on.
Universities and Students
Universities used to buy full GSM BTS but recently seem more interested in SDR platforms. While a SDR is not a BTS the promise of running a GSM and LTE network with the same universal radio peripheral is tempting. Fewer BTS sold means less funding for OpenBSC/osmo-bts but this could be easily compensated by increased contributions to osmo-bts and osmo-trx by students and university staff. For some reason this is not happening and I think there are plenty things to improve!
Vendors using OpenBSC and osmo-bts
In general I would expect that BTS vendors that integrate our software with their hardware would have an interest in the longevity of the project and either buy software support or have their staff maintain and contribute fixes. Sadly it seems that with the current state of the industry not contributing is seen as a commercial advantage…
Research grants
The first time I heard of funding of a Free Software project receiving significant funding was when the PyPy project was initiated. Today there are various funds that support Free Software initiatives (NLnet, Mozilla Grants and more) and last year my proposal to NLnet was selected and sysmocom could begin work on 3G support in Osmocom. While this is great, the amount of funding is not enough to keep a company focused on removing blackboxes from mobile communication going for too long. So more and bigger funds are needed.
I tried to get funds from Opentech but they didn’t seem to be interested in projects like replacing proprietary Qualcomm components from modules like the EC20/EC25, or building tools for 2G/3G/4G to allow to educate users on privacy impacts of using cellular technology and to understand how a phone behaves. My first research question would be to explore what really happens when 2G is disabled in a phone and a network tries to force a downgrade. But the proposal would have enabled much more. The proposals were rejected, maybe my proposal was just bad, maybe there is no interest to finance work on cellular technology (besides most data usage seems to be from mobile devices these days). The rejection doesn’t contain feedback so it is hard to tell which of the above is more true.
How can you help?
Maybe there is not enough interest and we should focus our time and energy somewhere else but if you consider our work as important as we do, maybe you can help us? We are looking
contributions fix a bug, add a feature, improve existing work and make sure it gets integrated
Help us to write project proposals for funds like the Opentech fund…
Buy sysmocom hardware?
Buy a moral license if your company can/want to do that?
Sponsor me (or someone else) and send bitcoin (?)?
Propose your idea?
[Less]
|
Posted
about 8 years
ago
Today is effectively my last day at Mozilla, before I start at Impossible on Monday. I’ve been here for 6 years and a bit and it’s been quite an experience. I think it’s worth reflecting on, so here we go; Fair warning, if you have no interest in me
... [More]
or Mozilla, this is going to make pretty boring reading.
I started on June 6th 2011, several months before the (then new, since moved) London office opened. Although my skills lay (lie?) in user interface implementation, I was hired mainly for my graphics and systems knowledge. Mozilla was in the region of 500 or so employees then I think, and it was an interesting time. I’d been working on the code-base for several years prior at Intel, on a headless backend that we used to build a Clutter-based browser for Moblin netbooks. I wasn’t completely unfamiliar with the code-base, but it still took a long time to get to grips with. We’re talking several million lines of code with several years of legacy, in a language I still consider myself to be pretty novice at (C++).
I started on the mobile platform team, and I would consider this to be my most enjoyable time at the company. The mobile platform team was a multi-discipline team that did general low-level platform work for the mobile (Android and Meego) browser. When we started, the browser was based on XUL and was multi-process. Mobile was often the breeding ground for new technologies that would later go on to desktop. It wasn’t long before we started developing a new browser based on a native Android UI, removing XUL and relegating Gecko to page rendering. At the time this felt like a disappointing move. The reason the XUL-based browser wasn’t quite satisfactory was mainly due to performance issues, and as a platform guy, I wanted to see those issues fixed, rather than worked around. In retrospect, this was absolutely the right decision and lead to what I’d still consider to be one of Android’s best browsers.
Despite performance issues being one of the major driving forces for making this move, we did a lot of platform work at the time too. As well as being multi-process, the XUL browser had a compositor system for rendering the page, but this wasn’t easily portable. We ended up rewriting this, first almost entirely in Java (which was interesting), then with the rendering part of the compositor in native code. The input handling remained in Java for several years (pretty much until FirefoxOS, where we rewrote that part in native code, then later, switched Android over).
Most of my work during this period was based around improving performance (both perceived and real) and fluidity of the browser. Benoit Girard had written an excellent tiled rendering framework that I polished and got working with mobile. On top of that, I worked on progressive rendering and low precision rendering, which combined are probably the largest body of original work I’ve contributed to the Mozilla code-base. Neither of them are really active in the code-base at the moment, which shows how good a job I didn’t do maintaining them, I suppose.
Although most of my work was graphics-focused on the platform team, I also got to to do some layout work. I worked on some over-invalidation issues before Matt Woodrow’s DLBI work landed (which nullified that, but I think that work existed in at least one release). I also worked a lot on fixed position elements staying fixed to the correct positions during scrolling and zooming, another piece of work I was quite proud of (and probably my second-biggest contribution). There was also the opportunity for some UI work, when it intersected with platform. I implemented Firefox for Android’s dynamic toolbar, and made sure it interacted well with fixed position elements (some of this work has unfortunately been undone with the move from the partially Java-based input manager to the native one). During this period, I was also regularly attending and presenting at FOSDEM.
I would consider my time on the mobile platform team a pretty happy and productive time. Unfortunately for me, those of us with graphics specialities on the mobile platform team were taken off that team and put on the graphics team. I think this was the start in a steady decline in my engagement with the company. At the time this move was made, Mozilla was apparently trying to consolidate teams around products, and this was the exact opposite happening. The move was never really explained to me and I know I wasn’t the only one that wasn’t happy about it. The graphics team was very different to the mobile platform team and I don’t feel I fit in as well. It felt more boisterous and less democratic than the mobile platform team, and as someone that generally shies away from arguments and just wants to get work done, it was hard not to feel sidelined slightly. I was also quite disappointed that people didn’t seem particular familiar with the graphics work I had already been doing and that I was tasked, at least initially, with working on some very different (and very boring) desktop Linux work, rather than my speciality of mobile.
I think my time on the graphics team was pretty unproductive, with the exception of the work I did on b2g, improving tiled rendering and getting graphics memory-mapped tiles working. This was particularly hard as the interface was basically undocumented, and its implementation details could vary wildly depending on the graphics driver. Though I made a huge contribution to this work, you won’t see me credited in the tree unfortunately. I’m still a little bit sore about that. It wasn’t long after this that I requested to move to the FirefoxOS systems front-end team. I’d been doing some work there already and I’d long wanted to go back to doing UI. It felt like I either needed a dramatic change or I needed to leave. I’m glad I didn’t leave at this point.
Working on FirefoxOS was a blast. We had lots of new, very talented people, a clear and worthwhile mission, and a new code-base to work with. I worked mainly on the home-screen, first with performance improvements, then with added features (app-grouping being the major one), then with a hugely controversial and probably mismanaged (on my part, not my manager – who was excellent) rewrite. The rewrite was good and fixed many of the performance problems of what it was replacing, but unfortunately also removed features, at least initially. Turns out people really liked the app-grouping feature.
I really enjoyed my time working on FirefoxOS, and getting a nice clean break from platform work, but it was always bitter-sweet. Everyone working on the project was very enthusiastic to see it through and do a good job, but it never felt like upper management’s focus was in the correct place. We spent far too much time kowtowing to the desires of phone carriers and trying to copy Android and not nearly enough time on basic features and polish. Up until around v2.0 and maybe even 2.2, the experience of using FirefoxOS was very rough. Unfortunately, as soon as it started to show some promise and as soon as we had freedom from carriers to actually do what we set out to do in the first place, the project was cancelled, in favour of the whole Connected Devices IoT debacle.
If there was anything that killed morale for me more than my unfortunate time on the graphics team, and more than having FirefoxOS prematurely cancelled, it would have to be the Connected Devices experience. I appreciate it as an opportunity to work on random semi-interesting things for a year or so, and to get some entrepreneurship training, but the mismanagement of that whole situation was pretty epic. To take a group of hundreds of UI-focused engineers and tell them that, with very little help, they should organised themselves into small teams and create IoT products still strikes me as an idea so crazy that it definitely won’t work. Certainly not the way we did it anyway. The idea, I think, was that we’d be running several internal start-ups and we’d hopefully get some marketable products out of it. What business a not-for-profit company, based primarily on doing open-source, web-based engineering has making physical, commercial products is questionable, but it failed long before that could be considered.
The process involved coming up with an idea, presenting it and getting approval to run with it. You would then repeat this approval process at various stages during development. It was, however, very hard to get approval for enough resources (both time and people) to finesse an idea long enough to make it obviously a good or bad idea. That aside, I found it very demoralising to not have the opportunity to write code that people could use. I did manage it a few times, in spite of what was happening, but none of this work I would consider myself particularly proud of. Lots of very talented people left during this period, and then at the end of it, everyone else was laid off. Not a good time.
Luckily for me and the team I was on, we were moved under the umbrella of Emerging Technologies before the lay-offs happened, and this also allowed us to refocus away from trying to make an under-featured and pointless shopping-list assistant and back onto the underlying speech-recognition technology. This brings us almost to present day now.
The DeepSpeech speech recognition project is an extremely worthwhile project, with a clear mission, great promise and interesting underlying technology. So why would I leave? Well, I’ve practically ended up on this team by a series of accidents and random happenstance. It’s been very interesting so far, I’ve learnt a lot and I think I’ve made a reasonable contribution to the code-base. I also rewrote python_speech_features in C for a pretty large performance boost, which I’m pretty pleased with. But at the end of the day, it doesn’t feel like this team will miss me. I too often spend my time finding work to do, and to be honest, I’m just not interested enough in the subject matter to make that work long-term. Most of my time on this project has been spent pushing to open it up and make it more transparent to people outside of the company. I’ve added model exporting, better default behaviour, a client library, a native client, Python bindings (+ example client) and most recently, Node.js bindings (+ example client). We’re starting to get noticed and starting to get external contributions, but I worry that we still aren’t transparent enough and still aren’t truly treating this as the open-source project it is and should be. I hope the team can push further towards this direction without me. I think it’ll be one to watch.
Next week, I start working at a new job doing a new thing. It’s odd to say goodbye to Mozilla after 6 years. It’s not easy, but many of my peers and colleagues have already made the jump, so it feels like the right time. One of the big reasons I’m moving, and moving to Impossible specifically, is that I want to get back to doing impressive work again. This is the largest regret I have about my time at Mozilla. I used to blog regularly when I worked at OpenedHand and Intel, because I was excited about the work we were doing and I thought it was impressive. This wasn’t just youthful exuberance (he says, realising how ridiculous that sounds at 32), I still consider much of the work we did to be impressive, even now. I want to be doing things like that again, and it feels like Impossible is a great opportunity to make that happen. Wish me luck! [Less]
|
Posted
about 8 years
ago
Today is effectively my last day at Mozilla, before I start at Impossible on Monday. I’ve been here for 6 years and a bit and it’s been quite an experience. I think it’s worth reflecting on, so here we go; Fair warning, if you have no interest in me
... [More]
or Mozilla, this is going to make pretty boring reading.
I started on June 6th 2011, several months before the (then new, since moved) London office opened. Although my skills lay (lie?) in user interface implementation, I was hired mainly for my graphics and systems knowledge. Mozilla was in the region of 500 or so employees then I think, and it was an interesting time. I’d been working on the code-base for several years prior at Intel, on a headless backend that we used to build a Clutter-based browser for Moblin netbooks. I wasn’t completely unfamiliar with the code-base, but it still took a long time to get to grips with. We’re talking several million lines of code with several years of legacy, in a language I still consider myself to be pretty novice at (C++).
I started on the mobile platform team, and I would consider this to be my most enjoyable time at the company. The mobile platform team was a multi-discipline team that did general low-level platform work for the mobile (Android and Meego) browser. When we started, the browser was based on XUL and was multi-process. Mobile was often the breeding ground for new technologies that would later go on to desktop. It wasn’t long before we started developing a new browser based on a native Android UI, removing XUL and relegating Gecko to page rendering. At the time this felt like a disappointing move. The reason the XUL-based browser wasn’t quite satisfactory was mainly due to performance issues, and as a platform guy, I wanted to see those issues fixed, rather than worked around. In retrospect, this was absolutely the right decision and lead to what I’d still consider to be one of Android’s best browsers.
Despite performance issues being one of the major driving forces for making this move, we did a lot of platform work at the time too. As well as being multi-process, the XUL browser had a compositor system for rendering the page, but this wasn’t easily portable. We ended up rewriting this, first almost entirely in Java (which was interesting), then with the rendering part of the compositor in native code. The input handling remained in Java for several years (pretty much until FirefoxOS, where we rewrote that part in native code, then later, switched Android over).
Most of my work during this period was based around improving performance (both perceived and real) and fluidity of the browser. Benoit Girard had written an excellent tiled rendering framework that I polished and got working with mobile. On top of that, I worked on progressive rendering and low precision rendering, which combined are probably the largest body of original work I’ve contributed to the Mozilla code-base. Neither of them are really active in the code-base at the moment, which shows how good a job I didn’t do maintaining them, I suppose.
Although most of my work was graphics-focused on the platform team, I also got to to do some layout work. I worked on some over-invalidation issues before Matt Woodrow’s DLBI work landed (which nullified that, but I think that work existed in at least one release). I also worked a lot on fixed position elements staying fixed to the correct positions during scrolling and zooming, another piece of work I was quite proud of (and probably my second-biggest contribution). There was also the opportunity for some UI work, when it intersected with platform. I implemented Firefox for Android’s dynamic toolbar, and made sure it interacted well with fixed position elements (some of this work has unfortunately been undone with the move from the partially Java-based input manager to the native one). During this period, I was also regularly attending and presenting at FOSDEM.
I would consider my time on the mobile platform team a pretty happy and productive time. Unfortunately for me, those of us with graphics specialities on the mobile platform team were taken off that team and put on the graphics team. I think this was the start in a steady decline in my engagement with the company. At the time this move was made, Mozilla was apparently trying to consolidate teams around products, and this was the exact opposite happening. The move was never really explained to me and I know I wasn’t the only one that wasn’t happy about it. The graphics team was very different to the mobile platform team and I don’t feel I fit in as well. It felt more boisterous and less democratic than the mobile platform team, and as someone that generally shies away from arguments and just wants to get work done, it was hard not to feel sidelined slightly. I was also quite disappointed that people didn’t seem particular familiar with the graphics work I had already been doing and that I was tasked, at least initially, with working on some very different (and very boring) desktop Linux work, rather than my speciality of mobile.
I think my time on the graphics team was pretty unproductive, with the exception of the work I did on b2g, improving tiled rendering and getting graphics memory-mapped tiles working. This was particularly hard as the interface was basically undocumented, and its implementation details could vary wildly depending on the graphics driver. Though I made a huge contribution to this work, you won’t see me credited in the tree unfortunately. I’m still a little bit sore about that. It wasn’t long after this that I requested to move to the FirefoxOS systems front-end team. I’d been doing some work there already and I’d long wanted to go back to doing UI. It felt like I either needed a dramatic change or I needed to leave. I’m glad I didn’t leave at this point.
Working on FirefoxOS was a blast. We had lots of new, very talented people, a clear and worthwhile mission, and a new code-base to work with. I worked mainly on the home-screen, first with performance improvements, then with added features (app-grouping being the major one), then with a hugely controversial and probably mismanaged (on my part, not my manager – who was excellent) rewrite. The rewrite was good and fixed many of the performance problems of what it was replacing, but unfortunately also removed features, at least initially. Turns out people really liked the app-grouping feature.
I really enjoyed my time working on FirefoxOS, and getting a nice clean break from platform work, but it was always bitter-sweet. Everyone working on the project was very enthusiastic to see it through and do a good job, but it never felt like upper management’s focus was in the correct place. We spent far too much time kowtowing to the desires of phone carriers and trying to copy Android and not nearly enough time on basic features and polish. Up until around v2.0 and maybe even 2.2, the experience of using FirefoxOS was very rough. Unfortunately, as soon as it started to show some promise and as soon as we had freedom from carriers to actually do what we set out to do in the first place, the project was cancelled, in favour of the whole Connected Devices IoT debacle.
If there was anything that killed morale for me more than my unfortunate time on the graphics team, and more than having FirefoxOS prematurely cancelled, it would have to be the Connected Devices experience. I appreciate it as an opportunity to work on random semi-interesting things for a year or so, and to get some entrepreneurship training, but the mismanagement of that whole situation was pretty epic. To take a group of hundreds of UI-focused engineers and tell them that, with very little help, they should organised themselves into small teams and create IoT products still strikes me as an idea so crazy that it definitely won’t work. Certainly not the way we did it anyway. The idea, I think, was that we’d be running several internal start-ups and we’d hopefully get some marketable products out of it. What business a not-for-profit company, based primarily on doing open-source, web-based engineering has making physical, commercial products is questionable, but it failed long before that could be considered.
The process involved coming up with an idea, presenting it and getting approval to run with it. You would then repeat this approval process at various stages during development. It was, however, very hard to get approval for enough resources (both time and people) to finesse an idea long enough to make it obviously a good or bad idea. That aside, I found it very demoralising to not have the opportunity to write code that people could use. I did manage it a few times, in spite of what was happening, but none of this work I would consider myself particularly proud of. Lots of very talented people left during this period, and then at the end of it, everyone else was laid off. Not a good time.
Luckily for me and the team I was on, we were moved under the umbrella of Emerging Technologies before the lay-offs happened, and this also allowed us to refocus away from trying to make an under-featured and pointless shopping-list assistant and back onto the underlying speech-recognition technology. This brings us almost to present day now.
The DeepSpeech speech recognition project is an extremely worthwhile project, with a clear mission, great promise and interesting underlying technology. So why would I leave? Well, I’ve practically ended up on this team by a series of accidents and random happenstance. It’s been very interesting so far, I’ve learnt a lot and I think I’ve made a reasonable contribution to the code-base. I also rewrote python_speech_features in C for a pretty large performance boost, which I’m pretty pleased with. But at the end of the day, it doesn’t feel like this team will miss me. I too often spend my time finding work to do, and to be honest, I’m just not interested enough in the subject matter to make that work long-term. Most of my time on this project has been spent pushing to open it up and make it more transparent to people outside of the company. I’ve added model exporting, better default behaviour, a client library, a native client, Python bindings (+ example client) and most recently, Node.js bindings (+ example client). We’re starting to get noticed and starting to get external contributions, but I worry that we still aren’t transparent enough and still aren’t truly treating this as the open-source project it is and should be. I hope the team can push further towards this direction without me. I think it’ll be one to watch.
Next week, I start working at a new job doing a new thing. It’s odd to say goodbye to Mozilla after 6 years. It’s not easy, but many of my peers and colleagues have already made the jump, so it feels like the right time. One of the big reasons I’m moving, and moving to Impossible specifically, is that I want to get back to doing impressive work again. This is the largest regret I have about my time at Mozilla. I used to blog regularly when I worked at OpenedHand and Intel, because I was excited about the work we were doing and I thought it was impressive. This wasn’t just youthful exuberance (he says, realising how ridiculous that sounds at 32), I still consider much of the work we did to be impressive, even now. I want to be doing things like that again, and it feels like Impossible is a great opportunity to make that happen. Wish me luck! [Less]
|
Posted
about 8 years
ago
As the topic has been raised on twitter, I
thought I might share a bit of insight into the funding of the Osmocom
Cellular Infrastructure Projects.
Keep in mind: Osmocom is a much larger umbrella project, and beyond
the Networks-side cellular stack
... [More]
is home many different community-based
projects around open source mobile communications. All of those have
started more or less as just for fun projects, nothing serious,
just a hobby [1]
The projects implementing the network-side protocol stacks and network
elements of GSM/GPRS/EGPRS/UMTS cellular networks are somewhat the
exception to that, as they have evolved to some extent professionalized.
We call those projects collectively the Cellular Infrastructure
projects inside Osmocom. This post is about that part of Osmocom only
History
From late 2008 through 2009, People like Holger and I were working on
bs11-abis and later OpenBSC only in our spare time. The name Osmocom
didn't even exist back then. There was a strong technical community with
contributions from Sylvain Munaut, Andreas Eversberg, Daniel Willmann,
Jan Luebbe and a few others. None of this would have been possible if
it wasn't for all the help we got from Dieter Spaar with the BS-11 [2].
We all had our dayjob in other places, and OpenBSC work was really
just a hobby. People were working on it, because it was where no
FOSS hacker has gone before. It was cool. It was a big and pleasant
challenge to enter the closed telecom space as pure autodidacts.
Holger and I were doing freelance contract development work on Open
Source projects for many years before. I was mostly doing Linux related
contracting, while Holger has been active in all kinds of areas
throughout the FOSS software stack.
In 2010, Holger and I saw some first interest by companies into OpenBSC,
including Netzing AG and On-Waves ehf. So we were able to spend at
least some of our paid time on OpenBSC/Osmocom related contract work,
and were thus able to do less other work. We also continued to spend
tons of spare time in bringing Osmocom forward. Also, the amount of
contract work we did was only a fraction of the many more hours of spare
time.
In 2011, Holger and I decided to start the company sysmocom in order to generate more funding for the
Osmocom GSM projects by means of financing software development by
product sales. So rather than doing freelance work for companies who
bought their BTS hardware from other places (and spent huge amounts of
cash on that), we decided that we wanted to be a full solution
supplier, who can offer a complete product based on all hardware and
software required to run small GSM networks.
The only problem is: We still needed an actual BTS for that. Through
some reverse engineering of existing products we figured out who one of
the ODM suppliers for the hardware + PHY layer was, and decided to
develop the OsmoBTS software to
do so. We inherited some of the early code from work done by Andreas
Eversberg on the jolly/bts branch of OsmocomBB (thanks), but much was
missing at the time.
What follows was Holger and me working several years for free [3], without
any salary, in order to complete the OsmoBTS software, build an embedded
Linux distribution around it based on OE/poky, write documentation, etc.
and complete the first sysmocom product: The
sysmoBTS 1002
We did that not because we want to get rich, or because we want to run a
business. We did it simply because we saw an opportunity to generate
funding for the Osmocom projects and make them more sustainable and
successful. And because we believe there is a big, gaping, huge vacuum
in terms of absence of FOSS in the cellular telecom sphere.
Funding by means of sysmocom product sales
Once we started to sell the sysmoBTS products, we were able to fund
Osmocom related development from the profits made on hardware /
full-system product sales. Every single unit sold made a big
contribution towards funding both the maintenance as well as the ongoing
development on new features.
This source of funding continues to be an important factor today.
Funding by means of R&D contracts
The probably best and most welcome method of funding Osmocom related
work is by means of R&D projects in which a customer funds our work to
extend the Osmocom GSM stack in one particular area where he has a
particular need that the existing code cannot fulfill yet.
This kind of project is the ideal match, as it shows where the true
strength of FOSS is: Each of those customers did not have to fund the
development of a GSM stack from scratch. Rather, they only had to fund
those bits that were missing for their particular application.
Our reference for this is and has been On-Waves, who have been funding
development of their required features (and bug fixing etc.) since 2010.
We've of course had many other projects from a variety of customers over
over the years. Last, but not least, we had a customer who willingly
co-funded (together with funds from NLnet foundation and lots of unpaid
effort by sysmocom) the 3G/3.5G support in the Osmocom stack.
The problem here is:
we have not been able to secure anywhere nearly as many of those R&D
projects within the cellular industry, despite believing we have a
very good foundation upon which we can built. I've been writing many
exciting technical project proposals
you almost exclusively get funding only for new features. But it's
very hard to get funding for the core maintenance work. The
bug-fixing, code review, code refactoring, testing, etc.
So as a result, the profit margin you have on selling R&D projects is
basically used to (do a bad job of) fund those bits and pieces that
nobody wants to pay for.
Funding by means of customer support
There is a way to generate funding for development by providing support
services. We've had some success with this, but primarily alongside the
actual hardware/system sales - not so much in terms of pure
software-only support.
Also, providing support services from a R&D company means:
either you distract your developers by handling support inquiries.
This means they will have less time to work on actual code, and likely
get side tracked by too many issues that make it hard to focus
or you have to hire separate support staff. This of course means that
the size of the support business has to be sufficiently large to not
only cover the cots of hiring + training support staff, but also still
generate funding for the actual software R&D.
We've tried shortly with the second option, but fallen back to the first
for now. There's simply not sufficient user/admin type support business
to rectify dedicated staff for that.
Funding by means of cross-subsizing from other business areas
sysmocom also started to do some non-Osmocom projects in order to
generate revenue that we can feed again into Osmocom projects. I'm not
at liberty to discuss them in detail, but basically we've been doing
pretty much anything from
custom embedded Linux board designs
M2M devices with GSM modems
consulting gigs
public tendered research projects
Profits from all those areas went again into Osmocom development.
Last, but not least, we also operate the sysmocom webshop. The profit we make on those products
also is again immediately re-invested into Osmocom development.
Funding by grants
We've had some success in securing funding from NLnet Foundation for specific features. While this is useful, the
size of their projects grants of up to EUR 30k is not a good fit for the
scale of the tasks we have at hand inside Osmocom. You may think that's
a considerable amount of money? Well, that translates to 2-3 man-months
of work at a bare cost-covering rate. At a team size of 6 developers,
you would theoretically have churned through that in two weeks. Also,
their focus is (understandably) on Internet and IT security, and not so
much cellular communications.
There are of course other options for grants, such as government
research grants and the like. However, they require long-term planning,
they require you to match (i.e. pay yourself) a significant portion,
and basically mandate that you hire one extra person for doing all the
required paperwork and reporting. So all in all, not a particularly
attractive option for a very small company consisting of die hard engineers.
Funding by more BTS ports
At sysmocom, we've been doing some ports of the OsmoBTS + OsmoPCU
software to other hardware, and supporting those other BTS vendors with
porting, R&D and support services.
If sysmocom was a classic BTS vendor, we would not help our
"competition". However, we are not. sysmocom exists to help Osmocom,
and we strongly believe in open systems and architectures, without a
single point of failure, a single supplier for any component or any type
of vendor lock-in.
So we happily help third parties to get Osmocom running on their
hardware, either with a proprietary PHY or with OsmoTRX.
However, we expect that those BTS vendors also understand their
responsibility to share the development and maintenance effort of the
stack. Preferably by dedicating some of their own staff to work in
the Osmocom community. Alternatively, sysmocom can perform that work as
paid service. But that's a double-edged sword: We don't want to be a
single point of failure.
Osmocom funding outside of sysmocom
Osmocom is of course more than sysmocom. Even for the cellular
infrastructure projects inside Osmocom is true: They are true,
community-based, open, collaborative development projects. Anyone can
contribute.
Over the years, there have been code contributions by e.g.
Fairwaves. They, too, build GSM base station hardware and use that as a
means to not only recover the R&D on the hardware, but also to
contribute to Osmocom. At some point a few years ago, there was a lot
of work from them in the area of OsmoTRX, OsmoBTS and OsmoPCU.
Unfortunately, in more recent years, they have not been able to keep up
the level of contributions.
There are other companies engaged in activities with and around Osmcoom.
There's Rhizomatica, an NGO helping
indigenous communities to run their own cellular networks. They have
been funding some of our efforts, but being an NGO helping rural regions
in developing countries, they of course also don't have the deep
pockets. Ideally, we'd want to be the ones contributing to them, not
the other way around.
State of funding
We're making some progress in securing funding from players we cannot
name [4] during recent years. We're also making occasional progress in
convincing BTS suppliers to chip in their share. Unfortunately there
are more who don't live up to their responsibility than those who do.
I might start calling them out by name one day. The wider community and
the public actually deserves to know who plays by FOSS rules and who
doesn't. That's not shaming, it's just stating bare facts.
Which brings us to:
sysmocom is in an office that's actually too small for the team,
equipment and stock. But we certainly cannot afford more space.
we cannot pay our employees what they could earn working at similar
positions in other companies. So working at sysmocom requires
dedication to the cause :)
Holger and I have invested way more time than we have ever paid us,
even more so considering the opportunity cost of what we would have
earned if we'd continued our freelance Open Source hacker path
we're [just barely] managing to pay for 6 developers dedicated to
Osmocom development on our payroll based on the various funding
sources indicated above
Nevertheless, I doubt that any such a small team has ever implemented an
end-to-end GSM/GPRS/EGPRS network from RAN to Core at
comparative feature set. My deepest respects to everyone involved. The
big task now is to make it sustainable.
Summary
So as you can see, there's quite a bit of funding around. However, it
always falls short of what's needed to implement all parts properly, and
even not quite sufficient to keep maintaining the status quo in a proper
and tested way. That can often be frustrating (mostly to us but
sometimes also to users who run into regressions and oter bugs).
There's so much more potential. So many things we wanted to add or
clean up for a long time, but too little people interested in joining
in, helping out - financially or by writing code.
On thing that is often a challenge when dealing with traditional
customers: We are not developing a product and then selling a ready-made
product. In fact, in FOSS this would be more or less suicidal: We'd
have to invest man-years upfront, but then once it is finished, everyone
can use it without having to partake in that investment.
So instead, the FOSS model requires the customers/users to chip in
early during the R&D phase, in order to then subsequently harvest the
fruits of that.
I think the lack of a FOSS mindset across the cellular / telecom
industry is the biggest constraining factor here. I've seen that some
20-15 years ago in the Linux world. Trust me, it takes a lot of
dedication to the cause to endure this lack of comprehension so many
years later.
[1]
just like Linux has started out.
[2]
while you will not find a lot of commits from Dieter in the code, he has been playing a key role in doing a lot of prototyping, reverse engineering and debugging!
[3]
sysmocom is 100% privately held by Holger and me, we intentionally have no external investors and are proud to never had to take a bank loan. So all we could invest was our own money and, most of all, time.
[4]
contrary to the FOSS world, a lot of aspects are confidential in business, and we're not at liberty to disclose the identities of all our customers
[Less]
|
Posted
about 8 years
ago
The lack of basic FOSS understanding in Telecom
Given that the Free and Open Source movement has been around at least
since the 1980ies, it puzzles me that people still seem to have such
fundamental misconceptions about it.
Something that really
... [More]
triggered me was an article at LightReading [1]
which quotes Ulf Ewaldsson, a leading Ericsson excecutive with
"I have yet to understand why we would open source something we think is
really good software"
This completely misses the point. FOSS is not about making a charity
donation of a finished product to the planet.
FOSS is about sharing the development costs among multiple players, and
avoiding that everyone has to reimplement the wheel.
Macro-Economically, it is complete and utter nonsense that each 3GPP
specification gets implemented two dozens of times, by at least a dozen
of different entities. As a result, products are way more expensive
than needed.
If large Telco players (whether operators or equipment manufacturers)
were to collaboratively develop code just as much as they
collaboratively develop the protocol specifications, there would be no
need for replicating all of this work.
As a result, everyone could produce cellular network elements at reduced
cost, sharing the R&D expenses, and competing in key areas, such as who
can come up with the most energy-efficient implementation, or can
produce the most reliable hardware, the best receiver sensitivity, the
best and most fair scheduling implementation, or whatever else. But
some 80% of the code could probably be shared, as e.g. encoding and
decoding messages according to a given publicly released 3GPP
specification document is not where those equipment suppliers actually
compete.
So my dear cellular operator executives: Next time you're cursing about
the prohibitively expensive pricing that your equipment suppliers quote
you: You only have to pay that much because everyone is reimplementing
the wheel over and over again.
Equally, my dear cellular infrastructure suppliers: You are all dying
one by one, as it's hard to develop everything from scratch. Over the
years, many of you have died. One wonders, if we might still have more
players left, if some of you had started to cooperate in developing FOSS
at least in those areas where you're not competing. You could replicate
what Linux is doing in the operating system market. There's no need in
having a phalanx of different proprietary flavors of Unix-like OSs. It's
way too expansive, and it's not an area in which most companies need to
or want to compete anyway.
Management Summary
You don't first develop and entire product until it is finished and
then release it as open source. This makes little economic sense in
a lot of cases, as you've already invested into developing 100% of it.
Instead, you actually develop a new product collaboratively as FOSS in
order to not have to invest 100% but maybe only 30% or even less. You
get a multitude of your R&D investment back, because you're not only
getting your own code, but all the other code that other community
members implemented. You of course also get other benefits, such as
peer review of the code, more ideas (not all bright people work inside
one given company), etc.
[1]
that article is actually a heavily opinionated post by somebody
who appears to be pushing his own anti-FOSS agenda for some time. The
author is misinformed about the fact that the TIP has always included
projects under both FRAND and FOSS terms. As a TIP member I can
attest to that fact. I'm only referencing it here for the purpose of
that that Ericsson quote.
[Less]
|
Posted
about 8 years
ago
Chapter 0: Problem Statement
In an all-IP GSM network, where we use Abis, A and other interfaces
within the cellular network over IP transport, the audio of voice calls
is transported inside RTP frames. The codec payload in those RTP frames
is the
... [More]
actual codec frame of the respective cellular voice codec. In
GSM, there are four relevant codecs: FR, HR, EFR and AMR.
Every so often during the (meanwhile many years of ) development of
Osmocom cellular infrastructure software it would have been useful to be
able to quickly play back the audio for analysis of given issues.
However, until now we didn't have that capability. The reason is
relatively simple: In Osmocom, we genally don't do transcoding but
simply pass the voice codec frames from left to right. They're only
transcoded inside the phones or inside some external media gateway (in
case of larger networks).
Chapter 1: GSM Audio Pocket Knife
Back in 2010, when we were very actively working on OsmocomBB, the
telephone-side GSM protocol stack implementation, Sylvain Munaut wrote
the GSM Audio Pocket Knife (gapk) in order to be able to
convert between different formats (representations) of codec frames. In
cellular communcations, everyoe is coming up with their own
representation for the codec frames: The way they look on E1 as a TRAU
frame is completely different from how RTP payload looks like, or what
the TI Calypso DSP uses internally, or what a GSM Tester like the Racal
61x3 uses. The differences are mostly about data types used,
bit-endinanness as well as padding and headers. And of course those
different formats exist for each of the four codecs :/
In 2013 I first added simplistic RTP support for FR-GSM to gapk,
which was sufficient for my debugging needs back then. Still, you had
to save the decoded PCM output to a file and play that back, or use a
pipe into aplay.
Last week, I picked up this subject again and added a long series of
patches to gapk:
support for variable-length codec frames (required for AMR support)
support for AMR codec encode/decode using libopencore-amrnb
support of all known RTP payload formats for all four codecs
support for direct live playback to a sound card via ALSA
All of the above can now be combined to make GAPK bind to a specified
UDP port and play back the RTP codec frames that anyone sends to that
port using a command like this:
$ gapk -I 0.0.0.0/30000 -f rtp-amr -A default -g rawpcm-s16le
I've also merged a chance to OsmoBSC/OsmoNITB which allows the
administrator to re-direct the voice of any active voice channel towards
a user-specified IP address and port. Using that you can simply
disconnect the voice stream from its normal destination and play
back the audio via your sound card.
Chapter 2: Bugs in OsmoBTS GSM-HR
While going through the exercise of implementing the above extension to
gapk, I had lots of trouble to get it to work for GSM-HR.
After some more digging, it seems there are two conflicting
specification on how to format the RTP payload for half-rate GSM:
ETSI TS 101 318 from 1998
IETF RFC 5993 from 2010
In Osmocom, we claim to implement RFC5993, but it turned out that (at
least) osmo-bts-sysmo (for sysmoBTS) was actually implementing the
ETSI format instead.
And even worse, osmo-bts-sysmo gets event the ETSI format wrong. Each
of the codec parameters (which are unaligned bit-fields) are in the
wrong bit-endianness :(
Both the above were coincidentially also discovered by Sylvain Munaut
during operating of the 32C3 GSM network in December 2015 and resulted
the two following "work around" patches:
* HACK for HR
* HACK: Fix the bit order in HR frames
Those merely worked around those issues in the rtp_proxy of OsmoNITB,
rather than addressing the real issue. That's ok, they were "quick"
hacks to get something working at all during a four-day conference. I'm
now working on "real" fixes in osmo-bts-sysmo. The devil is of course
in the details, when people upgrade one BTS but not the other and want
to inter-operate, ...
It yet remains to be investigated how osmo-bts-trx and other osmo-bts
ports behave in this regard.
Chapter 3: Conclusions
Most definitely it is once again a very clear sign that more testing is
required. It's tricky to see even wih osmo-gsm-tester, as GSM-HR
works between two phones or even two instances of osmo-bts-sysmo, as
both sides of the implementation have the same (wrong) understanding of
the spec.
Given that we can only catch this kind of bug together with the hardware
(the DSP runs the PHY code), pure unit tests wouldn't catch it. And the
end-to-end test is also not very well suited to it. It seems to call
for something in betewen. Something like an A-bis interface level test.
We need more (automatic) testing. I cannot say that often enough. The
big challenge is how to convince contributors and customers that they
should invest their time and money there, rather than
yet-another (not automatically tested) feature?
[Less]
|
Posted
about 8 years
ago
Ever since the original iPhone came out, I’ve had several ideas about how they managed to achieve such fluidity with relatively mediocre hardware. I mean, it was good at the time, but Android still struggles on hardware that makes that look like a
... [More]
486… It’s absolutely my fault that none of these have been implemented in any open-source framework I’m aware of, so instead of sitting on these ideas and trotting them out at the pub every few months as we reminisce over what could have been, I’m writing about them here. I’m hoping that either someone takes them and runs with them, or that they get thoroughly debunked and I’m made to look like an idiot. The third option is of course that they’re ignored, which I think would be a shame, but given I’ve not managed to get the opportunity to implement them over the last decade, that would hardly be surprising. I feel I should clarify that these aren’t all my ideas, but include a mix of observation of and conjecture about contemporary software. This somewhat follows on from the post I made 6 years ago(!) So let’s begin.
1. No main-thread UI
The UI should always be able to start drawing when necessary. As careful as you may be, it’s practically impossible to write software that will remain perfectly fluid when the UI can be blocked by arbitrary processing. This seems like an obvious one to me, but I suppose the problem is that legacy makes it very difficult to adopt this at a later date. That said, difficult but not impossible. All the major web browsers have adopted this policy, with caveats here and there. The trick is to switch from the idea of ‘painting’ to the idea of ‘assembling’ and then using a compositor to do the painting. Easier said than done of course, most frameworks include the ability to extend painting in a way that would make it impossible to switch to a different thread without breaking things. But as long as it’s possible to block UI, it will inevitably happen.
2. Contextually-aware compositor
This follows on from the first point; what’s the use of having non-blocking UI if it can’t respond? Input needs to be handled away from the main thread also, and the compositor (or whatever you want to call the thread that is handling painting) needs to have enough context available that the first response to user input doesn’t need to travel to the main thread. Things like hover states, active states, animations, pinch-to-zoom and scrolling all need to be initiated without interaction on the main thread. Of course, main thread interaction will likely eventually be required to update the view, but that initial response needs to be able to happen without it. This is another seemingly obvious one – how can you guarantee a response rate unless you have a thread dedicated to responding within that time? Most browsers are doing this, but not going far enough in my opinion. Scrolling and zooming are often catered for, but not hover/active states, or initialising animations (note; initialising animations. Once they’ve been initialised, they are indeed run on the compositor, usually).
3. Memory bandwidth budget
This is one of the less obvious ideas and something I’ve really wanted to have a go at implementing, but never had the opportunity. A problem I saw a lot while working on the platform for both Firefox for Android and FirefoxOS is that given the work-load of a web browser (which is not entirely dissimilar to the work-load of any information-heavy UI), it was very easy to saturate memory bandwidth. And once you saturate memory bandwidth, you end up having to block somewhere, and painting gets delayed. We’re assuming UI updates are asynchronous (because of course – otherwise we’re blocking on the main thread). I suggest that it’s worth tracking frame time, and only allowing large asynchronous transfers (e.g. texture upload, scaling, format transforms) to take a certain amount of time. After that time has expired, it should wait on the next frame to be composited before resuming (assuming there is a composite scheduled). If the composited frame was delayed to the point that it skipped a frame compared to the last unladen composite, the amount of time dedicated to transfers should be reduced, or the transfer should be delayed until some arbitrary time (i.e. it should only be considered ok to skip a frame every X ms).
It’s interesting that you can see something very similar to this happening in early versions of iOS (I don’t know if it still happens or not) – when scrolling long lists with images that load in dynamically, none of the images will load while the list is animating. The user response was paramount, to the point that it was considered more important to present consistent response than it was to present complete UI. This priority, I think, is a lot of the reason the iPhone feels ‘magic’ and Android phones felt like junk up until around 4.0 (where it’s better, but still not as good as iOS).
4. Level-of-detail
This is something that I did get to partially implement while working on Firefox for Android, though I didn’t do such a great job of it so its current implementation is heavily compromised from how I wanted it to work. This is another idea stolen from game development. There will be times, during certain interactions, where processing time will be necessarily limited. Quite often though, during these times, a user’s view of the UI will be compromised in some fashion. It’s important to understand that you don’t always need to present the full-detail view of a UI. In Firefox for Android, this took the form that when scrolling fast enough that rendering couldn’t keep up, we would render at half the resolution. This let us render more, and faster, giving the impression of a consistent UI even when the hardware wasn’t quite capable of it. I notice Microsoft doing similar things since Windows 8; notice how the quality of image scaling reduces markedly while scrolling or animations are in progress. This idea is very implementation-specific. What can be dropped and what you want to drop will differ between platforms, form-factors, hardware, etc. Generally though, some things you can consider dropping: Sub-pixel anti-aliasing, high-quality image scaling, render resolution, colour-depth, animations. You may also want to consider showing partial UI if you know that it will very quickly be updated. The Android web-browser during the Honeycomb years did this, and I attempted (with limited success, because it’s hard…) to do this with Firefox for Android many years ago.
Pitfalls
I think it’s easy to read ideas like this and think it boils down to “do everything asynchronously”. Unfortunately, if you take a naïve approach to that, you just end up with something that can be inexplicably slow sometimes and the only way to fix it is via profiling and micro-optimisations. It’s very hard to guarantee a consistent experience if you don’t manage when things happen. Yes, do everything asynchronously, but make sure you do your book-keeping and you manage when it’s done. It’s not only about splitting work up, it’s about making sure it’s done when it’s smart to do so.
You also need to be careful about how you measure these improvements, and to be aware that sometimes results in synthetic tests will even correlate to the opposite of the experience you want. A great example of this, in my opinion, is page-load speed on desktop browsers. All the major desktop browsers concentrate on prioritising the I/O and computation required to get the page to 100%. For heavy desktop sites, however, this means the browser is often very clunky to use while pages are loading (yes, even with out-of-process tabs – see the point about bandwidth above). I highlight this specifically on desktop, because you’re quite likely to not only be browsing much heavier sites that trigger this behaviour, but also to have multiple tabs open. So as soon as you load a couple of heavy sites, your entire browsing experience is compromised. I wouldn’t mind the site taking a little longer to load if it didn’t make the whole browser chug while doing so.
Don’t lose sight of your goals. Don’t compromise. Things might take longer to complete, deadlines might be missed… But polish can’t be overrated. Polish is what people feel and what they remember, and the lack of it can have a devastating effect on someone’s perception. It’s not always conscious or obvious either, even when you’re the developer. Ask yourself “Am I fully satisfied with this” before marking something as complete. You might still be able to ship if the answer is “No”, but make sure you don’t lose sight of that and make sure it gets the priority it deserves.
One last point I’ll make; I think to really execute on all of this, it requires buy-in from everyone. Not just engineers, not just engineers and managers, but visual designers, user experience, leadership… Everyone. It’s too easy to do a job that’s good enough and it’s too much responsibility to put it all on one person’s shoulders. You really need to be on the ball to produce the kind of software that Apple does almost routinely, but as much as they’d say otherwise, it isn’t magic. [Less]
|
Posted
about 8 years
ago
Ever since the original iPhone came out, I’ve had several ideas about how they managed to achieve such fluidity with relatively mediocre hardware. I mean, it was good at the time, but Android still struggles on hardware that makes that look like a
... [More]
486… It’s absolutely my fault that none of these have been implemented in any open-source framework I’m aware of, so instead of sitting on these ideas and trotting them out at the pub every few months as we reminisce over what could have been, I’m writing about them here. I’m hoping that either someone takes them and runs with them, or that they get thoroughly debunked and I’m made to look like an idiot. The third option is of course that they’re ignored, which I think would be a shame, but given I’ve not managed to get the opportunity to implement them over the last decade, that would hardly be surprising. I feel I should clarify that these aren’t all my ideas, but include a mix of observation of and conjecture about contemporary software. This somewhat follows on from the post I made 6 years ago(!) So let’s begin.
1. No main-thread UI
The UI should always be able to start drawing when necessary. As careful as you may be, it’s practically impossible to write software that will remain perfectly fluid when the UI can be blocked by arbitrary processing. This seems like an obvious one to me, but I suppose the problem is that legacy makes it very difficult to adopt this at a later date. That said, difficult but not impossible. All the major web browsers have adopted this policy, with caveats here and there. The trick is to switch from the idea of ‘painting’ to the idea of ‘assembling’ and then using a compositor to do the painting. Easier said than done of course, most frameworks include the ability to extend painting in a way that would make it impossible to switch to a different thread without breaking things. But as long as it’s possible to block UI, it will inevitably happen.
2. Contextually-aware compositor
This follows on from the first point; what’s the use of having non-blocking UI if it can’t respond? Input needs to be handled away from the main thread also, and the compositor (or whatever you want to call the thread that is handling painting) needs to have enough context available that the first response to user input doesn’t need to travel to the main thread. Things like hover states, active states, animations, pinch-to-zoom and scrolling all need to be initiated without interaction on the main thread. Of course, main thread interaction will likely eventually be required to update the view, but that initial response needs to be able to happen without it. This is another seemingly obvious one – how can you guarantee a response rate unless you have a thread dedicated to responding within that time? Most browsers are doing this, but not going far enough in my opinion. Scrolling and zooming are often catered for, but not hover/active states, or initialising animations (note; initialising animations. Once they’ve been initialised, they are indeed run on the compositor, usually).
3. Memory bandwidth budget
This is one of the less obvious ideas and something I’ve really wanted to have a go at implementing, but never had the opportunity. A problem I saw a lot while working on the platform for both Firefox for Android and FirefoxOS is that given the work-load of a web browser (which is not entirely dissimilar to the work-load of any information-heavy UI), it was very easy to saturate memory bandwidth. And once you saturate memory bandwidth, you end up having to block somewhere, and painting gets delayed. We’re assuming UI updates are asynchronous (because of course – otherwise we’re blocking on the main thread). I suggest that it’s worth tracking frame time, and only allowing large asynchronous transfers (e.g. texture upload, scaling, format transforms) to take a certain amount of time. After that time has expired, it should wait on the next frame to be composited before resuming (assuming there is a composite scheduled). If the composited frame was delayed to the point that it skipped a frame compared to the last unladen composite, the amount of time dedicated to transfers should be reduced, or the transfer should be delayed until some arbitrary time (i.e. it should only be considered ok to skip a frame every X ms).
It’s interesting that you can see something very similar to this happening in early versions of iOS (I don’t know if it still happens or not) – when scrolling long lists with images that load in dynamically, none of the images will load while the list is animating. The user response was paramount, to the point that it was considered more important to present consistent response than it was to present complete UI. This priority, I think, is a lot of the reason the iPhone feels ‘magic’ and Android phones felt like junk up until around 4.0 (where it’s better, but still not as good as iOS).
4. Level-of-detail
This is something that I did get to partially implement while working on Firefox for Android, though I didn’t do such a great job of it so its current implementation is heavily compromised from how I wanted it to work. This is another idea stolen from game development. There will be times, during certain interactions, where processing time will be necessarily limited. Quite often though, during these times, a user’s view of the UI will be compromised in some fashion. It’s important to understand that you don’t always need to present the full-detail view of a UI. In Firefox for Android, this took the form that when scrolling fast enough that rendering couldn’t keep up, we would render at half the resolution. This let us render more, and faster, giving the impression of a consistent UI even when the hardware wasn’t quite capable of it. I notice Microsoft doing similar things since Windows 8; notice how the quality of image scaling reduces markedly while scrolling or animations are in progress. This idea is very implementation-specific. What can be dropped and what you want to drop will differ between platforms, form-factors, hardware, etc. Generally though, some things you can consider dropping: Sub-pixel anti-aliasing, high-quality image scaling, render resolution, colour-depth, animations. You may also want to consider showing partial UI if you know that it will very quickly be updated. The Android web-browser during the Honeycomb years did this, and I attempted (with limited success, because it’s hard…) to do this with Firefox for Android many years ago.
Pitfalls
I think it’s easy to read ideas like this and think it boils down to “do everything asynchronously”. Unfortunately, if you take a naïve approach to that, you just end up with something that can be inexplicably slow sometimes and the only way to fix it is via profiling and micro-optimisations. It’s very hard to guarantee a consistent experience if you don’t manage when things happen. Yes, do everything asynchronously, but make sure you do your book-keeping and you manage when it’s done. It’s not only about splitting work up, it’s about making sure it’s done when it’s smart to do so.
You also need to be careful about how you measure these improvements, and to be aware that sometimes results in synthetic tests will even correlate to the opposite of the experience you want. A great example of this, in my opinion, is page-load speed on desktop browsers. All the major desktop browsers concentrate on prioritising the I/O and computation required to get the page to 100%. For heavy desktop sites, however, this means the browser is often very clunky to use while pages are loading (yes, even with out-of-process tabs – see the point about bandwidth above). I highlight this specifically on desktop, because you’re quite likely to not only be browsing much heavier sites that trigger this behaviour, but also to have multiple tabs open. So as soon as you load a couple of heavy sites, your entire browsing experience is compromised. I wouldn’t mind the site taking a little longer to load if it didn’t make the whole browser chug while doing so.
Don’t lose sight of your goals. Don’t compromise. Things might take longer to complete, deadlines might be missed… But polish can’t be overrated. Polish is what people feel and what they remember, and the lack of it can have a devastating effect on someone’s perception. It’s not always conscious or obvious either, even when you’re the developer. Ask yourself “Am I fully satisfied with this” before marking something as complete. You might still be able to ship if the answer is “No”, but make sure you don’t lose sight of that and make sure it gets the priority it deserves.
One last point I’ll make; I think to really execute on all of this, it requires buy-in from everyone. Not just engineers, not just engineers and managers, but visual designers, user experience, leadership… Everyone. It’s too easy to do a job that’s good enough and it’s too much responsibility to put it all on one person’s shoulders. You really need to be on the ball to produce the kind of software that Apple does almost routinely, but as much as they’d say otherwise, it isn’t magic. [Less]
|