# UNO Q: Exploring Custom Bricks and App Lab Service Containers

**URL:** <https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898>\
**Category:** UNO Q\
**Created:** [May 6, 2026, 12:59pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898 "2026-05-06T12:59:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![philippe86220](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/philippe86220/32/733778_2.png) [@philippe86220](https://forum.arduino.cc/u/philippe86220)\
**Post date:** [May 6, 2026, 12:59pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/1 "2026-05-06T12:59:39Z")

</div>

Hello everyone,

I have been experimenting with the new custom bricks feature introduced in Arduino App Lab 0.7.0 on UNO Q.

Starting from my previous Web Radio project:  
👉 [GitHub - philippe86220/UNO-Q--WebRadio · GitHub](https://github.com/philippe86220/UNO-Q--WebRadio)

I created a local custom brick (`WebRadio`) in order to:

- encapsulate the radio logic,
- simplify the Python application structure,
- expose a cleaner API,
- and separate the WebUI from the backend implementation.

The brick now provides methods such as:

```python
radio.play("info")
radio.set_volume(50)
radio.stop()

```

instead of directly handling HTTP requests inside `main.py`.

I also experimented with `brick_compose.yaml` in order to better understand how App Lab service containers behave.

As part of these tests, I created an additional container using:

```yaml
services:
  player:
    image: debian:bookworm-slim
    command: bash -c "ls -l /dev/snd || true; sleep infinity"

```

The container was correctly created and started alongside the main App Lab container.

However, in my tests, ALSA audio devices were not exposed inside the service container:

```bash
docker exec -it copy-of-brique-player-1 ls -l /dev/snd

```

returned:

```plaintext
ls: cannot access '/dev/snd': No such file or directory

```

Because of this, I was not able to containerize audio playback (`mpg123` / ALSA / USB audio) using `brick_compose.yaml`.

At the moment, the most reliable architecture I found is therefore:

```plaintext
App Lab (WebUI + custom brick)
    ↓ HTTP
Linux host-side service (systemd)
    ↓
mpg123 + ALSA + USB audio

```

I documented the exploration and tests here:

👉 [GitHub - philippe86220/UNO-Q-Custom-Brick-Exploration-WebUI · GitHub](https://github.com/philippe86220/UNO-Q-Custom-Brick-Exploration-WebUI)

Thanks to the Arduino team for introducing custom bricks in App Lab. They provide a very interesting way to better structure applications and encapsulate logic.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [May 6, 2026, 8:10pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/2 "2026-05-06T20:10:00Z")

</div>

> [@philippe86220](#):
>
> `ls: cannot access '/dev/snd': No such file or directory`

This is expected. The reason is that access to any resources on the host machine must be granted to the container explicitly. You haven't done so for the files on the host that are under `/dev/snd`, so it is expected that this directory won't exist in the container.

In the case where you want to provide the container access to a device, you can do this via the `devices` key of the Docker Compose file:

[https://docs.docker.com/reference/compose-file/services/#devices](https://docs.docker.com/reference/compose-file/services/#devices)

Try it with this `brick_compose.yaml` file content:

```yaml
services:
  player:
    image: debian:bookworm-slim
    command: sh -c "ls -l /dev/snd || true; sleep infinity"
    devices:
      - /dev/snd

```

---

<div class="post-metadata">

**Author:** ![philippe86220](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/philippe86220/32/733778_2.png) [@philippe86220](https://forum.arduino.cc/u/philippe86220)\
**Post date:** [May 7, 2026, 8:15am UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/3 "2026-05-07T08:15:08Z")

</div>

Thank you for the suggestion regarding `devices:`.

It worked perfectly.  
I was able to expose `/dev/snd` inside the service container and successfully run `mpg123` with USB audio playback directly from the custom brick container.

I will clean up the project and publish the custom brick implementation and repository as soon as possible.

This new version is based on the previous WebRadio project, but now uses a fully containerized audio service through `brick_compose.yaml`.

---

<div class="post-metadata">

**Author:** ![philippe86220](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/philippe86220/32/733778_2.png) [@philippe86220](https://forum.arduino.cc/u/philippe86220)\
**Post date:** [May 7, 2026, 12:26pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/4 "2026-05-07T12:26:02Z")

</div>

I updated the project and significantly reworked the architecture.

The WebRadio logic is now encapsulated inside a real custom App Lab brick with its own containerized audio backend.

Main changes:

- custom `WebRadio` brick
- containerized Linux audio service via `brick_compose.yaml`
- ALSA access from inside the container using `/dev/snd`
- MP3 streaming with `mpg123`
- cleaner Python API
- simplified `main.py`
- WebUI integration through exposed App Lab APIs

Example usage:

```python
from webradio import WebRadio

radio = WebRadio()

radio.play("info")
radio.set_volume(50)
radio.stop()

```

The project now demonstrates:

- custom App Lab bricks
- containerized services
- ALSA audio playback
- HTTP communication between components
- modular architecture on UNO Q

Repository:

> **[GitHub - philippe86220/UNO-Q-WebRadio-Brick](https://github.com/philippe86220/UNO-Q-WebRadio-Brick)**
>
> Contribuez au développement de philippe86220/UNO-Q-WebRadio-Brick en créant un compte sur GitHub.

A first startup delay (~30–60 seconds) can occur on a fresh installation because the container dynamically installs required Debian packages before the radio backend becomes operational.

I also updated the documentation to clarify the architecture and startup behavior.

---

<div class="post-metadata">

**Author:** ![philippe86220](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/philippe86220/32/733778_2.png) [@philippe86220](https://forum.arduino.cc/u/philippe86220)\
**Post date:** [May 7, 2026, 1:56pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/5 "2026-05-07T13:56:19Z")

</div>

The current version still uses predefined radio station names (info, rtl, inter, etc.) because the project initially focused on validating the overall architecture.

Now that the containerized ALSA backend is working correctly, the next step will probably be to evolve the brick into a more generic audio player API.

The idea would be to provide something simpler and more reusable such as:

```arduino
from audio import AudioPlayer

player = AudioPlayer()

player.play("https://example.com/stream.mp3")
player.stop()
player.set_volume(50)

```

This would make the brick independent from predefined radio stations and allow playback of arbitrary audio streams.

I think this approach is ultimately more coherent and closer to what a generic App Lab audio brick could look like on UNO Q.

I will start working on this evolution as soon as possible.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [May 7, 2026, 7:34pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/6 "2026-05-07T19:34:10Z")

</div>

Very cool! I'm glad you were able to utilize the new custom Bricks feature.

---

<div class="post-metadata">

**Author:** ![philippe86220](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/philippe86220/32/733778_2.png) [@philippe86220](https://forum.arduino.cc/u/philippe86220)\
**Post date:** [May 7, 2026, 7:48pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/7 "2026-05-07T19:48:58Z")

</div>

Yes, after experimenting with them more deeply, I now better understand how powerful custom bricks can become on UNO Q.

They really help separate:

- application logic
- backend services
- hardware access
- and reusable APIs

The AudioPlayer experiment evolved much further than my original WebRadio prototype thanks to this architecture.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 3, 2026, 7:49pm UTC](https://forum.arduino.cc/t/uno-q-exploring-custom-bricks-and-app-lab-service-containers/1442898/8 "2026-11-03T19:49:23Z")

</div>

Closed on November 3, 2026, 7:49pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
