Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion elem failed - simple.c:914 #19

Open
JCruk opened this issue Jun 23, 2020 · 7 comments
Open

Assertion elem failed - simple.c:914 #19

JCruk opened this issue Jun 23, 2020 · 7 comments

Comments

@JCruk
Copy link

JCruk commented Jun 23, 2020

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?

@x42
Copy link
Owner

x42 commented Jun 23, 2020

Are you using a 1st generation Scarlett device?
If not, this is likely the same as #16

@x42
Copy link
Owner

x42 commented Jun 23, 2020

The output of ./scarlett-mixer -vv --print-controls may be helpful if someone were to add support for other devices.

@lazzarello
Copy link

lazzarello commented Jul 30, 2020

Same for me but with a 18i8 on the same version of Ubuntu. My guess is it's the empty elements in the out_gain_labels array? This is my first time looking at this output tho 🤷

lee@henry:~/src/bela/scarlett-mixer$ ./scarlett-mixer -vv --print-controls
* hw:0 "HDA Intel PCH"
* hw:1 "HDA NVidia"
* hw:2 "Display Audio"
* hw:3 "Bela"
* hw:4 "Scarlett 18i8 USB"
Autodetect: Using "hw:4"
Device `Scarlett 18i8 USB' has 1 contols: 
 0 'Clock Source Clock Source', ENUM
CMP 18
--- Device: Scarlett 18i8 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 18i8 USB
Matrix: in=18, out=8, off=40, stride=9
Matrix: input-select=39, select-stride=9
Inputs: ins=18 select-offset=20
Masters: n_mst=4 n_out-select=8
Switches: n_pad=4, n_hiz=2
hiz_map = {15, 17, };
pad_map = {16, 18, 19, 20, };
out_gain_map = {1, 4, 7, 10, -1, -1, -1, -1, -1, -1, };
out_gain_labels = {Monitor, Headphone 1, Headphone 2, SPDIF, , , , , , , };
out_bus_map = {2, 3, 5, 6, 8, 9, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };
---
scarlett-mixer: simple.c:914: snd_mixer_selem_get_enum_items: Assertion `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.
Aborted (core dumped)

@lazzarello
Copy link

lazzarello commented Jul 30, 2020

Confirmed it's not the same as #16

I have a Gen2 as reported by the driver but the USB Product ID is different. It says it is a

[Thu Jul 30 01:05:08 2020] usb 1-1.3: new high-speed USB device number 8 using ehci-pci
[Thu Jul 30 01:05:08 2020] usb 1-1.3: New USB device found, idVendor=1235, idProduct=8204, bcdDevice= 4.34
[Thu Jul 30 01:05:08 2020] usb 1-1.3: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[Thu Jul 30 01:05:08 2020] usb 1-1.3: Product: Scarlett 18i8 USB
[Thu Jul 30 01:05:08 2020] usb 1-1.3: Manufacturer: Focusrite
[Thu Jul 30 01:05:08 2020] usb 1-1.3: SerialNumber: 00033431
[Thu Jul 30 01:05:08 2020] usb 1-1.3: Focusrite Scarlett Gen 2 Mixer Driver disabled; use options snd_usb_audio device_setup=1 to enable and report any issues to [email protected]

I added options snd_usb_audio vid=0x1235 pid=0x8204 device_setup=1 to /etc/modprobe.d/scarlett.conf

And I got an error message, which I assume is something caused by the module options not being applied as intended?

[Thu Jul 30 01:16:15 2020] usb 1-1.3: Scarlett Gen 2 USB response result cmd 0 was -110
[Thu Jul 30 01:16:15 2020] snd-usb-audio: probe of 1-1.3:1.0 failed with error -22

Might be time to email g at b4.vu ? I'll look at the source for this too. The segfault seems like it would be trying to access array elements past its length, right?

If it helps, kernel version/module path

filename:       /lib/modules/5.4.0-42-generic/kernel/sound/usb/snd-usb-audio.ko
license:        GPL
description:    USB Audio
author:         Takashi Iwai <[email protected]>
srcversion:     47C947C0C803DEC837E7FAB

Full kernel string is Linux henry 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

@lazzarello
Copy link

Whelp, I emailed the author of the driver and we determined that my problem is the same as #16 . But an unrelated problem was my driver wouldn't load with the mixer option because the hub it was attached to is inside an Apple Thunderbolt 2 display, connected to a Thunderbolt 3 adapter, connected to the USB-C port of a Thinkpad. That's a mouthful but somehow it doesn't work with this device.

I don't think it's a bandwidth problem since the same hub attached to a Macbook Pro without the hardware adapter works as expected. So yeah...hardware problem. Everything is fine.

@x42
Copy link
Owner

x42 commented Jul 31, 2020

according to #16 (comment) it works after the driver is force loaded.

@lazzarello
Copy link

lazzarello commented Jul 31, 2020

Yeah, it works with the device_setup=1 option. The GUI isn't mapping parameters correctly for the mixer matrix. That might be a thing I can fix. I think this issue could be closed since the driver needs that option for > Gen1 devices, which is specified in that issue with more detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants