DEV Community

Cover image for MixerTUI 1.5
Alfonso Siciliano
Alfonso Siciliano

Posted on • Originally published at alfonsosiciliano.gitlab.io

MixerTUI 1.5

MixerTUI is an audio mixer with a terminal user interface (TUI) for the FreeBSD sound system. It allow to switch easily between laptop and HDMI, headphones and speakers,and so on. Features include: show the current driver configuration, select an audio device to get information, change the volume, or make the device the default. The version 1.5 is out!

Window in a terminal with bars to select volume


To install the port audio/mixertui:

# cd /usr/ports/audio/mixertui/ && make install clean
Enter fullscreen mode Exit fullscreen mode

To add the package:

# pkg install mixertui
Enter fullscreen mode Exit fullscreen mode

To build from sources:

Step 1. Install deps

# pkg install bsddialog libsysctlmibinfo2
Enter fullscreen mode Exit fullscreen mode

Step 2. Download, build, and run

% git clone https://gitlab.com/alfix/mixertui.git
% cd mixertui
% make
% ./mixertui
Enter fullscreen mode Exit fullscreen mode

Version 1.5 Changes and Improvements

1) Pop-ups are implemented using libbsddialog, for example the screenshot shows a bsddialog menu. Curiosity, the first version of bsddialog was just a copy of the mixertui pop-ups to implement dialogs, now mixertui uses libbsddialog to show pop-ups.

2) Improvements for the menu to select the device/pcm.
The item with the default pcm (sysctl hw.snd.default_unit) has the "(Default)" prefix; pcm4 in the screenshot. Opening the menu the selected item is the current pcm; pcm2 in the screenshot.

Window in a terminal with bars to select volume

3) Fix fault with terminals without colors. Example

% env TERM=vt220 mixertui
Enter fullscreen mode Exit fullscreen mode

Window in a terminal with bars to select volume

4) Few internal refactoring. Probably this is the last C/ncurses version, (see Future subsection below).


Future

MixerTUI started out as a personal project (...game :D). I spent 30 minutes to set up my microphone to record my BSDCan presentation during the first lockdown. I set audio quickly via alsamixer in the past. Now my main laptop runs FreeBSD, so I wrote mixertui to avoid to waste time setting up a microphone, headphones, accessibility, and so on.

The first version was just 1000 lines of code; mainly ncurses stuff because the sound system interface is actually easy: just some ioctl and sysctl. However several users started to use it. I received a lot of tips, feedback, merge request, iussues, email, and so on.

The utility grew messy to implement the user requests. Mainly I spent time to use libncurses, because it does not provides widgets (buttons, title, bars, ...), it is just a "render" library. I would have preferred to spend time implementing new audio features instead of "drawing" a bar. ncurses is not suitable. I am considering other TUI libraries to rewrite MixerTUI in the next version 2.0. Under the radar: brick/haskell, tui-rs/rust, FTXUI/C++.

Conclusion, this is just a TUI improvements version. I' ll rewite mixertui. TODO, Ideas and new audio features in the future: mouse, virtual_oss, devd, sound(4) improvements, accessibility, and so on.


Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay