Giter Site home page Giter Site logo

scarlett-mixer's Introduction

Graphical Mixer Interface for the Scarlett series

Currently supported models, first generation of

  • 18i6
  • 18i8
  • 18i20
  • 6i6 (untested)

third generation of

  • 8i6

This is just a GUI, the device must be supported by the ALSA Linux kernel device-driver.

The mixer-elements are numerically indexed and only work with vanilla Linux. All 1st generation of Scarlett devices are supported (Linux 4.16, April 2018), 3rd generation 8i6 devices are supported and some other 2nd and 3rd generation devices may happen to work.

This UI a quick hack, it may or may not work and is prepared for other Scarlett devices, but you are on your own.

Please do not package this software as-is, nor make it available to end-users since most will be disappointed.

Setup

Build-dependencies: gnu-make, a c-compiler, pkg-config, libpango, libcairo, lv2 (SDK), alsa (libasound) and openGL (sometimes called: glu, glx, mesa).

  git clone https://github.com/x42/scarlett-mixer
  cd scarlett-mixer
  git submodule init
  git submodule update
  make

Usage (run from source-dir)

  ./scarlett-mixer --help
  ./scarlett-mixer hw:2   # change "hw:2" to match your device

Screenshot

screenshot

See also

ALSA Mixer in HTLM-5 with ALSA JSON Gateway: https://github.com/fulup-bzh/AlsaJsonGateway

scarlett-mixer's People

Contributors

atom-bomb avatar matze avatar trebmuh avatar x42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scarlett-mixer's Issues

build dependencies not satisfied

I am having the following problem

root:~/Scrivania/INSTALLAZIONI/driver# git clone git://github.com/x42/scarlett-mixer
Cloning into 'scarlett-mixer'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 177 (delta 6), reused 14 (delta 5), pack-reused 161
Ricezione degli oggetti: 100% (177/177), 128.98 KiB | 187.00 KiB/s, done.
Risoluzione dei delta: 100% (87/87), done.

root:~/Scrivania/INSTALLAZIONI/driver# cd scarlett-mixer

root:~/Scrivania/INSTALLAZIONI/driver/scarlett-mixer# git submodule init
Submodule 'robtk' (git://github.com/x42/robtk) registered for path 'robtk'
root:~/Scrivania/INSTALLAZIONI/driver/scarlett-mixer# git submodule update
Cloning into '/root/Scrivania/INSTALLAZIONI/driver/scarlett-mixer/robtk'...
Submodule path 'robtk': checked out '05eb4b8398cfd74b30d1d608e169362119c9c7e5'

root:~/Scrivania/INSTALLAZIONI/driver/scarlett-mixer# make
Makefile:16: *** "build dependencies are not satisfied".  Arresto.

Support to macOS

I'm looking for some software like scarlett-mixer, but with macOS support.

Actually my need is simple: I have an 8i6 but I want to find a way to access the internal API to modify the gain of line inputs in rear panel.

Can anybody help me?

Wrong package names?: Makefile:16: *** "build dependencies are not satisfied". Stop.

Fresh Ubuntu Studio 17:
4.13.0-32-lowlatency #35-Ubuntu SMP PREEMPT Thu Jan 25 10:36:35 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I've got installed:

  • libpango-1.0-0/artful,now 1.40.12-1 amd64
  • libcairo2/artful,now 1.14.10-1ubuntu1 amd64
  • I installed mesa so I've got:
    -- libglu1-mesa/artful,now 9.0.0-2.1build1 amd64
  • libasound2/artful,now 1.1.3-5 amd64

I commented Makefile:15-17 and here's the output. I think that there's an issue with naming these packages.

$ make
cc  \
	-o scarlett-mixer \
	-DVERSION=\"0.1.0-8\" \
	-g -Wall -Wno-unused-function -I. -Irobtk/ `pkg-config --cflags cairo pango lv2 glu alsa` -pthread -DDEFAULT_NOT_ONTOP \
	-DXTERNAL_UI -DHAVE_IDLE_IFACE -DRTK_DESCRIPTOR=lv2ui_descriptor \
	-DPLUGIN_SOURCE=\"src/scarlett_mixer.c\" \
	-DAPPTITLE="\"Scarlett Mixer\"" \
	robtk/robtkapp.c robtk/ui_gl.c robtk/pugl/pugl_x11.c \
	 `pkg-config --libs  cairo pangocairo pango glu gl alsa` -lX11 -lm
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Package pango was not found in the pkg-config search path.
Perhaps you should add the directory containing `pango.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pango' found
Package glu was not found in the pkg-config search path.
Perhaps you should add the directory containing `glu.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glu' found
Package alsa was not found in the pkg-config search path.
Perhaps you should add the directory containing `alsa.pc'
to the PKG_CONFIG_PATH environment variable
No package 'alsa' found
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Package pangocairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pangocairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pangocairo' found
Package pango was not found in the pkg-config search path.
Perhaps you should add the directory containing `pango.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pango' found
Package glu was not found in the pkg-config search path.
Perhaps you should add the directory containing `glu.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glu' found
Package gl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gl' found
Package alsa was not found in the pkg-config search path.
Perhaps you should add the directory containing `alsa.pc'
to the PKG_CONFIG_PATH environment variable
No package 'alsa' found
robtk/ui_gl.c:77:10: fatal error: GL/glu.h: No such file or directory
 #include <GL/glu.h>
          ^~~~~~~~~~
compilation terminated.
Makefile:33: recipe for target 'scarlett-mixer' failed
make: *** [scarlett-mixer] Error 1

Mixer not startin with 6i6

make

gave me

cc  \
	-o scarlett-mixer \
	-DVERSION=\"0.1.0-21\" \
	-g -Wall -Wno-unused-function -I. -Irobtk/ `pkg-config --cflags cairo pango lv2 glu alsa` -pthread -DDEFAULT_NOT_ONTOP -std=c99 \
	-DXTERNAL_UI -DHAVE_IDLE_IFACE -DRTK_DESCRIPTOR=lv2ui_descriptor \
	-DPLUGIN_SOURCE=\"src/scarlett_mixer.c\" \
	-DAPPTITLE="\"Scarlett Mixer\"" \
	robtk/robtkapp.c robtk/ui_gl.c robtk/pugl/pugl_x11.c \
	 `pkg-config --libs  cairo pangocairo pango glu gl alsa` -lX11 -lm

When I type now:
./scarlett-mixer -v
it gives:

Autodetect: Using "hw:2"
Speicherzugriffsfehler (Speicherabzug geschrieben) 

And typing ./scarlett-mixer hw:2
gives
scarlett-mixer: simple.c:914: snd_mixer_selem_get_enum_items: Assertion elem' failed.`

Save and load mixer settings

When I disconnect and reconnect my Scarlett 18i6, it loses all the mixer settings I applied with this app. Is it possible to restore them (either using scarlett-mixer or some other tool)?

robtk content missing?

scherbi@scarlett ~/s/scarlett-mixer> make
make: *** No rule to make target 'robtk/robtkapp.c', needed by 'scarlett-mixer'. Stop.

Segfault using Scarlett 18i8

Unfortunately I get a segfault on my system:

$./scarlett-mixer     
[1]    4596 segmentation fault (core dumped)  ./scarlett-mixer

aplay shows:

card 3: USB [Scarlett 18i8 USB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Stacktrace:

gdb -q scarlett-mixer
Reading symbols from scarlett-mixer...
(gdb) r
Starting program: /home/ottodavid/scarlett-mixer/scarlett-mixer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff79ec5a0 in snd_mixer_selem_get_enum_items () from /usr/lib/libasound.so.2
(gdb) bt
#0  0x00007ffff79ec5a0 in snd_mixer_selem_get_enum_items () at /usr/lib/libasound.so.2
#1  0x0000555555575ecd in toplevel (ui=0x5555555a9ad0, top=0x5555555a91f0) at ./src/scarlett_mixer.c:1011
#2  0x0000555555577f79 in instantiate
    (ui_toplevel=0x5555555a91f0, descriptor=0x555555585ce0 <gl_descriptor>, plugin_uri=0x55555557e0cd "URI TODO", bundle_path=0x0, write_function=0x0, controller=0x0, widget=0x5555555a9298, features=0x7fffffffde90)
    at ./src/scarlett_mixer.c:1449
#3  0x000055555557ba8e in gl_instantiate (descriptor=0x555555585ce0 <gl_descriptor>, plugin_uri=0x55555557e0cd "URI TODO", bundle_path=0x0, write_function=0x0, controller=0x0, widget=0x555555586dc0 <extui>, features=0x7fffffffde90)
    at robtk/ui_gl.c:1490
#4  0x0000555555559040 in main (argc=1, argv=0x7fffffffdfb8) at robtk/robtkapp.c:218

make not working

problems with make

cd scarlett.mixer
bash: cd: scarlett.mixer: File o directory non esistente
cd scarlett-mixer
 git submodule init
Sottomodulo 'robtk' (https://github.com/x42/robtk) registrato per il percorso 'robtk'
 git submodule update
Clone in '/opt/scarlett-mixer/robtk' in corso...
Percorso del sottomodulo 'robtk': eseguito checkout di '05eb4b8398cfd74b30d1d608e169362119c9c7e5'
make
cc  \
	-o scarlett-mixer \
	-DVERSION=\"0.1.0-30\" \
	-g -Wall -Wno-unused-function -I. -Irobtk/ `pkg-config --cflags cairo pango lv2 glu alsa` -pthread -DDEFAULT_NOT_ONTOP -std=c99 \
	-DXTERNAL_UI -DHAVE_IDLE_IFACE -DRTK_DESCRIPTOR=lv2ui_descriptor \
	-DPLUGIN_SOURCE=\"src/scarlett_mixer.c\" \
	-DAPPTITLE="\"Scarlett Mixer\"" \
	robtk/robtkapp.c robtk/ui_gl.c robtk/pugl/pugl_x11.c \
	 `pkg-config --libs  cairo pangocairo pango glu gl alsa` -lX11 -lm
robtk/robtkapp.c:36:10: fatal error: lv2/lv2plug.in/ns/lv2core/lv2.h: File o directory non esistente
   36 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from robtk/ui_gl.c:101:
robtk/robtk.h:34:10: fatal error: lv2/lv2plug.in/ns/extensions/ui/ui.h: File o directory non esistente
   34 | #include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:33: scarlett-mixer] Errore 1

running ubuntu 20

Missing switch for clock source

Thanks for this project, it actually made me buy a 18i6 ;-)
One missing thing is a switch for the clock source (internal/ADAT/SPDIF). For now I can use the alsamixer to select it, but I think this could be done with a few lines of code.

Unfortunately I don't have time at the moment to get familiar with the code, so this is just for the record. Maybe @x42 it is quite simple for you to add this selector.

Thanks for all your great tools.
Sebastian

French manpage

Would you be interested about a French translation of the man page?

Assertion `elem` failed - simple.c:914

I am trying to get set up with a Scarlett 18i20 on Ubuntu 20.04 and successfully compiled the latest scarlett-mixer. But, when I launch ./scarlett-mixer as my user or with sudo I get an assertion elem error:

user@system:~/$ ./scarlett-mixer 
scarlett-mixer: simple.c:914: snd_mixer_selem_get_enum_items: Assertion `elem' failed.
Aborted (core dumped)

user@system:~/$ sudo ./scarlett-mixer 
scarlett-mixer: simple.c:914: snd_mixer_selem_get_enum_items: Assertion `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.
Aborted

Could this be due to something I'm doing wrong in running the compiled binary or how I've compiled it?

Command to verify the kernel support

Hi ! The README states that

the device must be supported by the ALSA Linux kernel device-driver

I'm wondering how can one make sure that it is ? I'm running a vanilla Ubuntu kernel, should I do anything to it?
Thanks!

8i6 3rd gen: simple.c:920: snd_mixer_selem_get_enum_items: Assertion `elem' failed

Hi! 👋🏼 Thanks for what appears to be an incredibly useful package for using the Scarlett interfaces on Linux! 🙏🏼

Issue

When trying to start this up with a 3rd gen 8i6 interface connected, I get the following output:

scarlett-mixer: simple.c:920: snd_mixer_selem_get_enum_items: Assertion `elem' failed.
fish: Job 1, 'scarlett-mixer' terminated by signal SIGABRT (Abort)

When running it with a double --verbose flag, I get this output:

* hw:0 "Scarlett 8i6 USB"
Autodetect: Using "hw:0"
CMP 8
--- Device: Scarlett 8i6 USB
Matrix: in=0, out=0, off=0, stride=0
Matrix: input-select=0, select-stride=0
Inputs: ins=0 select-offset=0
Masters: n_mst=0 n_out-select=0
Switches: n_pad=0, n_hiz=0
hiz_map = {-1, -1, };
pad_map = {-1, -1, -1, -1, };
out_gain_map = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };
out_gain_labels = {, , , , , , , , , , };
out_bus_map = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };
---
--- Device: Scarlett 8i6 USB
Matrix: in=8, out=8, off=20, stride=8
Matrix: input-select=84, select-stride=1
Inputs: ins=10 select-offset=0
Masters: n_mst=0 n_out-select=6
Switches: n_pad=2, n_hiz=2
hiz_map = {15, 18, };
pad_map = {16, 19, -1, -1, };
out_gain_map = {10, 11, 12, 13, -1, -1, -1, -1, -1, -1, };
out_gain_labels = {Headphone 1L, Headphone 1R, Headphone 2L, Headphone 2R, SPDIF/L, SPDIF/R, , , , , };
out_bus_map = {92, 93, 94, 95, 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };
---
scarlett-mixer: simple.c:920: snd_mixer_selem_get_enum_items: Assertion `elem' failed.
fish: Job 1, 'scarlett-mixer --verbose --verb…' terminated by signal SIGABRT (Abort)

Do you know what might be going wrong here?

Technical details

  • OS: NixOS 22.11
  • Computer: Dell XPS 15
  • Interface: Focusrite Scarlett 8i6 3rd gen

Additional question

Regarding the meson build: I've never used that system before, so I had some issues with it not installing correctly. I got some help and by adding install: true to the executable funcion, it installs correctly. I don't know if this is an issue on non-NixOS systems, but I was wondering whether it's something you'd accept a PR for if it's interesting? If not, I'll just leave it in my fork 🤷🏼

snd_mixer_selem_get_enum_items: Assertion `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed

I'm on Ubuntu 18.04, kernel 5.4.0-96-generic.

I have installed build dependencies like so:

sudo apt-get build-dep x42-plugins
sudo apt install -y libasound2-dev

I am able to run make and compile the program.

However, when it starts, it immediately exits:

scarlett-mixer: simple.c:914: snd_mixer_selem_get_enum_items: Assertion `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.

The device is a Scarlett 18i8 and has a USB ID of 1235:8214.

Are there any other prerequisites that I am not aware of?

Scarlett 18i20 2nde Gen not supported

Hi,

Just to mention the scarlett 18i20 1st gen fully supported, but the 2nd gen isn't supported (it seems to be a lack in ALSA more than scarlett-mixer, but I think it has to be mentioned in this github repos for other usres).

Here is the output from the scarlett-mixer command :

/scarlett-mixer hw:3 -p
Device `Scarlett 18i20 USB' has 4 contols: 
 0 ADAT Validity, PBS
 1 Clock Source, ENUM
 2 Internal Validity, PBS
 3 S/PDIF Validity, PBS
scarlett-mixer: simple.c:914: snd_mixer_selem_get_enum_items: Assertion `elem' failed.
Abandon (core dumped)

Segmentation fault - 18i20

When I try to run

./scarlett-mixer -v

I receive this msg:

Autodetect: Using "hw:3"
Segmentation fault
aplay -l

card 3: USB [Scarlett 18i20 USB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

OS: KXStudio

Distributor ID: Ubuntu
Description: Ubuntu 14.04.6 LTS
Release: 14.04
Codename: trusty

Assertion `snd_mixer_selem_is_enumerated (c->elem)' failed.

I'm trying to run this mixer in Arch but without success.

4.14.15-1-ARCH #1 SMP PREEMPT Tue Jan 23 21:49:25 UTC 2018 x86_64 GNU/Linux

$ ./scarlett-mixer hw:2
scarlett-mixer: ./src/scarlett_mixer.c:492: get_enum: Assertion `snd_mixer_selem_is_enumerated (c->elem)' failed.
Aborted (core dumped)

I think I have all the libraries needed. Libpango and libcairo is named pango and cairo in Arch.

Any idea what could cause this?

fails to exit on Fedora 35

After installing these make dependencies, this mixer seems to work great! However, it fails to exit/close properly.
dnf install cairo-devel pango-devel mesa-libGLU-devel lv2-devel

After starting from CLI, it outputs a "caught signal" message but never exits and frees the console after click the X icon to terminate the GUI window. But I see no other GUI artifact on the screen or in taskbar.

[tbowling@tbowling scarlett-mixer]$ ./scarlett-mixer 
caught signal - shutting down.

To resolve, I had to open a new terminal, and kill <PID>

Segfault with Gen2 18i20

When I run scarlett-mixer with a Scarlett 18i20 (gen2) attached, I get a segfault on Arch Linux:

$ scarlett-mixer 
zsh: segmentation fault (core dumped)  scarlett-mixer

I've attached an strace as well:
scarlett-mixer-18i20-strace.txt

Let me know if there is anything else I can do or provide to help troubleshoot the issue.
Thanks again for this project!

Installation problem

I have followed the bash commands in the README. However, when I do ./scarlett-mixer hw:2 I will only see:

Device `hw:2' is not supported
Error: GUI was not initialized.
bye.

I am trying to use my Scarlett 18i8 and I am using 18.04 ubuntu.

Strange mixer matrix behavior using Scarlett 18i8 2nd gen

Hi all!
In these days I did some test of the mixer with my Scarlett 18i8 2nd gen on Ubuntu 20.04 LTS (notebook Samsung NP370R5E, Kernel Linux 5.4.0-58-lowlatency x86_64); the scarlett internal mixer control capability is very powerful, and let me effectively use an old laptop to track my band (when the pandemic will let us to play together again, at least...) using Ardour.

But I found a strange behavior in the mixer control matrix: let r for row and c for column, controls seems to be linked <r,c> and <r+10, c-1>. So when I move knob at <1,2> the knob at <11,1> moves too... the 'link' doesn't depend on source or capture selection.

link

From my test, scarlett internal mixer seems to respond coherently to what is shown in the GUI, so the input-output mapping is predictable; for example, if I select the same source for two linked knob, then that source gets 6 more dB. But full independent control for more than 10 sources is not possible...

double-level

Tried to dig a bit in the sources to find some clue but I'm not sure to understand how structs parameters affect the controls...

Seems that someone else here is using 18i8... have you ever experienced same issue? Is it a known problem (I apologize if so...)?

Thanks
Greetings form Italy

Giampietro

PS: There is some minor cosmetics issue too (knob bottom left is Headphone 2R...)

18i20 debug output

STDERR:
Device hw:2' is not supported Device Scarlett 18i20 USB' has 214 contols:
Error: GUI was not initialized.
bye.
STDOUT:
18i20.txt

Clarett USB?

How hard would it be to add the clarett usb series of devices to this?

‘for’ loop initial declarations are only allowed in C99 mode

Hello. While trying to compile the code, I had many errors like this:

‘for’ loop initial declarations are only allowed in C99 mode

resulting in the compilation failing.

Adding -std=c99 to the CFLAGS in the Makefile resolved the issue and the code got compiled succesfully.

log.txt

Thanks,
George

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.