commander-keen n00b
Joined: 09 Oct 2013 Posts: 47 Location: Europe
|
Posted: Wed Nov 22, 2017 5:02 pm Post subject: howto debug alsamixer with gdb to track hardw. bug for wd15 |
|
|
Somewhat specific hardware problem concerning ALSA and the Dell WD15 Dock:
ALSA seems to have a bug that prevents selecting the Dell WD15 dock as output device.
The WD15 is a USB-C docking station by dell, here is what is look like:
http://kbimg.dell.com/library/KB/DELL_ORGANIZATIONAL_GROUPS/DELL_GLOBAL/REC/FY2017/Dell-Dock-USB-Type-C.PNG
So as you can see it has two audio jacks, one for headset (front, labeled 10) one pure output on the rear (labeled 7)
While most of the docks connectors worked out of the box, the audio jacks make alsamixer crash (eg if selected from alsamixer with F6)
Output is:
Code: | cannot load mixer controls: Invalid argument |
I am not the first to discover or report this issue. However it seems there is no real solution out yet.
The only workaround I found is to delegate the audio routing to pulseaudio. There is a patch for arch linux here:
https://github.com/edrose/dell-dock-audio-fix
https://bbs.archlinux.org/viewtopic.php?id=230520
I tried it, but found pulseaudio a bit tedious to set up plus it made my alsamixer freeze for 10 secs on every startup.
So lately I would rather find out why alsa crashes and hopefully fix that instead of going for pulseaudio.
Here is what I have tried so far:
(1, 2 are IMHO dead ends, you may want to scroll down to 3...)
1) Have had a look at syslog: // No further log entry :-(
2) traced the files that alsamixer touches shortly before crashing: (IMHO only last 6 lines are relevant)
Code: |
execve("/usr/bin/alsamixer", ["alsamixer"], [/* 55 vars */]) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib/tls/x86_64/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib/tls/x86_64", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib/tls/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib/tls", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib/x86_64/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib/x86_64", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib64/tls/x86_64/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib64/tls/x86_64", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib64/tls/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib64/tls", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib64/x86_64/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib64/x86_64", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/opt/cuda/lib64/libformw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/cuda/lib64", 0x7fffc3f73f50) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
open("/usr/lib64/libformw.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/usr/lib64/libmenuw.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/usr/lib64/libpanelw.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/libtinfow.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/usr/lib64/libasound.so.2", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 4
open("/lib64/librt.so.1", O_RDONLY|O_CLOEXEC) = 4
open("/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 4
stat("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=9665, ...}) = 0
open("/usr/share/alsa/alsa.conf", O_RDONLY) = 4
access("/usr/share/alsa/alsa.conf.d/", R_OK) = 0
stat("/usr/share/alsa/alsa.conf.d/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/share/alsa/alsa.conf.d/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
access("/etc/asound.conf", R_OK) = 0
stat("/etc/asound.conf", {st_mode=S_IFREG|0644, st_size=94, ...}) = 0
open("/etc/asound.conf", O_RDONLY) = 4
access("/home/maex/.asoundrc", R_OK) = -1 ENOENT (No such file or directory)
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 4
open("/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 4
stat("/home/maex/.terminfo", 0x2187170) = -1 ENOENT (No such file or directory)
stat("/etc/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
access("/etc/terminfo/x/xterm", R_OK) = 0
open("/etc/terminfo/x/xterm", O_RDONLY) = 5
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
cannot load mixer controls: Invalid argument
+++ exited with 1 +++
|
Indeed in /usr/share/locale/ the requested pathes were missing. I made symlinks for the language files from the en_GB dir. That changed the output to:
Code: |
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = 4
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = 4
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = 4
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = 4
cannot load mixer controls: Invalid argument
+++ exited with 1 +++
|
tl;dr: Lately it seems like the language selection was not the cause.
3) Recompiled alsa-utils with CXXFLAGS=-g to include debug information, then re-emerged alsa-utils
went to /usr/bin/
- started gdb
--file alsamixer
Code: | Reading symbols from alsamixer...Reading symbols from /usr/lib64/debug//usr/bin/alsamixer.debug...done.
done. |
--ctr-x, a //for source parallel view
-> however gdb tells me:
Code: | No source available |
First question: What am I doing wrong?
Second question: Starting via gdb gave me one more bit of information:
Code: |
Starting program: /usr/bin/alsamixer
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
cannot load mixer controls: Invalid argument
[Inferior 1 (process 3550) exited with code 01]
cli.c:117: No such file or directory.
|
I checked the sources of cli.c around line 117 (here https://searchcode.com/codesearch/view/21948687/) and indeed it looks like there might be a locale issue, again:
Code: |
int main(int argc, char *argv[])
{
setlocale(LC_ALL, "");
#ifdef ENABLE_NLS_IN_CURSES
textdomain(PACKAGE);
#endif
|
However I have not found the cli.c file anywhere in the code that portage compiled locally, also not referenced by the ebuild. So I am a bit stuck :-/
Any help or ideas as always greatly appreciated! |
|