Is it possible to use the Dell AC511 volume knob under Slackware?
My Dell AC511 speaker has a volume knob. I have been looking in to
whether it can be made usable under Slackware. With pulseausio running, the output from pacmd list-sources >t1 includes the following. * index: 1 name: <alsa_input.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo> driver: <module-alsa-card.c> flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAM IC_LATENCY state: SUSPENDED suspend cause: IDLE and later alsa.driver_name = "snd_usb_audio" I issued parecord\ --device="alsa_input.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo"\ --raw parecord.dat twice, and let it run for ~5 seconds, the first time without turning the knob, and the second with turning it. Both time the result was ~1M of 0's. Question 1: Is this the knob device? Question 2: Is there a driver for this device? Question 3: Why isn't there any data? Question 4: What is the format of a volume knob data stream? Some further information. lsmod lists snd_usb_audio. PA_SOURCE_HW_VOLUME_CTRL is defined in /usr/include/pulse/def.h |
The simplest way I have found to get my remote working after someone removed the code i needed for ir-keytable is was with evemu https://slackbuilds.org/repository/1...lopment/evemu/
After install run Code:
evemu-describe Code:
evtest /dev/input/event[YOUR EVENT] |
won't record event
From event-describe, choose soundbar:
# Event type 1 (EV_KEY) # Event code 113 (KEY_MUTE) # Event code 114 (KEY_VOLUMEDOWN) # Event code 115 (KEY_VOLUMEUP) evemu-record /dev/input/event115 e115cl.dat error: could not open device (No such file or directory) cd /dev/event ls eventX for X from 0 to 12 are there |
can you copy and paste the output from evemu-describe and evtest.
|
I'm still doing research, but here's some additional information.
evtest is not in evemu; you can get it from https://gitlab.freedesktop.org/libevdev/evtest https://stackoverflow.com/questions/6990978/ how-can-i-know-which-of-the-dev-input-eventx-x-0-7-have-the-linux-input-stre has useful information. E.g., cat /proc/bus/input/devices produces as one item: I: Bus=0003 Vendor=413c Product=a503 Version=0100 N: Name="Dell Dell AC511 USB SoundBar" P: Phys=usb-0000:00:14.0-4/input3 S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.3/0003:413C:A503.0001/i nput/input13 U: Uniq= H: Handlers=kbd event10 B: PROP=0 B: EV=13 B: KEY=e0000 0 0 0 B: MSC=10 I'm going to play around with evtest and I'll post any further information. I'm also going to read https://www.kernel.org/doc/html/late...ent-codes.html |
I got evtest working to monitor the volume knob. This answers my original
questions, but raises new ones: Question 5. Is there a client that processes these events? Question 6. If not, how do I write one? Some details of the evtest run are as follows. An easy way to determine the event number, at least in this case, is: ls -l /dev/input/by_id The output includes usb-Dell_Dell_AC511_USB_SoundBar-event-if03 -> ../event10 Issuing evtest /dev/input/event10 >evtest_10.txt produced a file containing Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x413c product 0xa503 version 0x100 Input device name: "Dell Dell AC511 USB SoundBar" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 113 (KEY_MUTE) Event code 114 (KEY_VOLUMEDOWN) Event code 115 (KEY_VOLUMEUP) Event type 4 (EV_MSC) Event code 4 (MSC_SCAN) Then for clockwise turning of the knob some event 6-tuples Event: time 1631328591.666299, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9 Event: time 1631328591.666299, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1 Event: time 1631328591.666299, -------------- SYN_REPORT ------------ Event: time 1631328591.682284, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9 Event: time 1631328591.682284, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0 Event: time 1631328591.682284, -------------- SYN_REPORT ------------ Then for counter-clockwise turning of the knob some event 6-tuples Event: time 1631328593.890272, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00ea Event: time 1631328593.890272, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1 Event: time 1631328593.890272, -------------- SYN_REPORT ------------ Event: time 1631328593.906276, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00ea Event: time 1631328593.906276, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0 Event: time 1631328593.906276, -------------- SYN_REPORT ------------ |
Sorry its been a while I was assuming they was from the same package. I opted use them as they show keycodes that are above 255 so would have helped if the code was incorrect.
From a quick google it looks like client is the volume widget. Do you have one on your taskbar? If not try adding one. |
I use xterm's and don't have a volume widget. I think these (e.g. alsamixer)
use controls (e.g. sliders) in the window and don't monitor the volume knob. I have been using amixer from the command line. This works fine, except if you try to adjust the volume while audacious is playing an internet radio station audacious starts reporting errors and quits. https://www.kernel.org/doc/html/latest/input/input.html states the following: USB uses HID also for monitor controls, speaker controls, UPSs, LCDs and many other purposes. The monitor and speaker controls should be easy to add to the hid/input interface So it's surprising that no one seems to use this feature. From what I've read you might be able to write a simple app using the volume knob, using unix open, read, write, ioctl, etc. If I succeed in doing this I'll post it. An app that goes through ALSA might be better. Meanwhile I guess the thread should be marked "solved". |
I use a script to start/stop my media player which among other things mutes/de-mutes using pamixer https://github.com/cdemoulins/pamixer (part of a full install).
Code:
pamixer -m Code:
amixer -D pulse set Master 5%+ --> (Volume Up) |
Well I have to admit this got me curious so i did a little more playing in /var/log/messages I have root: ACPI action volumedown is not defined so a quick look into that and its possible to set them in /etc/acpi/acpi_handler.sh
Gazl has described how he sets it up here https://www.linuxquestions.org/quest...ns-4175624572/ If you can it maybe better to rename this thread to better reflect the issue now we know the buttons work. |
Here's a reference for xterm bindings.
https://utcc.utoronto.ca/~cks/space/...termKeybinding If you run xev, put the pointer in the window, and turn the knob you get some events as follows: KeyPress event, serial 40, synthetic NO, window 0x2800001, root 0xd6, subw 0x0, time 35197727, (102,137), root:(143,232), state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, |
problem with C program
I've run in to a problem while trying to get a C volume knob monitor running.
Once I detect a knob event, I call adj_vol(c), with c=+1 for up, c=-1 for down. Here is the code in its present state. /*This was swiped from https://stackoverflow.com/questions/6787318/ set-alsa-master-volume-from-c-code */ static void adj_vol(int c) { snd_mixer_t *mix_h; snd_mixer_selem_id_t *sid; const char *card = "default"; const char *selem_name = "Master"; snd_mixer_elem_t* elem; /*open an empty mixer handle*/ if (snd_mixer_open(&mix_h, 0)<0) goto erxit; /*attach the card to it*/ if (snd_mixer_attach(mix_h, card)<0) goto erxit; /*register it*/ if (snd_mixer_selem_register(mix_h, NULL, NULL)<0) goto erxit; /*load its elements*/ if (snd_mixer_load(mix_h)<0) goto erxit; /*allocate an element ID (on the stack)*/ snd_mixer_selem_id_alloca(&sid); /*set its index part*/ snd_mixer_selem_id_set_index(sid, 0); /*set its name part*/ snd_mixer_selem_id_set_name(sid, selem_name); /*find the element*/ if ((elem=snd_mixer_find_selem(mix_h, sid))<0) goto erxit; {long lv,rv; if (snd_mixer_selem_get_playback_volume(elem,SND_MIXER_SCHN_FRONT_LEFT,&lv) <0) goto erxit; /*DEBUG*/ printf("L=%li\n",lv); if (snd_mixer_selem_get_playback_volume(elem,SND_MIXER_SCHN_FRONT_RIGHT,&rv) <0) goto erxit; /*DEBUG*/ printf("R=%li\n",rv); } snd_mixer_close(mix_h); return; erxit: ... } When I run this, it doesn't report any error, but prints incorrect values for the volume levels. In one run, it printed L=30129 R=30129 "amixer get Master" prints Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 65536 Mono: Front Left: Playback 18535 [28%] [on] Front Right: Playback 18535 [28%] [on] I've traced through the axmixer code, even run it under gdb, and it seems to be doing what my program does. I ran amixer under gdb with the invocation "amixer set Master 3%+", and set a breakpoint at line 368 of amixer.c (of the slackware 14.2 version of alsa-utils). Stepping through the call, the value of "orig" is 18535. I'm wondering whether this is a pulseaudio issue. After a fresh system startup, pulseaudio is not running. Turning the knob with my program running starts it. pactl list sinks shows Sink #0 State: SUSPENDED Name: alsa_output.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo Description: Dell AC511 USB SoundBar Analog Stereo Driver: module-alsa-card.c Sample Specification: s16le 2ch 44100Hz Channel Map: front-left,front-right Owner Module: 6 Mute: no Volume: front-left: 18535 / 28% / -32.91 dB, front-right: 18535 / 28% / -32.91 dB balance 0.00 Base Volume: 107931 / 165% / 13.00 dB Monitor Source: alsa_output.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo.monitor Latency: 0 usec, configured 0 usec Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY ... |
I have such a speaker, the knob works properly.
Slackware-current, kde, pulseaudio. Code:
1. odpływ |
This might be because KDE has a process monitoring the knob. I found one relevant post:
https://askubuntu.com/questions/1211...et-how-to-load I don't use KDE, and would like to get a simple light-weight monitor working. |
I think that lxqt will start.
https://github.com/lxqt There is a module pavucontrol-qt version 0.17.0 is already available I used to have lxqt but not tested. https://github.com/marco70-ms/slackb...tree/main/lxqt |
All times are GMT -5. The time now is 10:15 AM. |