OpenVoiceOS - A bare minimal (production type of) OS based on Buildroot

PERFECT FEEDBACK

Thanks for that. At a bar at the moment, but will go through the list soon. First impression is that most of it are “nice to haves”. So very good, as no fundamental errors occured.

Get back to you with a full review a bit later.

Thx again.

1 Like

Have one in celebration of a job well done! :wine_glass: :beers:

Alrighty then, let me go throught the different points and comment on them.

  1. Good

  2. Perfect

  3. Right, not sure why you seen the “Safe to turn off” screen as that screen is being pushed to the framebuffer via systemd within the “halt.target” and “poweroff.target” runlevels. So for some reason it did a quick reboot. Perhaps the resizing of the OS over the whole SD card failed in some way. If you have the SD card still at hand, perhaps you can validate this by checking if all space has been utilized.

  4. Hmm, yes, see that now. Will update the screen. Made that screen way before the wifi setup system.
    5a) I also saw a few funny SSID’s. I am just using the “iw” command to show all networks and then use text line magic to search for all the SSID’s. See code below;

    def scan_wifi_networks():
    iwlist_raw = subprocess.Popen([‘iw’, ‘dev’, ‘ap0’, ‘scan’, ‘ap-force’], stdout=subprocess.PIPE)
    ap_list, err = iwlist_raw.communicate()
    ap_array = []

     for line in ap_list.decode('utf-8').rsplit('\n'):
         if 'SSID' in line:
             ap_ssid = line[7:]
             if ap_ssid != '':
                 ap_array.append(ap_ssid)
    
     return ap_array
    

5b)Perhaps I need to dig in a bit deeper and check for type of network as well. About the 5G networks not being shown. At my test bench I only have 2.4G so stupidly didn’t look further. Will have a look, but think I already know what the problem is. I have no country specified within the default wpa_supplicant files. I believe 5G needs to know the country becaquse of the channel / power settings of the wifi chip. Will look at it.
6) Thanks, indeed a simple thing that helps preventing typo’s. I have on the list (way at the bottom though) to check the crendentials before the reboot, but for now that is a easy compromise.
7) Yeah, perhaps the wording should be changed a bit. I thing I will change it to “Safe to reboot / Rebootig now”. While at it, thik I will change the poweroff screen to “Safe to poweroff / Powering off”. It depend a bit on the hardware if it can actually really reboot/poweroff the system. But as we are still only looking at the RPi’s it is not yet a valid point. (I know some Amlogic boards, can’t really power off)
8) Sure, that is already on the nice to have list. At the moment, I just implemented a very, VERY simple splash approach utilizing systemd. At some point I will change this to something more advaced, but still not as advanced as plymounth. Will probably end up with psplash or something.
9) Indeed, on the list but awaiting the way forward from the Mycroft Dev team in combination of the GUI. At the moment there are multiple ging going on. They write the WIFI code raw to the framebuffer. The pairing code is handled by a Skill, but there is still an open ongoing discussion about enclosures/code. I am trying to use as much as possible from the Mycroft Dev team as possible. This makes is look the same, avoids confusion. However the visual part of Mycroft is still a bit early bird.
10) Great idea. For the rest, see point 9. But perhaps we should communicate this one to the Dev team as well for their Mark-2 development.
11) Good.
12) Doh! Never thought about that. Gave it some thoughts at the bar :wink: Could be easily solved by adding the last bits of the MAC address to the hostname. Again systemd will help us out and makes it robust.

[Unit]
Description=Set hostname to MycroftOS-[MAC]
Before=systemd-networkd.service
Before=avahi-daemon.service

[Service]
Type=oneshot
ExecStart=/bin/sh -c "hostnamectl set-hostname MycroftOS-`sed 's/://g' /sys/class/net/eth0/address | tail -c 7`"

[Install]
WantedBy=multi-user.target
  1. Hmmm, thought the mycroft/mycroft combo was clear. Anyhow, on the list is to have the user force a password if the enable the SSH at the settings page. Then the underlying Skill/Enclosure code will initiate as passwd command before starting the SSH daemon. Open network protocols with default credentials are a no go if you ask me. Anyhow, will look at it when I make SSH disabled by default.

  2. Nice

  3. Indeed, I need to have a look at MSM code and see what package managers it is looking for. Than either need to patch the code or mimic an empty package manager. Buildroot does not have a package manager. Need to give this some thoughts to find the right decision.

  4. That is done intentionally. Still working on the mycroftos enclosure skill. Only added the skill in this release for the Framebuffer visuals. When the whole Skill is done, I will make it install properly so it can be updated etc. For the volume skill, I included a patched version where I added “MycroftOS” to the ALSA_PLATFORMS array. This together with the pushing e erything from ALSO to pulse give me a quick fix for handling the volume. The mycrofos-enclosure skill it the place where I will and need to integarte the PulseAudio volume control code. This should inlcude; Increase/Decrease volume, muting, but also switching sinks, perhapos seperate sink volume control, seperate sink muting. This figuring that stuff out in my head. Most likely also need some changes to CPS or Audio service. All audio is forced into pulseaudio and as this is a embedded system only used for mycroft, we should allow Mycroft to control all the sinks of pulseaudio. So when we start playing something via spotify connect on the device, we should be able to say “Hey MYcroft, stop” and it should just stopp all playback, including the ones that aren’t even initiated by Mycroft itself.

  5. Yeah, the snapcast and mpd needs to be added to the settings page. Not 100% sure how though…

  6. Snapcast client is already installed. Just enable it via the settings page and it will be started and started at boot because I use systemd for it.

    [Unit]
    Description=Snapcast client
    Documentation=man:snapclient(1)
    Wants=avahi-daemon.service
    After=network.target time-sync.target sound.target avahi-daemon.service
    
    [Service]
    EnvironmentFile=-/etc/snapcast/snapclient
    ExecStart=/usr/bin/snapclient $SNAPCLIENT_OPTS
    StandardOutput=null
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
  7. I will investigate and think I know what it is. Indeed overheating and downthrotling. I have set the CPU govenor to performance. Precise is asking quite a lot of the RPI3, so the CPU goes up and down. I could have changed the on-demand threshold, but in combination with precise that is about the same as going ful lspeed all the time anyway. BUT, we might not need this for the RPI4 as it is a bit faster. Will see if I can make it automaticall; performance for rpi3, on-demand for rpi4.

  8. Agree, see 19.

  9. Not sure, need to read into it. Will get back to this.

  10. In the end; YES. At the moment NO, not without flashing again. I have OTA firmware upgrade system on the list. Either RAUC (what HassOS uses) or SWupdate. Both systems can be use to upgrade the system via USB, a webinterface or could poll a remote server for updates. All user data will be moved to /opt so it will survive upgrades. Anyhow, will only startdeveloping this when I reach some sort of “final” first release as things keeps changing a a regular basis at the moment. But already doing my homework for it :wink:

Once again, perfect feedback. You really approached it with a (dummy) kind of consumer eye. This type of reports, makes something going from 90% done to 100% That last 10% are always the most difficult in a project.

Thanks again!

1 Like

It has been a while since I was able to really work on the project, but as Corona hits us all and we have to work from home, I can multitask a bit in between the daytime job task.

Gathered all my different (sticky) notes into a proper task list again. For the people that are interested or are or want to be involved, see below (Let me know if I missed something)


MycroftOS - Version 0.1.0 - alpha 8

ToDo:

  • Ondemand governor for both RPI3 and 4 (instead of permormance), most likely need some tweaking in the threshold
  • Fix: MPV not compiling because of missing LD stuff (disabled for now) [WIP]
  • Update to latest LTS kernel and drivers / firmwares [WIP]
  • Update to latest LTS buildroot (20.02.x) [WIP]
  • Update to latest Mycroft version and dependencies [WIP]
  • Addition of additional packages for the near future [WIP]
    • OpenCV
    • Python-Numpy
    • Motion [DONE]
    • Mosquitto [DONE]
  • Change WifiSetup splash; MycroftOS-Setup -> MycroftOS-WiFiSetup
  • Have a look at the wifi scan to exclude non real SSID (“ID List”)
  • Add 5G support to the wifi system (Country setting most likely)
  • Figure out how to make the wifi password box to be able to show password (eye icon)
  • Change the wording on the splash screens;
    • Safe to reboot -> Safe to reboot / Rebootig now
    • Safe to poweroff -> Safe to poweroff / Powering off
  • Look into animating the boot splash screen, showing progress during boot
  • Implement initial framebuffer drawing GUI
    • Look into showing the pairing code on the HDMI as well (look at mycroft’s system)
    • Look into showing the IP address on the HDMI as well (look at mycroft’s system)
    • Look into combining the wifi code, the framebuffer code and the enclosure code into one system.
  • Add the last bits of the MAC address to the hostname
  • Include changing the hostname from the MycroftOS settings skill without messing up above MAC addition.
  • Look into the msm error/warning “no package manager found” (there is none, but just handle the warning)
  • Included volume skill can’t be updated
    • Should be changed to pulseaudio anyway, but…
    • Check if the included volume-skill can be updated, via offical git commits
  • Avahi zero config publish to be set up (pulseaudio, mpd, snapcast, etc.)
  • MycroftOS settings skill to be able to setup smart speaker services / software
  • VLC Framebuffer video playing support (if not accelerated, check omxplayer but needs to be created as audio backend within mycroft)
  • Add and make configurable, where sound output has to go;
    • BT Speaker (A2DP) normal (Use a bluetooth speaker as output)
    • Bluetooth mic/speaker combo support using HSP (use headsets as input/output for Mycroft)
    • Airplay (example: SONOS) using module-raop-discover and module-raop-sink of PulseAudio
    • Autoconnect trusted BT devices as soon as it sees them using: module-switch-on-connect from PulseAudio
    • Combined: Create a virtual pulseaudio sink to send sound to multiple output sinks/devices
  • Change README with all new changes
  • Update / Complete “documentation” folder and docs

MycroftOS - Version 0.1.0 - beta 1

ToDo:

  • Build precise from source at build time (0.3.0 dev version)
    • create buildroot packages for all dependencies.
    • create buildroot package for precise-engine & runner
    • create buildroot package for wake word modules (including the commodity ones)
    • figure out how to give back to the communicty by allowing recording of wake words easily
  • Fix / Check all Buildroot package dependencies (SELECT and DEPENDS references within Config.in)
  • Cleanup buildroot config file
    • remove / disable any unused packages that might have slipped in while testing / debugging / etc.
  • Make sure all Skills from the market can install (python dependencies either available or pre-installed)
  • Enclosure code for enabling services, halt, reboot, etc
  • Enclosure code for pulseaudio control (volume mostly)
  • More hardware support
    • At least the Google-AIY
    • PS3 Eye [WIP (ordered one)]
  • Systemd notify and Watchdog support to make starting/stopping/restarting and failures way more robust.
  • ReSpeaker Mycroft LED pattern which is blue-isch and looks like the logo of Mycroft

MycroftOS - Version 1.0.0 - alpha 1

ToDo:

  • 64bit support for RPI3 and RPI4
  • Cleanup buildroot:
    • rootfs default overlay seperate
    • device specific overlays
  • Cleanup the kernel config
    • Remove unused drivers and stuff (DVB and such)
    • Separate default config into systeemwide .config
    • Board specific configs as overlays
  • Support of OVA (Virtual system - Virtualbox)
  • Implement easy (OTA) update system (RAUC or SWUpdate, not sure yet)
  • Add an first initial GUI system using Kivy, just as Mycroft.ai
  • Implement first initial WEB frontend/backend system for configuration and all
    • Backend for settings, configuration and update
    • Backend pulseaudio control (Already available project as quick fix, but needs to integrate with MycroftOS system)
    • Frontend for possibly accelerated browser hooking into the Mycroft GUI
  • Support for more devices
    • Rockchip boards
    • ReSpeaker Pro V2
    • Odroid
    • X86 / 64
    • etc.

2 Likes

Quick double post to let you know, the above list has been updated with more stuff from saved bookmarks, notes, investigations.

I know a long list and it keeps getting longer. But it kind of show cases how I see an end-consumer type of Mycroft device :wink:

1 Like

Looking forward to doing some more testing, let me know if you need anything specific tested, I may have some time on my hands in the next week or so.

1 Like

We all have nowadays🤦‍♂️

But yeah, thanks, will definitaly ping you when I have something to test for you.

Add me to willing test subjects. Eager to get Squeezelite and Mycroft running on a RasPi… :slight_smile:

No problem!

Do you have Rpi3 or Rpi4? No ETA about the next test version though. In progress of updating the underlying Buildroot, kernel and all drivers / firmwares. All ok except the wife (again🤦‍♂️)

Squeezelite is already included and muting / ducking does work through an alsa/pulse force trick, but want proper pulse volume control. That way I am prepared to adjust the volumes of all seperate playback. Lower the music playback while keeping mycroft TTS at a proper higher level.

It also makes your mycroft device a Bluetooth speaker. A airplay device and a spotify connect devive. Basically you can through anything to it from your mobile device.

Squeezelite, mpd, snapcast are also there already, but not yet all configurable via voice or skill websettings. Login through ssh and some manual configuration still required.

Keep you guys posted about the development.

Do you know Plasma Bigscreen?

I have quite some stuff to play around with. RP3b and RP4, different Mics. Output usually via USB-Soundcard. Some headless (e.g. bathroom), some with a screen/TV connected (e.g. Living room). For the last I am currently playing around with Plasma Bigscreen. All orchestrated via OpenHAB.

Overall, I am not that technical - so sorry in advance for stupid answers. But I am enthusiastic and not utterly dumb :slight_smile: So happy to help within my capabilities.

Does it make sense to test your last release from January or should I wait for the next iteration? Or in other words, with some manual configuration, would I get a squeezelite / Mycroft Raspi3 running with the current (pre-)release?

Wait, so MycroftOS comes with an airplay client preinstalled?

From alpha7 onwards, Shairport-sync is included.

Turning it on via the skill websettings, automagically makes it available on your network. So from your iOS device you will see a MycroftOS device which you can select to just play anything on your device throught the MycroftOS speakers.

2 Likes

Just discovered Plasma Bigscreen recently because of the AIX internet posts recently and will check it out rather sonner then later. I will not include it in MycroftOS, but would be cool to have it on a seperate RPi connected to the TV and then use MycroftOS as voice control for it. The Mycroft-GUI allows for it by instead using localhost, the IP of the MycroftOS device.

I am not sure when I included Squeezelite. Before or after the alpha7 release. Can’t check it out myself, but if you have a spare SD you could have a look yourself.

SSH in with the username and password: mycroft/mycroft and see if the squeezelite command(s) is there.

No squeezelite installed :frowning:
But impressive nevertheless. Works really well for an alpha.

It caught my problematic Jabra Mic right away and uses its speaker (instead of the connected USB speakers). Wifi setup worked on my tablet finally (computer and mobile failed, likely for me being dumb). Might test further next days.

Keep up the great work!

1 Like

Thanks for the feedback about the Jabra speaker working out of the box.

The sound architecture is set up in such a way it should pick up connected hardware and give it preference above the onboard hardware. (I assume that if you attach a speaker or mic combo over usb, you want to use it instead of the embedded one)

Which version of the Jabra do we talk about if I may ask?

1 Like

@j1nx Have you played with Yocto? As its not so bad if you can hack a good example.
Its a bit of a twizzle to start yocto blank but can make extremely quick boot and fast images.

Loads of recipes for the Pi, its quite well supported under Yocto.
It does compile everything which can take some time, but would be interesting how it compares.
I played with a web gui for the Pi on Yocto and it was amazingly fast to boot but its was only loading enough to get https://www.igalia.com/project/wpe going.
This one actually :slight_smile:
https://medium.com/@decrocksam/building-web-applications-for-wpe-webkit-using-node-js-3347146013f3

Yes I know about Yocto. It is a similar type of OS as Buildroot. Buildroot is actually “older” as Yocto.

The image you tried and linked is actually Buildroot and similar as my MycroftOS approach. Perhaps in the future I will add the wpe webkit browser within MycroftOS. It will give a nice and accerated browser as possible frontend and makes it easy to implement Youtube, netflix and the others.

They are actually quite active in developing the Buildroot packages. Will see if I can dig up the link to their github repo.

Edit; Found it. https://github.com/WebPlatformForEmbedded/buildroot.git

As information, the following projects are also build upon Buildroot;

HassIO
HifiberryOS

Both well known. I actually have a similar build approach as Hassio. If you check out their repo you will see MycroftOS has the exact folder structure.

Edit2: The reason I mimic HassOS is because perhaps at some point when I consider a release to be at version 1.0.0 I might include the supervisord package. This to make it easy to use a similar docker addon approach. I did not choose for a minimalistic supervisor as base and run the real mycroft os as docker just like HassOS because hardware support wise this is way better to handle.

But perhaps in the future you could run dockers on MycroftOS. For instance even Home Assistent itself, or Mozilla Webthings. The sky is the limit, but there is still such a huge list of things to tackle/code before even consider the 0.1.0 beta, RC and hopefully Final at some point.:man_facepalming:

I have the Jabra SPEAK 410 OC here - never got it working before with Mycroft.

I actually had two USB things attached - The Jabra, that is speaker and Mic at the same time and another speaker via USB Soundcard. Want to have sound obviously via the soundcard :slight_smile: Well, minor thing really.

OK, we will get that sorted together when I have another test version for you :wink:

@j1nx I thought I give it a go and test the snapcast option (also like evaluate against my current squeezebox). For testing, I would like to setup two raspis one running server / client (RP4) and the other running the client only (RP3). I tried to figure config options myself, but failed so far. Can you provide me with the need infos to get those up and running?

So far I experienced nothing that i would call a real problem. Lots of stuff to smoothen later, for sure, but right now this is a working product for me, at least as it comes to installing, setting up and running mycroft. Did test with various Mic / Sound setting on RP3 and RP4 - no problems so far.