Fix FaceTime HD camera flickering on M1 MacBook Pro

Since recently I’m proudly using the new 16” M1Pro MBP. While I’m enjoying its performance and quiteness in comparison to the MBP 2019, one thing is annoying: In video calls the integrated FaceTime HD camera provides a flickering picture. So this is bothering me each single day, and I looked how to fix this.

TLDR;

This is a known issue with the new Macs, and unfortunately there is no solution with current macOS for it. I found this workaround, and it fixes the issue also for me:

  1. Install OBS Studio
  2. Add Video Capture Device => Create New
  3. Choose Device: Facetime HD Camera
  4. Unselect “Use Preset”
  5. Set Frame Rate: 25 FPS

The flickering stops! However, it requires that you open OBS Studio once you start a video call. For me the frame rate is also OK when I close OBS then once a call has started.

The Frame Rate Problem

The default frame rate of the build in camera seems to be 30 fps, and in PAL countries 25 fps is used. The 30fps seems to cause the flickering. So the build in camera needs to change its frame rate. However, there is no way to configure this setting in macOS by default.

Why OBS?

Unfortunately it means I need to have a 300MB application just to change a device setting.

OBS Studio is a widely used software and available for free. With it, you can create a virtual device and adjust the frame rate. There are other applications in the app store that allow you to adjust the frame rate of input devices, but I prefer to use a free one here to apply the workaround.

What does OBS do to change the framerate?

I was interested if there is a hidden configuration switch in macOS to influence the default settings for the camera. So I wanted to know what OBS is doing under the hood.

Just for those who are interested, the main source here seems to be av-capure.mm. It uses the the AVCaptureDevice API, which allows to query and modify the settings of capture devices. I did not find traces to a preference that I could set via CLI.

I’m not skilled in programming native tools for macOS, but with this it should not be a big issue for someone skilled to provide a small utility that just takes the default camera and sets its frame rate to 25fps. When you know of such a (free/cheap) utility, give me a link here.

Since this is a common problem I hope that Apple will just provide a fix in a future macOS version.

Replace U+00a0 (nbsp) (or other unicode) characters with VS Code

On my Mac I have the issue that when I type the pipe character | and then pressing space, often the non-break space character (unicode U+00a0) is inserted. If anyone knows how disable this “feature” drop me a note here, this is quite annoying but I did not found the reason for this behaviour.

This looks like normal space, but VS Code highlights these places. In this example, I’m working on asciidoc files where this happens quite frequently:

This is just a small tip to fix these files with the “Replace in Files” feature. Open this from the “Edit menu”, activate Use Regular Expression (.*) and search for the unicode character with regex [\xa0] and replace by space.

Suppressing Maven Download Messages with Maven Wrapper

When you are using Maven in a cloud based CI system, e.g. with GitHub Actions, you are starting often with an empty repository and download Maven build dependencies on each run. This will happen fast as the dependencies are downloaded from a mirror, and with the batch option “-B” you’ll get just 2 lines per dependency. But still you get hundreds of lines of such messages:

[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/3.0.0/maven-enforcer-plugin-3.0.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/3.0.0/maven-enforcer-plugin-3.0.0.pom (7.7 kB at 333 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/enforcer/enforcer/3.0.0/enforcer-3.0.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/enforcer/enforcer/3.0.0/enforcer-3.0.0.pom (8.7 kB at 334 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/34/maven-parent-34.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/34/maven-parent-34.pom (43 kB at 1.5 MB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom (18 kB at 635 kB/s)

This pollutes the build logs and usually does not provide benefit. So how to avoid this?

Download messages can be suppressed by reducing the log output of the Slf4jMavenTransferListener to warn level. This can be achieved by adding the system property

-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

Now this needs to be added to each call of Maven commands. You might have multiple in your build pipelines and want to avoid to pollute the build scripts with them.

Usually it is a good idea to use the Maven Wrapper in your project. This does not only allow to pin the Maven version. Additionally you can just add common JVM options to a file. Your mvnw command that is checked in into your repository contains this line:

MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"

So you can just create the file .mvn/jvm.config and add the logging configuration property there. Now just use ./mvnw in your build pipeline scripts and you don’t get the download messages anymore.

Eclipse Oomph: Suppress Welcome Page

I am frequently spawning Eclipse workspaces with Oomph setups and the first action I do when a new workspace is provisioned is to close Eclipse’s welcome page. So I wanted to suppress that for a current project setup. So I started searching where Eclipse stores the preference that disables the intro page. The location of that preference is within the workspace directory at

.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs

The content of the preference file is

eclipse.preferences.version=1
showIntro=false

So to make Oomph create the preference file before the workspace is started the first time use a Resource Creation task and set the Target URL

${workspace.location|uri}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs

Then put the above mentioned preference content as Content value.

Heading for new shores

It is still a bit unreal to me, but I have decided to leave itemis after almost 17 years. When itemis was founded back in 2003 as a spin-off from a different consulting company, I was one the first who followed the founders to itemis. I remember that at our first company christmas party with all colleagues including their partners we all fitted at one table in a tapas restaurant. Now itemis has around 200 employees and several dependencies across Germany, France, Switzerland and Tunesia. itemis was always a bit special in the landscape of consulting companies, with focus more on the people than profit. Over the time I have become a team lead of some very skilled and smart colleagues and had in the recent years the privilege to drive open source to a large degree of my regular work time. My daily ride to itemis HQ is less than 20 minutes. It was not unlikely that I would stay at itemis for my whole career. But now these days came to an end. You might wonder what’s the next step for me and why.

Bild von Youssef Jheir auf Pixabay

I always liked to work as a consultant for different customers of different branches and with different technologies. This way work is always challenging, there are many things to learn and you get to know many highly skilled and smart people, both at itemis and at our customers. And why should look for companies at other locations when I feel comfortable in my home town, where my family belongs?

But when looking at consulting companies, most of them seem to me far less attractive than what I’m used from itemis. I don’t like to think about optimizing salery, I love to think about technology and using them to build solutions first. I like to work with smart people, and itemis used to be a melting pot for people searching for the freedom to become experts in their field.

Quo vadis?

I have decided to join Karakun. You may not know them yet. Even here at itemis they were not known, although they work in a similar area, with an office nearby and with partially the same customers. Karakun was founded 2 years ago as a spin-off from Canoo, a swiss consulting company that some more people may know. Canoo was a successful company with smart and experienced people, and the core team decided to create a new company. With the new company there is now a high density of excellent and experienced software engineers. The head quarter is based in Basel / Switzerland, but there is an office in Dortmund. And just 5 km away from my home. OK, distance to home was not a main driver for my decision for them. However, I’m planning to drive with the bike to the office and come along with just one car for our family now. At itemis I had a company car, this was really great comfort which I now have to give up. Let’s see how long I can live without my own car.

What made me think about this change?

Bild von Alexas_Fotos auf Pixabay

When I applied at Karakun for the new job (I actively approached them, I dislike recruiters!) and also when I announced my quitting at itemis the first question was of course: Why are you doing this? I used then this metaphor: It is like I married my girl friend from school, got children with her, raised them and they are mature now. Of course I love her, but maybe you recognize that each others lifes are heading slightly to different directions. In the past you had the same interests and accepted everything your partner did. Over the years both feel certain aspects more disturbing and sometimes you have argues. You may live with that and come along mostly fine with each other. And maybe you start thinking if a different partner would now better fit to you.

I’m now 46 and work for 20 years as a consultant. Until the end of my career there are also 20 years to go. So I’m now half-way. As said I always enjoyed to craft software, and would like to code further. Now I still feel fresh enough to learn to use new technologies and produce code each day. This may change later, but now it feels the right time to be open for complete new things.

I expect to learn lots of new things from my new colleagues, and I hope that my colleagues can also learn from me. I think all can benefit from each other and I have a company small enough that it feels like a large family. This is what I was used from itemis, but over the years due to the growing company size and portfolio it became harder to have a focus. In the past itemis was the company known for model based software engineering and the drivers of technologies in this area, and still is. However, there are so many different areas where itemis is involved that it feels a bit unfocused. itemis is changing, and not always in synch with my ideals. This aggregated enough in the last year to think about my future and if I could imagine to work here the next decade.

How about my Open Source activities?

I was always a strong believer of open source development, and got involved into projects as much as I could. In the recent years I had the luck to work quite some time on Xtext. Additionally I was working on the Eclipse Platform project and tried to help the great Eclipse community with my contributions.

As a true open source developer work does not end with what you can do during the regular work. Most work on the Eclipse platform and also quite some on Xtext were done in my spare time. I was working on them as much as I could. Sometimes more, sometimes less. I love to see the software improving, and am happy when people actually use and like that. Xtext is a great framework, and was crafted by many smart colleagues. And from my work on the Eclipse platform I’m benefiting each day, as I still use Eclipse IDE for my daily work. The Eclipse platform is a huge project with many people involved from whom I learn each day. By reading their code and communicating with them through issue reports and on conferences. If someone wants to understand how a large scale true open source project works I recommend to get involved into Eclipse platform development!

Also Karakun is actively involved into open source development. My colleagues are driving forces behind OpenWebStart and are involved in a couple of open source projects. However, in different areas than me. What this means to me is as of today unclear. I’m not sure if I can continue to work on Xtext and Eclipse platform to a meaningful degree further. At least for the beginning I have to concentrate my work on my new tasks and degrade my activities to a hobby level. When I have more capacity to participate in open source development I will do this, but it may be on different technologies.

Of course this was a hard decision for me to potentially abandon “my babies”, but I had to. The Eclipse platform project is large enough. I’m just a small part of the great team there. For Xtext this is harder. In the recent years it was only itemis and Sebastian Zarnekow (independent, but until mid of last year he worked for itemis) that drove Xtext. My former colleagues from TypeFox have now other work areas and did not contribute to a meaningful degree anymore. With me dropping off there I see a risk that development of this great framework further slows down. I hope that companies using this framework finally see the importance to assure its maintenance by making maintenance contracts. itemis has invested a lot into this wonderful piece of technology, but when there is no money to earn with it, why should they continue to pay the maintenance cost on their own? I’d like to continue working on Xtext and help customers using it to build useful tools, but it will depend at Karakun if there is a business case for that. If not, I’ll have to move to different areas. It would be hard for me when I would be forced here at itemis to discontinue the work on these great projects, but with my move I have decided to be completely open for what is expecting me. I have made my peace with it.

What’s next?

This friday will be my last working day at itemis. I already gave a farewell party here last friday and made a BBQ for all colleagues at itemis HQ. Next week I’ll have a week off. At the end of the week itemis is giving again a BBQ. I’ll use that opportunity to finally say goodbye and return all belongings.

The first week in February I’ll drive to the Karakun HQ in Basel. There I’ll get to know many of my new colleagues and receive my new MacBookPro. I’ll use the opportunity to visit an old school friend who moved to that area.

In the second week I’ll start in the Karakun office Dortmund. I already know all colleagues there (we are only 4 then). One of them, Joel, already said that he likely won’t be there then. They are awaiting their first child. At the moment it is planned that I’ll work together with Simon there.

I’m ready to start the adventure now. Stay tuned!

Eclipse m2e: How to use a WORKSPACE Maven installation

Today a colleague of me asked me about the Maven Installations preference page in Eclipse. There is an entry WORKSPACE there, which is disabled and shows NOT AVAILABLE. He wanted to know how to enable a workspace installation of Maven.

Since we both did not find the documentation of the feature I digged into the m2e sources and found class MavenWorkspaceRuntime. The relevant snippets are the method getMavenDistribution() and the MAVEN_DISTRIBUTION constant:

private static final ArtifactKey MAVEN_DISTRIBUTION = new ArtifactKey(
      "org.apache.maven", "apache-maven", "[3.0,)", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

...

protected IMavenProjectFacade getMavenDistribution() {
  try {
    VersionRange range = VersionRange.createFromVersionSpec(getDistributionArtifactKey().getVersion());
    for(IMavenProjectFacade facade : projectManager.getProjects()) {
      ArtifactKey artifactKey = facade.getArtifactKey();
      if(getDistributionArtifactKey().getGroupId().equals(artifactKey.getGroupId()) //
          && getDistributionArtifactKey().getArtifactId().equals(artifactKey.getArtifactId())//
          && range.containsVersion(new DefaultArtifactVersion(artifactKey.getVersion()))) {
        return facade;
      }
    }
  } catch(InvalidVersionSpecificationException e) {
    // can't happen
  }
  return null;
}

From here you can see that m2e tries to look for workspace (Maven) projects and to find one the has the coordinates org.apache.maven:apache-maven:[3.0,).

So the answer how to enable a WORKSPACE Maven installation is: Import the project apache-maven into the workspace. And here is how to do it:

  1. Clone Apache Maven from https://github.com/apache/maven.git
  2. Optionally: check out a release tag
    git checkout maven-3.6.3
  3. Perform File / Import / Existing Maven Projects
  4. As Root Directory select the apache-maven subfolder in your Maven clone location

Now you will have the project that m2e searches for in your workspace:

And the Maven Installations preference page lets you now select this distribution:

Eclipse Tycho: Disable p2 dependency resolution with tycho.mode=maven

In Eclipse Tycho based builds the first step is always computation of the target platform and depedency resolution. This takes quite some time and in certain use cases it is not necessary. Typical use cases are updating versions with the tycho-versions-plugin, or displaying the effective pom with help:effective-pom.

The p2 target platform & dependency resolution can be skipped by setting the tycho-mode system property:

mvn -Dtycho.mode=maven <goals>

This useful feature is a bit hidden in just a few posts, e.g. https://www.eclipse.org/lists/tycho-user/msg06439.html.

Get the latest artifact version from Maven Central via shell command

If you need to retrieve the latest version of an artifact on Maven Central you can use the following shell command (example for groupId=org.apache.maven.plugins and artifactId=maven-compiler-plugin):

> curl -s http://search.maven.org/solrsearch/select?q=g:"org.apache.maven.plugins"+AND+a:"maven-compiler-plugin" |grep -Po 'latestVersion.:.\K[^"]*'
> 3.8.0

This will query the search API on search.maven.org for the given groupId and artifactId coordinates. The result from search.maven.org is in JSON format. We are only interested in the value of the ‘latestVersion‘ attribute, which is extracted with grep.

The ‘-s‘ option is for ‘Silent Mode’ to suppress download stats messages from curl and really only print the result from grep. Note that this option is not available on all systems (e.g. macOS).

 

Touring the Eclipse Photon DemoCamps – Next stop: Eindhoven, NL, July 4th!

Eclipse DemoCamps are a wonderful format to learn the hottest new stuff from all the bandwidth of Eclipse projects: Core IDE, IoT, Smart Home, Modeling, JakartaEE, MicroProfile, Tools and so on. It is also a great way to get in touch with creators, committers, influencers and users of these technologies.

For this DemoCamp season I am promoting the Eclipse Platform Project and thus the Eclipse Photon IDE. Eclipse Photon comes with a plethora of new features and improvements which are hard to compress into a DemoCamp format. Usually presentations in DemoCamps are just 20 minutes. Attendees should get an overview of multiple projects and interesting stuff with a wide range of topics. And since DemoCamps are in the evenings, attendees want to get entertained and not bored by long talks. The focus is on real demos, live coding and networking. I love to do that.

screenshot 178.png

My talk is named “Approaching Light Speed – News from the Eclipse Photon Platform“. I have given this talk already at EclipseCon France, at the DemoCamps in Zurich and Darmstadt, and internally at our itemis headquater before our yearly company wide party called itemis SummerCon. I have prepared quite a bunch of stuff to talk about. But different then usually, I do not perform live coding, but show coding with small screencasts in my presentation. For this talk I would have to switch too many between different code and workspaces, and comparisons to the previous version Eclipse Oxygen would make this even worse. It is just too confusing if I would switch so often. And would take much longer so I could present not that much.

At EclipseCon France I had 35 minutes for the talk, and even for that I had strip down the material I already had. The new supported Java versions 9 and 10 in JDT I could just scratch at surface level, although this is one of the real major things in Eclipse Photon. But platform improvements are that much that JDT has to be put into background. For a DemoCamp talk in 20 minutes challenges become bigger. However, in Zurich and Darmstadt I had only those 20 minutes and I thing I managed to give a smooth and interesting presentation. The attendees I spoke afterwards were impressed from all the great stuff that comes with the Eclipse Photon IDE and made them hungry to finally get Photon and use it for their work. Last week on June 27th it was finally time for the great release!

My next stop is now the DemoCamp in Eindhoven this Wednesday on July 4th 2018. This DemoCamp will be held at the office from Altran and is organized by my former colleague Niko Stotz. This will be the first Eclipse DemoCamp held in Eindhoven, and maybe the first in the Netherlands (I don’t remember if one was already in the Netherlands so far). I am interested how engaged the developer community in and around Eindhoven is and hope for Niko that many interested people are making their way to the event!

My colleague and friend Holger Schill will present the new and noteworthy features of the new Xtext 2.14 release that ships with Eclipse Photon. Last week we showed this in the webinar Eclipse Photon Series: What’s New in the Eclipse Xtext 2.14?, which got recored on YouTube. If you want the information given there in 60 minutes condensed, make sure to visit the DemoCamp! Further you will see the wonderful Mélanie Bats. She will present all the new features in Eclipse Sirius 6. Besides all the news from the modeling technologies Marc Hamilton is showing how they use the Eclipse Modeling technology stack (Xtext, Sirius, EMF and others) at Altran to build solutions with them.

So, my fellow software engineers & craftsmen in the Netherlands, register for the Eindhoven DemoCamp now and see you there!

Set Jenkins build display name with Groovy

On the Xtext’s Jenkins instance we have some parametrized jobs that are used for the different projects that are built on Jenkins (Xtext, Xpand, MWE). For example, the simrel-tests job does some health checks on the resulting p2 repositories.

The problem was that it was not obvious for which job name parameter the build was executed. On first sight you only see the build number, and then you have to look in each individual build to identify which parameter was used:

screenshot 15

With the help of a Groovy script using the Jenkins Groovy Plugin we can change the display name of a build:

build name changed

Also on the Dashboard page it becomes clear for which parameter the last build was run:

screenshot 17.png

To do this, add a build step “Execute system Groovy script” and access the job’s environment variables with build.properties.environment.toString(). Then set a new display name by assigning a new value to build.displayName. That’s all.

groovy command