Open nicolaiort opened 4 years ago
@Niggl1999 Please try running with sudo -u [YOUR-USERNAME] python LPHK.py
and report back.
First: Sorry for answering with such a huge delay.
Onto the topic: I updated to the newest version of LPHK via the linux beta installation script. And then followed your request for starting as my own user via sudo:
sudo -u niggl python Downloads/LPHK-master/LPHK.py
ALSA lib confmisc.c:767:(parse_card) cannot find card 'CODEC'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM sysdefault
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "Downloads/LPHK-master/LPHK.py", line 58, in <module>
main()
File "Downloads/LPHK-master/LPHK.py", line 53, in main
init()
File "Downloads/LPHK-master/LPHK.py", line 33, in init
sound.init(PATH)
File "/home/niggl/Downloads/LPHK-master/sound.py", line 16, in init
m.init()
pygame.error: No available audio device
@Niggl1999 Apparently there is no way around the fact that keyboard
and pynput
don't work outside of root. However, in root, usually either the display device, audio device, or both are unavailable.
I am pretty happy with the Windows version now, so I am currently developing the Linux version. If anyone has any ideas, let me know. Otherwise, I'll update you when I figure something out.
EDIT: FYI I added more elegant error handling and logging in the newest release, I would suggest using that so the program crashes less.
For unrelated reasons, I have decided to move from the keyboard
library to the pyautogui
library. keyboard
explicitly states root requirements for Linux, but pyautogui
doesn't mention it. Here's to hoping it fixes it!
I'm hoping this will fix many issues, including #7 , and perhaps #16 as well (if it isn't just a single-user issue). I am not certain if #11 is related, but I suspect the library switch will probably fix it as well.
The basic steps to the error where:
The following error occurs when i press the left, light up and down keys:
Trying to start LPHK with sudo brings a whole other problem along (tried it as suggested by @nimaid ):
My setup is:
Please comment if additional information is needed - I'll try to respond asap.