# Start Mycroft on boot, enclosure start timing - Raspberry Pi OS (Buster)

**URL:** https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033
**Category:** General Discussion
**Created:** [March 19, 2022, 5:51pm UTC](https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033 "2022-03-19T17:51:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![S13\_Mills](https://community.openconversational.ai/user_avatar/community.openconversational.ai/s13_mills/32/3468_2.png) [@S13\_Mills](https://community.openconversational.ai/u/S13_Mills)
#### Post date: [March 19, 2022, 5:51pm UTC](https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033/1 "2022-03-19T17:51:11Z")

</div>

Hi there,

I’ve successfully installed Mycroft on the latest version of Raspberry Pi OS (not picroft) following [this](https://github.com/domcross/mycroft-mark1-latest-raspbian) excellent guide (Thank you @Dominik ).

I’m having a few teething issues getting Mycroft to start at boot, but they seem different to those mentioned [here](https://community.openconversational.ai/t/mycroft-will-not-start-at-boot-time/10873).

There are two issues I would be grateful to have some advice on:

**#1** - I’ve made a systemd service (shown below), and Mycroft starts at boot, but there’s no sound - it appears to be a permissions issue accessing ALSA?

The error that shows up is the below, but the other symptom is that there’s no mic level shown in mycroft-cli-client.

```auto
2022-03-18 20:45:54.753 | ERROR | 969 | VolumeSkill | Couldn't allocate mixer, ALSAAudioError('Unable to find mixer control Master,0 [default]')

```

My systemd service is pasted below:

```auto
[Unit]
Description=Mycroft AI
After=alsa-restore.service network-online.target
Wants=network-online.target

[Service]
User=pi
Group=pi
WorkingDirectory=/home/pi/
ExecStart=/home/pi/mycroft-core/bin/mycroft-start all
ExecStop=/home/pi/mycroft-core/bin/mycroft-stop
Type=forking
Restart=no

[Install]
WantedBy=multi-user.target

```

If I run mycroft-start from the command line, I have no issues… (outside #2 below, which I don’t think is related to this) I’m guessing permissions for audio, but I’m not really sure how to start troubleshooting this?

**#2** - The Mark 1 enclosure will not work right unless I launch it _after_ the bus is booted. If I use:

`mycroft-start all`

Then the eyes / mouth / etc don’t work - I get an ‘Attempting to use a port that is not open’ error in the 'enclosure.log file. Simply starting the bus _first_, allowing some time, then starting everything, works fine:

```auto
mycroft-start bus
sleep 10
mycroft-start all

```

The above workaround is totally fine for me - I can write a wrapper script for the 3 lines above, and use that as the start script for Mycroft, but I figured perhaps someone else has come across this issue and may have some advice on a better way to tackle it?

Thanks in advance for any help - I’ve had a lot of fun dusting off my Mark 1 and seeing the general improvements in the Mycroft ecosystem!

---

<div class="post-metadata">

### Author: ![mike99mac](https://community.openconversational.ai/user_avatar/community.openconversational.ai/mike99mac/32/2016_2.png) [@mike99mac](https://community.openconversational.ai/u/mike99mac)
#### Post date: [March 19, 2022, 8:53pm UTC](https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033/2 "2022-03-19T20:53:40Z")

</div>

For the systemd service I use, the first three lines of mycroft.service are:

```auto
[Unit]
Description=Mycroft AI
After=pulseaudio.service

```

Maybe worth a try ?

```
-Mike M
```

---

<div class="post-metadata">

### Author: ![S13\_Mills](https://community.openconversational.ai/user_avatar/community.openconversational.ai/s13_mills/32/3468_2.png) [@S13\_Mills](https://community.openconversational.ai/u/S13_Mills)
#### Post date: [March 20, 2022, 10:14pm UTC](https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033/3 "2022-03-20T22:14:07Z")

</div>

Hi @mike99mac , thank you for the suggestion! Unfortunately I don’t have the pulseaudio service running, my sound seems to be handled by the alsa-restore service.

Also, the audio issue occurs even if I boot the pi, and then start the service manually, so I don’t think it’s a timing thing for the service, it seems more related to audio permissions in general.

I’m able to replicate the issue if I attempt to start Mycroft as root, rather than pi, e.g.

```auto
mycroft-start all

```

Loads the sound correctly, while:

```auto
sudo mycroft-start all

```

Does not…

I figured the User=pi and Group=pi in the systemd file would fix this, but evidently not!

---

<div class="post-metadata">

### Author: ![mike99mac](https://community.openconversational.ai/user_avatar/community.openconversational.ai/mike99mac/32/2016_2.png) [@mike99mac](https://community.openconversational.ai/u/mike99mac)
#### Post date: [March 21, 2022, 4:18pm UTC](https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033/4 "2022-03-21T16:18:35Z")

</div>

> [@S13\_Mills](#):
>
> I don’t have the pulseaudio service running, my sound seems to be handled by the alsa-restore service.

Is it then? Maybe with pulseaudio sharing audio resources would work better?

```
-Mike M

```

---

<div class="post-metadata">

### Author: ![Valentine](https://community.openconversational.ai/user_avatar/community.openconversational.ai/valentine/32/2519_2.png) [@Valentine](https://community.openconversational.ai/u/Valentine)
#### Post date: [April 4, 2022, 2:57am UTC](https://community.openconversational.ai/t/start-mycroft-on-boot-enclosure-start-timing-raspberry-pi-os-buster/12033/5 "2022-04-04T02:57:58Z")

</div>

Hi, [S13\_Mills]. First to note is that you setup the mycroft-core as pi, not root. So yest mycroft-start all as pi will succeed, bit as root as it dose not have the benefit of all the files install in .config/mycroft, .local/share/mycroft and .mycroft. Trying to go the ALSA only route, is fair, my latest install if on a Pi4B and is not based on the picroft image, it’s on Debian Bullseye 64bit, and I only have ALSA, but the for systemd make the service a user service, not a system level service, that way you can have it run a the user pi. As for the mic issue make sure that in you mycroft-config edit user under the listener section don’t have a statement like //“device\_name”: //.
