nvdweem / PCPanel

Third party/community managed controller software for the PCPanel (getpcpanel.com) devices.
Other
94 stars 6 forks source link

Arch Linux Install / Flatpak #16

Open HidYn opened 2 years ago

HidYn commented 2 years ago

Hi Guys,

Thank you so much for developing this. I had actually put off ordering a PCPanel as I use Linux but thanks to your hard work I've just ordered one.

I plan to use it on Arch Linux. Would it be possible to have some instructions to install on that or maybe a Flatpak install?

Thanks

nvdweem commented 2 years ago

I've tried Linux a few times but haven't actually switched away from using Windows, so apart from having made the software compatible I'm far from a Linux expert so I'm hoping that the Linux community is knowledgeable enough to make it work :).

There are some instructions on how to install the deb file which has been tested on Ubuntu and another user has tried it on Pop! but that distribution doesn't use pulse_audio by default so it won't allow volume control. That's also where my knowledge kind of stops, I don't know if it's possible to make a distribution use pulse_audio or not or how to control volume on systems that use something else.

I've not used Arch so I'm not sure if that allows installing deb files or if it uses pulse_audio. The software is written in Java so it should be able to run on any Java supporting OS. I'll try to make some time to install an Arch VM and try some things out.

HidYn commented 2 years ago

Thanks for the swift reply!

A lot of Distros are moving towards PipeWire now which is also what Pop! ships and even Ubuntu from 22.10 has switched to it. I believe there is a compatibility layer for Pulse apps. (pipewire-pulse)

https://wiki.archlinux.org/title/PipeWire

If it helps I'm using https://endeavouros.com/ as my Distro which is Arch based but has a nice installer to make things easier.

.deb files are normally exclusive to Debian based Distro's such as Ubuntu/Pop/Mint.

Once again thanks for taking the time to reply.

ghost commented 2 years ago

What a coincidence.. Yesterday tried installing on debian sid but gnome 43 is using wayland with pipewire and only the ui worked. Would love to a see a flatpak or an rpm (for fedora) that works with pipewire.

nvdweem commented 2 years ago

It seems that the package method that is used (jpackage) isn't compatible with Flatpack so I added the jar file as an artifact and some instructions on how to run it.

The software used pactl for controlling the volume, but also pacmd for getting the devices. The latter isn't in the default PipeWire compatibility tools so I changed it's usage to also use pactl. This means that the software should now work when PipeWire is being used.

This was tested with the EndeavourOS build that was given.

ghost commented 2 years ago

It works on Debian-Sid flawlessly! Thank you!

If you are using gnome u need a tray extension otherwise the app is not launching.

nvdweem commented 2 years ago

The tray extension should not be needed anymore, but without a tray icon it's currently not possible to nicely stop the software (but why would you want to ;)). Showing the main panel can be done by just running the software again, it should only keep 1 instance open.

HidYn commented 2 years ago

Just wanted to say my PCPanel arrived and I have it working on Linux thanks to you :)

I am getting some errors in the logs which I think is because I'm on Wayland but everything appears to be working apart from being able to control the volume on 1 process which is Mumble.

2022-11-21T18:40:04.392Z ERROR 1411 --- [Command Handler Thread] com.getpcpanel.cpp.linux.ProcessHelper   : Unable to run process

java.io.IOException: Cannot run program "xdotool": error=2, No such file or directory
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143) ~[na:na]
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073) ~[na:na]
    at com.getpcpanel.cpp.linux.ProcessHelper.lineFrom(ProcessHelper.java:45) ~[classes!/:1.6-SNAPSHOT]
    at com.getpcpanel.cpp.linux.ProcessHelper.getActiveProcessPid(ProcessHelper.java:21) ~[classes!/:1.6-SNAPSHOT]
    at com.getpcpanel.cpp.linux.ProcessHelper.getActiveProcess(ProcessHelper.java:34) ~[classes!/:1.6-SNAPSHOT]
    at com.getpcpanel.cpp.linux.SndCtrlLinux.setFocusVolume(SndCtrlLinux.java:128) ~[classes!/:1.6-SNAPSHOT]
    at com.getpcpanel.commands.command.CommandVolumeFocus.execute(CommandVolumeFocus.java:11) ~[classes!/:1.6-SNAPSHOT]
    at com.getpcpanel.commands.command.DialAction.lambda$toRunnable$0(DialAction.java:7) ~[classes!/:1.6-SNAPSHOT]
    at com.getpcpanel.commands.CommandDispatcher$HandlerThread.run(CommandDispatcher.java:61) ~[classes!/:1.6-SNAPSHOT]
Caused by: java.io.IOException: error=2, No such file or directory
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) ~[na:na]
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:319) ~[na:na]
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:249) ~[na:na]
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110) ~[na:na]
    ... 8 common frames omitted

Hopefully the above is nothing to worry about?

Thanks again!

nvdweem commented 2 years ago

Cannot run program "xdotool": error=2, No such file or directory should indicate that xdotool isn't installed. iirc, that tool is used to determine which program has focus for focus volume. I'd expect that any knob/slider that has the 'Focus Volume' option set shouldn't work unless xdotool is installed.

HidYn commented 2 years ago

I think xdotool probably requires me to be using X11 to function? I'm using Wayland so according to their github it won't work correctly. Wayland is becoming the default on many Distros now.

image

It looks like there maybe an alternative for Wayland.

https://github.com/atx/wtype

Thank you for all your hard work.

ghost commented 2 years ago

Definitely, can confirm on Fedora 37 with Wayland (NVIDIA proprietary 525.53) and using the .jar file for instance focus volume does not work, also visual glitches when moving the window, new window might go black, etc.

ghost commented 2 years ago

https://github.com/ReimuNotMoe/ydotool, tried with X11 same config can confirm it works normally, with wayland focus volume does not.

HidYn commented 2 years ago

https://github.com/ReimuNotMoe/ydotool

This looks like a good find if it works with X and Wayland.

nvdweem commented 2 years ago

I'll try and see if I can implement the ydotool soon. iirc, the distro I used last also has a Wayland option so I should be able to test the changes.

nvdweem commented 2 years ago

I'm looking into the ydotool but it seems that it only supports a part of xdotool that isn't useful for this usecase:

Currently implemented command(s):

type - Type a string key - Press keys mousemove - Move mouse pointer to absolute position click - Click on mouse buttons

For the focus volume, we need an alternative for the getactivewindow and getwindowpid options of xdotool. There is an issue that asks about this specifically but it was answered to be impossible: https://github.com/ReimuNotMoe/ydotool/issues/56

The same seems to apply to the wtype suggestion: xdotool type for wayland, we don't need the type part of xdotool.

From what I can tell, there doesn't seem to be a way to get the processname or pid for the window that has focus in Wayland. There are some mentions about it being possible on Sway but I have no idea if that is something that is commonly used. My distro with GNOME Wayland doesn't seem to use it.

ethan-neidhart37 commented 2 weeks ago

Hello!

Sorry to resurrect an old thread like this but I figured it would be better than opening a new issue when this one already exists.

Would you be open to publishing this to the AUR? If flatpak isn't an option then the AUR is probably the simplest path to a smoother installation process for arch based distros.

I have no experience with this kind of thing but I'd be happy to help out and learn along the way. From a very cursory Google search about how publishing to the AUR works, I'm hopeful that it would be a fairly simple process!