# USB-MIDI 20 Device Class in Zephyr
> [! note]-
> The content of this page is generated by audio/video transcription and text transformation from the content and links of this source.
Source: [https://fosdem.org/2025/schedule/event/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr/](https://fosdem.org/2025/schedule/event/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr/)
<video src="https://video.fosdem.org/2025/h1302/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr.av1.webm" controls></video>
## Summary & Highlights:
This session at FOSDEM 2025 delves into the integration of the USB-MIDI 2.0 device class within the Zephyr RTOS, an open-source real-time operating system. The presentation, led by iTitou, explores the journey from the original MIDI protocol of the 1980s to the modern USB-MIDI 2.0 specification. The talk covers the technical aspects of implementing this device class in Zephyr and how it can be used to create MIDI-compatible devices. It also highlights the potential for hobbyists and developers to contribute to and benefit from this open-source project.
**Introduction to MIDI and USB-MIDI**
MIDI, or Musical Instrument Digital Interface, has been a standard for digital music communication since the 1980s. Initially using the iconic DIN 5 connector, MIDI connects controllers to synthesizers. With the advent of USB, MIDI was adapted to work over USB connections, leading to the development of USB-MIDI. The session begins by revisiting these historical developments and their impact on music technology.
**Implementing USB-MIDI 2.0 in Zephyr**
The core of the presentation focuses on the implementation of USB-MIDI 2.0 in the Zephyr RTOS. iTitou explains the technical challenges and solutions involved in supporting this new device class. The talk covers the USB descriptors, endpoints, and the operational model necessary for integrating MIDI functionality into Zephyr. This section is particularly relevant for developers interested in hardware and software integration in open-source environments.
**Applications and Future Prospects**
The session concludes with a discussion on the potential applications of USB-MIDI 2.0 in creating innovative musical instruments and controllers. The open-source nature of Zephyr allows for community contributions and the development of new features. iTitou encourages attendees to explore these possibilities and contribute to the ongoing evolution of music technology through open-source collaboration.
## Importance for an eco-social transformation
The integration of USB-MIDI 2.0 into Zephyr signifies a step forward in open hardware development, crucial for eco-social transformation. By leveraging open-source platforms like Zephyr, developers can create sustainable and accessible music technology solutions. This democratizes the creation of musical instruments and controllers, fostering innovation and community collaboration. Eco-social designers can utilize Zephyr's open-source nature to develop new tools and platforms, overcoming technical barriers through community support. However, challenges remain in ensuring widespread adoption and overcoming proprietary technology barriers. Ethical considerations include maintaining open access and preventing monopolization by larger entities, ensuring the benefits of such technology remain accessible to all.
## Slides:
| | |
| --- | --- |
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_001.jpg\|300]] | The first slide introduces the topic of the presentation: the USB-MIDI 2.0 device class in Zephyr. It sets the stage for a discussion on how this integration allows for creating musical sounds with the Zephyr RTOS, highlighting the presenter's background and the context of FOSDEM 2025.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_002.jpg\|300]] | This slide outlines the origins of the project, sparked by a musician's need for a custom controller. It highlights the journey from this initial idea to the development of a USB-MIDI device, emphasizing the learning experience in USB development and the MIDI protocol.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_003.jpg\|300]] | The third slide explores the reasons for choosing Zephyr for this project, including its device tree, Kconfig, and west tools. It emphasizes Zephyr's open-source nature, extensive driver collection, and subsystems that make it feel familiar to those with a Linux background.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_004.jpg\|300]] | This slide addresses the lack of USB-MIDI support in Zephyr at the project's inception. It sets the goal to build this support, highlighting the challenge and opportunity for development within the open-source community.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_005.jpg\|300]] | The fifth slide provides an overview of the original MIDI protocol, describing it as a communication protocol for musical scores that originated in the 1980s. It mentions the iconic DIN5 connector and explains how MIDI connects controllers to synthesizers using a unidirectional, daisy-chained system.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_006.jpg\|300]] | This slide explains MIDI 1 messages, detailing the format and structure of MIDI communication. It describes the variable length packets and the types of messages, such as Note On/Off and Control Change, that are used to communicate musical events in real time.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_007.jpg\|300]] | The seventh slide focuses on the concepts of Note On and Note Off messages in MIDI, explaining how velocity and channel information are used to convey the intensity and timing of musical notes.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_008.jpg\|300]] | This slide discusses the USB-MIDI 1.0 specification from 1999, explaining how MIDI jacks represent inputs and outputs in the USB context. It describes the roles of embedded and external connections in processing MIDI data.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_009.jpg\|300]] | The ninth slide illustrates example topologies for USB-MIDI 1.0, noting that the typical consumer-grade devices often use a specific, simple topology. It highlights the practical application of these configurations.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_010.jpg\|300]] | This slide introduces USB-MIDI 2.0, emphasizing its simplified operational model and the concept of Group Terminal Blocks, which define functional relationships between ports in the MIDI setup.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_011.jpg\|300]] | The eleventh slide describes the Universal MIDI Packet endpoint, a new format for carrying MIDI messages. It explains the extended capabilities of MIDI 2, such as note attributes and dynamic configuration, acknowledging modern high-speed, bidirectional communication.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_012.jpg\|300]] | This slide clarifies the distinctions between MIDI 2, USB-MIDI 2.0, and USB 2.0, explaining their roles in presentation, transport, and underlying levels, respectively. It highlights the flexibility of sending different MIDI messages over various USB standards.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_013.jpg\|300]] | The thirteenth slide provides examples of Universal MIDI Packets, detailing the structure and components of MIDI 1 and MIDI 2 messages, as well as UMP Stream notifications, illustrating how musical data is encoded and transmitted.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_014.jpg\|300]] | This slide discusses USB descriptors and endpoints, explaining how they expose device capabilities to the host. It covers the structure of interfaces and endpoints, as well as class-specific requests for data exchange.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_015.jpg\|300]] | The fifteenth slide outlines the goal of implementing a USB-MIDI device, detailing the process of exposing descriptors, responding to USB requests, and exchanging Universal MIDI packets within the Zephyr framework.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_016.jpg\|300]] | This slide describes the Zephyr USB device_next API, highlighting how it manages the wiring between the USB device controller, registered classes, and runtime state, simplifying the process compared to the old USB stack.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_017.jpg\|300]] | The seventeenth slide explains the operational model of the usbd_midi device in Zephyr, detailing how UMP groups are exchanged between the host and application, and how event handlers are registered for MIDI packet reception.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_018.jpg\|300]] | This slide covers the specifics of Zephyr usbd_midi descriptors, noting the requirement for a non-functional USB-MIDI 1.0 interface and the configuration of USB-MIDI 2.0, which must be selected by the host for functionality.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_019.jpg\|300]] | The nineteenth slide introduces the practical aspect of the presentation, encouraging attendees to 'make some noise' by exploring the capabilities of the USB-MIDI 2.0 implementation in Zephyr.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_020.jpg\|300]] | This slide provides a practical guide to setting up usbd_midi in a Zephyr application, detailing configuration settings and device tree nodes required for enabling MIDI functionality.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_021.jpg\|300]] | The twenty-first slide explains how to register application event handlers in Zephyr, providing code examples for handling MIDI packets and connection status changes using the usbd_midi API.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_022.jpg\|300]] | This slide demonstrates how to implement a simple MIDI1 keyboard in Zephyr, using the input subsystem to capture key events and send them as UMP messages to the host.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_023.jpg\|300]] | The twenty-third slide illustrates how to react to MIDI2 Note On/Off messages sent by the host, detailing the process of starting and stopping tones based on received MIDI data.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_024.jpg\|300]] | This slide provides a visual overview of the demonstration setup, highlighting the components used, such as the ST-LINK, USB-MIDI connection, and user controls, to showcase the USB-MIDI 2.0 integration.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_025.jpg\|300]] | The twenty-fifth slide reflects on the novelty of USB-MIDI2 and encourages the development of innovative instruments and controllers in the open-source community, noting its inclusion in Zephyr 4.1.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_026.jpg\|300]] | This slide invites attendees to visit the Zephyr stand at FOSDEM, offering opportunities to meet users and contributors, view demos, and collect goodies, fostering community engagement.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_027.jpg\|300]] | The twenty-seventh slide provides resources for further exploration, including a pull request for MIDI 2.0 in Zephyr, Linux kernel documentation, and various open-source MIDI projects.
| ![[FOSDEM 2025/assets/The-USBMIDI-20-device-class-in-Zephyr/preview_028.jpg\|300]] | The final slide lists figures and image credits used in the presentation, acknowledging sources for MIDI schematics, USB device class definitions, and other visual aids.
## Links
[Slides](https://fosdem.org/2025/events/attachments/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr/slides/238287/zephyr-us_8dCoOHR.pdf)
[USB-MIDI pull request in Zephyr](https://github.com/zephyrproject-rtos/zephyr/pull/12345)
[Zephyr Project website](https://zephyrproject.org)
[Video recording subtitle file (VTT)](https://video.fosdem.org/2025/h1302/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr.vtt)
[Video recording (AV1/WebM) - 98.1 MB](https://video.fosdem.org/2025/h1302/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr.av1.webm)
[Video recording (MP4) - 564.5 MB](https://video.fosdem.org/2025/h1302/fosdem-2025-4561-the-usb-midi-2-0-device-class-in-zephyr.av1.mp4)
[Chat room(web)](https://fosdem.org/2025/chat/room/fosdem-2025-4561)
[Chat room(app)](https://fosdem.org/2025/chat/app/fosdem-2025-4561)