Enabling camera and microphone in Chrome on M1

January 21st, 2022

After installing my new MacBook Pro M1, I had an issue where Google Chrome would ask me to give permission to a site for using a camera and microphone, but would then show them as inaccessible.

First level googling suggested going to System Preferences > Security & Privacy > Privacy > Camera and tick the box next to Google Chrome. Just one problem – Google Chrome was not listed and there doesn’t seem to be a way to add a program to that list manually.

Another hit suggested upgrading Chrome and macOS – both were upgraded already.

I googled some more and found this report of the same problem with comments closed and no answer.

I tried a bunch of things in Chrome and had no success – settings, other sites, disabling/enabling camera… nothing worked.

So I gave up and opened Safari to see if I can at least use the camera there. It worked out of the box, the camera and mic turned on and I was in the meeting. I then opened System Preferences and Safari is not listed there at all – I guess that’s what you get when you work in the same building as the OS guys. Went back to Chrome to see if it works now and Chrome asked me for permissions again – only this time, it also appeared in Privacy list, where I could now allow access to Camera and Microphone.

I had a feeling using Safari first might trigger this, but it was more of a Hail Mary then anything else really. The other option – removing Chrome with all the profiles and trying from scratch – did not sound appealing at all.

So now you know.

VMs on M1

December 27th, 2021

I have upgraded my laptop. It’s been a while (Mid 2014) and I felt like the new MacBook Pro is finally a computer I can use a while. It’s got an SD card slot, an HDMI port, MagSafe and enough USB ports (even though they are all USB-C). What I’m missing is an easy way to connect my old displayport screen, but I’ll fix that by upgrading that as well (it’s ~10 years old).

The machine is great – the screen, the silence even when under load, the fingerprint reader, I love it all. I have not had any issues with the apps due to it being Apple Silicon. What I have noticed is that some smaller utility apps I used have disappeared since I last did a fresh install – developers moved on, decided to not support the new platform or the new APIs. I have mostly1 found replacements, even if some are paid apps.

Reasoning

On my previous laptop I had all development stuff running directly on the Mac. This was a problem every time I upgraded the OS as random things would die and fixing them took a lot of time. So this time around I want to pack all my development stuff inside a linux VM that would then hold either code directly or docker containers.

My initial idea was to set up an x86_64 virtual machine, so that I could have an environment as close to what I normally use in production, but installing it in UTM took forever, so I abandoned that idea for now.

Software

Step one was setting up some virtual machines to test how that would work.

I have previously used VirtualBox, but they have not yet decided to support the M1, so what I found and tested was:

  1. UTM,
  2. Parallels Desktop for M1 and
  3. VMWare Fusion for Apple Silicon.

So I went about installing Ubuntu in all three environments. My source image was Ubuntu 20.04.3 LTS, the machines set up as arm with 8GB of RAM and 4 cores. In the case of UTM, the system is set to QEMU 5.0 ARM VM (virt-5.0)2 with CPU set to cortex-a72 and Force Multicore checked.

Shared directory

After installing I looked at how I can share a directory from the host inside the VM:

  1. UTM

    I haven’t figured it out yet as it wanted me to install something on my Mac, so I gave up (for now).

  2. Parallels Desktop

    Default instructions are to reboot and then mount a CD from which you install the relevant tools. This went well and the directories were shared under /media/psf.

  3. VMWare Fusion

    VMWare requires you to install vmware tools on linux and you should get the mount automatically, but I didn’t, so I hade to add the line to /etc/fstab manually. Going with fstab is nice, as you can mount the share anywhere you like.

Performance

With that solved, I did a quick test of speed inside the VMs. Nothing comprehensive, just a quick feeler to see what kind of performance I can expect. To do that I ran the following python code, output mimicking that of the ping command:

import statistics
import timeit

l = []
for i in range(10):
	l.append(timeit.timeit("hashlib.pbkdf2_hmac('sha256', b'password', b'salt', 100000)", "import hashlib", number=100) / 100 * 1000)

print("min/avg/max/stddev = {:.3f}/{:.3f}/{:.3f}/{:.3f} us".format(
	min(l),
	statistics.mean(l),
	max(l),
	statistics.pstdev(l)
))

Times:

  1. UTM

    min/avg/max/stddev = 15.442/15.479/15.510/0.018 us (python 3.8.10)

  2. Parallels Desktop

    min/avg/max/stddev = 14.582/14.659/14.809/0.077 us (python 3.8.10)

  3. VMWare Fusion3

    min/avg/max/stddev = 14.596/14.632/14.713/0.031 us (python 3.8.10)

  4. Host

    min/avg/max/stddev = 23.598/24.297/25.038/0.553 us (python 3.8.9)

  5. MacBook Pro (Mid 2014)

    min/avg/max/stddev = 308.944/316.638/326.198/4.993 us (python 3.5.2)

    min/avg/max/stddev = 64.027/64.870/66.026/0.658 us (python 3.8.8)

I have no idea why the VMs are faster than the host – my guess is the VMs are running on performance cores, so python also gets a performance core, while python on the host runs on the efficiency core. Haven’t yet figured out how to confirm this though.

Update: I added times from my old laptop. Oddly python 3.5 was way slower, while there is no difference in times between 3.5 and 3.8 on arm (tested on Parallels).

Result

I think UTM could be great especially with its low price (free online, 9.99€ on the App Store), but everything is a bit finicky. If you can use one of the images provided and you don’t need to set up directory sharing, it’s surely a good option.

I don’t yet have a preference between Parallels and Fusion – Fusion has better folder sharing approach but kidnaps the cursor, which is quite annoying. At the moment Fusion is free (full price for Fusion 12 Player is 135.53€ while Pro is 180.98€ in the Europe store at the moment), while Parallels is already a paid product (99.99€ one time or 79.99€ per year, 99.99€ per year for Pro). As far as I have read, VMWare does not intend to support anything that is not Arm, while Parallels already has that support, which might make me go that way.

Next up

Next things I want to figure out:

  • does running an x86_64 VM makes any sense?
  • is it possible to mount a VM HDD without running the VM?
  • set up PyCharm to work with this setup

If you’re interested in anything else, let me know.

  1. Anybody know of a replacement for PresenterMate? ^
  2. For some reason I could not make the install work on a higher version (5.1, 6.x) ^
  3. I initially thought Fusion was much slower, but I likely screwed something up when measuring ^

Sides of the story

September 17th, 2020

We live in a world in which technology has increased people’s ability to sell bullshit. But it has also increased our options to check information and decide on our own if we believe it. The trust we once had for information sources is mostly gone – I find myself quoting the source and explicitly stating that I am just relaying information and not endorsing it way more often than I did. Sadly the ability of assholes usually evolves faster than our own ability to call them on their bullshit.

So it is weird to me that we haven’t become more wary of what people we know tell us. One would think that in the age where we don’t adopt any conclusions without checking with multiple sources, we’d do the same when information is shared privately – and one would be wrong. In other words – the government is lying to us, the media is lying to us, but what we hear at the bar is all true.

I’ve recently tried to become less susceptible to these kinds of one sided stories and try to check the other side before creating an opinion. I’ve been called out on adopting other people’s opinions a few times in the past and I’m trying to be better at this. But this means work and a few additional variables with all information you store in your brain – source and reliability. So now whenever I hear something I try to check it before I store it memory – and if I can’t, I store it as a rumour with a low reliability score, just as I would when I hear something on the news.

Adopting this has made me more content with myself, but also made it harder to converse with people who refuse to question things they have been told.

Hazelnut spreads

September 4th, 2020

I recently had a chance to taste two Slovenian bio hazelnut spreads and wanted to record my notes for future reference. Both are basically the same – 60% hazelnuts with coconut sugar and cocoa as the only other 2 components. Both are also advertised as eco, vegan, lactose free (no.2 notes that means <0.1g lactose per 100g), gluten free and both are marked as handmade in Slovenia.

  1. Lešnikov namaz (Hazelnut spread)
    lesnikov-namaz-20chocolate
    Manufacturer:
    20 Chocolate
    Weight:
    200g
    Expires:
    23-10-2020
    Certification from:
    SI-EKO-003 (Bureau Veritas)
    Ingredients:
    hazelnuts, cocoa beans, coconut sugar
    Energy per 100g:
    2373kJ/572kcal
    Fat / saturated per 100g:
    43,1g / 5,4g
    Carbohydrate / sugars per 100g:
    29,2g / 27,4g
    Protein per 100g
    12,6g
    Salt per 100g
    0,16g
  2. Bio lešnikov namaz (Bio hazelnut spread)
    lesnikov-namaz-lizin-vrt
    Manufacturer:
    Lizin Vrt
    Weight:
    190g
    Expires:
    02-03-2021
    Certification from:
    SI-EKO-002 (IKC UM)
    Ingredients:
    hazelnut paste, cocoa paste, coconut sugar
    Energy per 100g:
    2560kJ/618kcal
    Fat / saturated per 100g:
    49,0g / 8,7g
    Carbohydrate / sugars per 100g:
    31,0g / 24g
    Protein per 100g
    9,42g
    Salt per 100g
    <0,01g

So even though they look the same based on the big claims on the container, they are quite dissimilar with the second one using more fat (8,7g vs 5,4g) and less sugar (24g vs 27,4g) resulting in higher energy value. I’m also a bit annoyed that it is 10g lighter even though it seems it’s using the same container.

Taste wise and texture wise I prefer the first one – it tastes a bit sweeter and creamier. I’ll see if the second turns creamier with time. Oddly, the second has a somewhat bitter taste as if the hazelnuts were a bit over and not really perfect. Might be a batch issue or an overall quality issue, who knows. Either way, I’d buy no.1 again, keeping no.2 in mind only as a backup.

On meetups

September 19th, 2017

I’ve recently been to a few meetups that were almost a complete waste of my time. The talks themselves weren’t necessarily bad, but it showed they weren’t managed and more often than not, most of the crowd leaves after the talks so there’s no networking opportunities either.

That might sound a bit harsh, but I always felt that as the organiser of an event (I was involved with Spletne urice – a weekly meetup – for quite a while) my job is to provide people with as much value as possible to show that I respect their time and effort to come sit in a hall for an hour or so and listen to something I consider important/relevant[1].

Preparation and curation

As we didn’t have meetups during the summer (less people in town + our space was closed), this meant that every season would start off with me going through all the possible topics I could think of that I felt had developments relevant to the community, brainstorm topics with other senior people in the community and then thinking of companies and people who could be good at presenting these topics.

Convincing and scheduling

Unfortunately Slovenians don’t really want to speak in public too much, so a lot of time was spent convincing people to actually present. If I started the season with 20 topics and people I could start at the beginning of the season and when people said “maybe in a few months” I set a date for them and kept reminding them. This was an ongoing thing as new topics and relevant speakers would pop up during the season. Because you can’t fill all the slots this way I had a set of “evergreen” topics and people who can present on them to fill it all up – this also helps in months when you have less time, but it does mean you owe people.

Talk management

I almost never let people write their own talk descriptions and titles. While I did ask them for a description it was more of a way to see what they want to talk about and the text I wrote was what I wanted them to talk about. This meant that I would give back suggestions on how to make the talk more relevant to the crowd and also to set the expectations – as the meetups were on the broad topic of web technologies, a good narrow description would pull in listeners that would otherwise not have come. For people who have not presented before or felt they might not do a good job I offered even more help –
checking their slides, possibly guiding them on how to tweak them for better effect.

Sad state of affairs

What I see nowadays feels more or less unmanaged and even though that sometimes means some awesome odd-ball talks, it often has the following result:

  • the speaker is chosen from a friends/volunteer list, not a best-of list
  • title and description are ambiguous or even straight up misleading
  • the presentation is more of a trial run with not enough though given to the argument
  • the presentation is off-topic
  • the speaker does not know the crowd and the history and nobody helps him/her understand it before the event

All of the above means that more often than not these things just waste people’s time and look like the organiser and the speaker have no respect for the time of the people attending. I know this is not true most of the time, but having a bunch of people show up because they are hiring and go to meetups to find new employees (of which there are usually none) only masks the fact that the event should be run better and provide more value to the community[2].

The question then is – if you can’t do a meetup properly, do you find another person or a team to do it better? And if there is no one else, do you want to up your game or just quit? Is something better than nothing?

  1. All this is based on my memory of how it went down – I might have been an ignorant asshole and only have romantic memories of the whole affair. back
  2. Unless of course it’s just a ploy to find employees, then I’m not the intended audience so please disregard everything I just said. back

On car configurators

May 3rd, 2016

I’ve recently gone into another cycle of find-a-new-car. I do this now and then to stay in touch with what is currently on market and what I could buy if my trusty Civic dies unexpectedly.

What I’ve seen (again) is that the state of car configurators and comparison tools has not progressed a lot since I first started seeing them in about 2000 when working on a website for Renault. That’s why I like buying cars from Asian brands (actually Japanese brands) – they have a small number of trims and not a lot of things you can add, which makes for a simple decision process. The european brands however will basically sell you an engine with a steering wheel and a set of wheels and then let you add on whatever you want/need so that you actually buy a car – I’m exaggerating here, but not long ago BMW had manual rear windows in the default trim.

The state of the art seems to be adding numbered codes to equipment and then listing them in packages, sometimes online even notifying the user about the incompatibilities when selected (which is sometimes fun – I still can’t configure a Renault car).

The funny thing when comparing trims/models is the fact that there seem to be no links between items, which sometimes means that you’ll have a “Steering wheel” and some trims will not have it – cause they have “Leather steering wheel” a page lower (intentionally selected these cause you can’t solve this with a sort).

Modelling features seems somewhat simple:

  • title
  • description
  • price
  • includes features
  • not with features
  • applies to models

If you try to normalize this you will quickly notice that it gets highly confusing when you have the same commercial title for a feature pack that includes less features and is priced lower because it only applies to high-end trims.

If you’ve ever done this before you can also imagine this conundrum makes for a very fun UI experience – some features only apply to automatic transmission models, some only to models with a certain engine or number of doors. Let’s not even start with special editions…

What do you do to deal with all this mess?