USB volume controll not working in retropie
-
@mitu you absolute gent. This is the way. I have got triggerhappy changing the volume in reaction to the pot, the pieces all work. but nothing is happing "on boot" would you mind helping me configure triggerhappy? I think I am almost there.
I found these instructions to be a little more in-depth, and so far, I have:
Created
/etc/triggerhappy/triggers.d/audio.conf
which contains:KEY_VOLUMEUP 1 /usr/bin/amixer -c 1 set PCM 5%+ KEY_VOLUMEDOWN 1 /usr/bin/amixer -c 1 set PCM 5%-
you were right about needing to specify a card
and running
thd --triggers /etc/triggerhappy/triggers.d/ /dev/input/event*
produces events:Executing trigger action: /usr/bin/amixer -c 1 set PCM 5%- Simple mixer control 'PCM',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 37 Mono: Front Left: Playback 35 [95%] [-2.00dB] [on] Front Right: Playback 35 [95%] [-2.00dB] [on] Executing trigger action: /usr/bin/amixer -c 1 set PCM 5%+ Simple mixer control 'PCM',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 37 Mono: Front Left: Playback 37 [100%] [0.00dB] [on] Front Right: Playback 37 [100%] [0.00dB] [on]
And then upon checking
alsamixer
the audio volume has indeed changed, so we have volume control via pot! very excitedHowever I can't quite work out the steps to get the instructions in my .conf into the deamon proper, not entirely sure what daemons and sockets are, will be busy reading up.
Thanks again so much for your incredible help!
-
@jameth said in USB volume controll not working in retropie:
but nothing is happing "on boot" would you mind helping me configure triggerhappy?
As far as I recall, the
triggerhappy
service should be started on boot automatically, but I don't have a Pi available right now to confirm.Run
systemctrl status triggerhappy.service
and post the output.
-
@mitu ah sorry, so, triggerhappy is up and running, but it's not "looking" at my config file, its not just a case of dropping in a correctly named file in an appropriate directory.
ill do some more digging and reading up. if i get it working ill be sure to post my steps.
-
@jameth said in USB volume controll not working in retropie:
@mitu ah sorry, so, triggerhappy is up and running, but it's not "looking" at my config file, its not just a case of dropping in a correctly named file in an appropriate directory.
See how the service is started, the
systemctl
command for status should tell you - may you need to add the lines to the main.conf
file and not in a separate file. -
pi@retropie:~ $ systemctl status triggerhappy.service ● triggerhappy.service - triggerhappy global hotkey daemon Loaded: loaded (/lib/systemd/system/triggerhappy.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2022-08-17 12:11:15 BST; 1min 20s ago Main PID: 355 (thd) Tasks: 1 (limit: 414) CGroup: /system.slice/triggerhappy.service └─355 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event* Aug 17 12:11:14 retropie systemd[1]: Starting triggerhappy global hotkey daemon... Aug 17 12:11:14 retropie thd[355]: Found socket passed from systemd Aug 17 12:11:15 retropie systemd[1]: Started triggerhappy global hotkey daemon.
so its all up and running, but I feel like my .conf isn't being "loaded in", theres a
th-cmd --add
command listed in the instructions, but the paths they use in the example don't make sense to me :s -
Seems to be an issue with the user used by the service - see https://retropie.org.uk/forum/topic/18133/triggerhappy-daemon-thd-doesn-t-work-on-my-pi-running-retropie-help/31.
You may be able to change it by running
sudo systemctl edit triggerhappy.service
an editor session will open, you need to add the following lines:
[Service] ExecStart= ExecStart=/usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user pi --deviceglob /dev/input/event*
and then save and exit. Restart the service with:
sudo systemctl restart triggerhappy
and see if the commands are taking effect.
-
you've done it.
it works!
I can now change the volume in a game, and this persists through power off/on.
I cannot tell how much this means to me. thank you so much for your support.
I will read up on the post you linked and post a conclusion before marking [solved]
-
Hi, I know this is quite an old thread but I have followed all of the steps and I am still not able to get it to work as I get a permission denied error and I can't get passed it.
This is what I get I run the command:pi@retrocade:~$ sudo /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --user pi --deviceglob /dev/input/event*
Executing trigger action: /usr/bin/amixer set Master 2%+
Executing trigger action: /usr/bin/amixer set Master 2%+
Home directory not accessible: Permission denied
W: [pulseaudio] core-util.c: Failed to open configuration file '/root/.config/pulse//daemon.conf': Permission denied
W: [pulseaudio] daemon-conf.c: Failed to open configuration file: Permission denied
amixer: Unable to find simple control 'Master',0Can you please help me @mitu ?
Thanks!
-
@mitu for some reason, I only get the permission denied via ssh. If I execute: /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --user pi --deviceglob /dev/input/event* from the desktop (PIXEL) locally it works perfectly, however when I boot normally into retropie, I turn the knob and nothing happens.
If I go back to the pixel desktop, run the command and launch emulationstation from the terminal it also works.
However, when I reboot and goes back again into retropie, it doesn't work anymore. From retropie I have to go back to the pixel desktop, run the command in terminal and launch emlationstation.For background information, I tried with the triggerhappy.service and it didn't work, so I disabled it and added: nohup /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --user pi --deviceglob /dev/input/event* & to rc.local as you suggested in your previous thread.
-
Hi @mitu,
While I wait for your help, I tried in to insert nohup /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --user pi --deviceglob /dev/input/event* & into autostart.sh, but checking ps -ef, the process is not running. I'm not sure I am doing it right.
When inserted into rc.local, checked ps -ef and it's listed there.Thanks!
-
Hi @mitu, I keep digging and find strange stuff, look at this...
pi@retrocade:~$ sudo amixer scontrols Simple mixer control 'HDMI',0 pi@retrocade:~$ amixer scontrols Simple mixer control 'Master',0 Simple mixer control 'Capture',0
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.