Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting to Linux (and MacOS) Progress Tracker #35

Open
OWL4C opened this issue Oct 28, 2024 · 3 comments
Open

Porting to Linux (and MacOS) Progress Tracker #35

OWL4C opened this issue Oct 28, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@OWL4C
Copy link

OWL4C commented Oct 28, 2024

I found this program today and started to port it to Linux (and by extension, MacOS should be relatively easy to add on afterwards, if libraries exist).
Here i want to track my progress, mark issues and basically make it easier for others to follow.

After commenting out all windows specific apis and imports, as well as installing portaudio19-dev (Debian based Linux Systems, for others please consult your maintainers page for the portaudio package), it starts and works (i.e. the WebUI opens and buttons do things).

Current Issues: All Windows specific features are broken. This includes

  • Window Actions (Find Window, Raise/Lower/Minimize,...): These are based on the win32api. There is a crossplatform library pywinctl which should serve our needs. I have already started on this, but as far as i can see the only button to use these is "Restart Explorer" and maybe open some window/file thing i haven't fully traced yet. [Tangent: there should be a "focus window" button anyway, so maybe this can be implemented too]
  • Audio Recording / Playback. The used lib already supports cross platform audio, and in fact you can correctly choose audio devices for in / out. These do not work correctly though, and next to the real hw devices you can also choose pipewire/pulse, so there is some cleaning up to do.
  • Audio Devices. Haven't looked to much into this, but basically everything using pycaw needs to be reworked. There is both an ALSA and pulseaudio api i have found already, but no pipewire/jack (should exist though). These are all to actually change the interfaces (mute, set in / out) etc as opposed to play / rec audio.
  • Connected to that is a whole lot of code customised to VB Cable, which doesn't have a linux alternative, especially since you can easily use Pipewire + Helvum (or any other Pipewire Patchbay) + Easy Effects to get most features (custom configs for all others i think) on Linux. This means depending on how it is used different ports have to be used.

MacOS:
Pywinctl has support for MacOS, but it is more limited (high latency, not much functionality). There may be better options, but since right now there doesn't seem to be much use for Window Actions besides Explorer, it might be easier to just skip this.
Audio is probably similar, since MacOS is already very locked down towards HW Access / Volume Mixing etc. Soundflower is an open source app that might be required for feature parity.
I currently have no plan on actually implementing any MacOS Fixes, but i'll try to make any OS specific fix fail safely so you can still use the other parts.

VLC and OBS have linux compatible libraries, but there are multiple and i haven't tested functionality yet. This might of course be impacted by the many different Linux Packaging Formats, and Snaps/Flatpaks might prove especially difficult. OBS uses Websockets though so it should be possible to play nicely with flatpak.

Current Progress: Single Key Keyboard Input already works fine. Text needs root. Volume / Media / Soundboard / System is broken (based on win32). OBS / Spotify untested. Color Picker works but does not create a popup (possibly add a to clipboard function too). Stat Display works (even with GPU) but needs to be clicked in order to update. Storage Display recognizes linux disks, but cannot get information.

In the following gist is the pip requirements i used to get it running. For some reason, the provided requirements.txt eroored on install, (i removed pywin32, but another windows specific package, that doesn't seem to be in the txt, tries to install and fail). These might not be the only required packages, but at least the application starts now; conversely there might be multiple redundant packages (for example obs related ones), or packages unimportant. This is merely a pip list --format=freeze of my venv.

@OWL4C OWL4C added the enhancement New feature or request label Oct 28, 2024
@Lenochxd
Copy link
Owner

Hey :)

Maybe you should have asked me before you started all this work, but it's awesome that you were able to pull this off so quickly, so whatever. I spent a few weeks restructuring the entire application precisely to make contributions easier, but more particularly the Linux port.

I’d like to suggest adding your work to the repository in a separate branch, such as feature/linux-port for example, to keep the Linux-specific work separate. We can maintain the primary Windows-compatible code on master. This should make it easier for both of us (and future contributors) to follow the changes and merge once it's stable.

Additionally, I think it would be beneficial for us to communicate more easily. I’d like to add you on Discord so we can discuss the porting process directly and collaborate more effectively. There’s also another developer who offered help with the Linux port yesterday, and it could be useful to have all of us connected.

Looking forward to collaborating!

@Lenochxd
Copy link
Owner

I’ve merged your code into a new branch named linux-compatibility (co-authored with you). 64d0334
Thanks for your contributions! This branch will serve as the basis for Linux support while keeping the Windows functionality intact on master.

I didn’t merge the OBS-related changes yet. I need to verify whether they’ve already been addressed with commit ccef224 but I’m having trouble enabling OBS WebSockets on my system (Arch Linux), as the setting doesn’t appear in the OBS configuration.

Some updates on the application’s progress:

  • Xorg and Headless Mode: The app can now start in an Xorg environment or even without a GUI (echo $DISPLAY returns None). It should also work on Wayland, though I still need to test that. If it doesn’t, the --no-tray argument should resolve some issues.
  • Tray Icon: I’ve fixed the tray icon for Xorg environments (ed3663f).
  • Tkinter Stability: Linux-related crashes with tkinter windows have been resolved (a8d00ec, 0b744f6).

Next, we’ll need to work on making the button functionality fully compatible across platforms. I started creating a markdown table to track the progress of button implementation and ensure we stay organized. Let me know if you have any questions or further suggestions!

@Lenochxd
Copy link
Owner

Lenochxd commented Dec 12, 2024

Here is the table to track the progress of Linux compatibility for the buttons and their functionality:

Category Command Not Supported Planned In Progress Partially Supported Fully Supported Comment
Webdeck /fullscreen [x]
Webdeck /reload [x]
Webdeck /folder [x]
Webdeck /open-config [x]
Display /usage [x] 1. I can't test the GPU.
2. Disk needs to be reworked 33608c6
System /volume set [x] b39333a
System /volume + [x] b39333a
System /volume - [x] b39333a
System /volume mute [x] Should work, but it does not 9c27d47, 83ac777 (sudo only) e765676
System /mediacontrol playpause [x] Should work, but it does not 27051fd (sudo only) e765676
System /mediacontrol previous [x] Should work, but it does not 980bf2b (sudo only) e765676
System /mediacontrol next [x] Should work, but it does not 980bf2b (sudo only) e765676
System /start [x] module 'os' has no attribute 'startfile' fb01876
System /openfolder [x] Default function just uses explorer {path} and that's why it does not work 9490014
System /locksession [x] 20acd87
System /PCshutdown [x] 77d0d68
System /PCrestart [x] 77d0d68
System /PCsleep [x] 77d0d68
System /PChibernate [x] 77d0d68
System /screensaver [x] 08109ec
System /screensaversettings [x]
System /restartexplorer [x]
System /superAltF4 [x] 05e929c (requires xdotool)
System /forceclose [x] a3f14e8
System /restart [x] b7decdf
System /exec [x]
System /batch [x]
Text /key [x]
Text /write [x] 7f61290
Text /writeandsend [x] 7f61290
Text /speechrecognition [x]
Text /copy [x]
Text /paste [x]
Text /cut [x]
Text /clipboard [x] f7e16b6 (requires copyq, gpaste-client, clipman, parcellite, xfce4-clipman, klipper or diodon, or performs Win+V so it depends on the user's shortcut configuration)
Text /clearclipboard [x] a422090 (requires xclip, xsel or wl-clipboard)
Utilities /colorpicker [x] Needs working notifications 86bd2cb (requires notify-send)
Soundboard /playsound [x]
Soundboard /stop_soundboard [x]
OBS Studio /obs_key [x] Untested
OBS Studio /obs_scene [x] Untested
OBS Studio /obs_toggle_rec [x] Untested
OBS Studio /obs_start_rec [x] Untested
OBS Studio /obs_stop_rec [x] Untested
OBS Studio /obs_toggle_rec_pause [x] Untested
OBS Studio /obs_pause_rec [x] Untested
OBS Studio /obs_resume_rec [x] Untested
OBS Studio /obs_toggle_stream [x] Untested
OBS Studio /obs_start_stream [x] Untested
OBS Studio /obs_stop_stream [x] Untested
OBS Studio /obs_toggle_virtualcam [x] Untested
OBS Studio /obs_start_virtualcam [x] Untested
OBS Studio /obs_stop_virtualcam [x] Untested
Spotify /spotify volume + [x]
Spotify /spotify volume - [x]
Spotify /spotify volume set [x]
Spotify /spotify playsong [x]
Spotify /spotify playplaylist [x]
Spotify /spotify likesong [x]
Spotify /spotify likealbum [x]
Spotify /spotify add_or_remove [x]
Spotify /spotify add_to_playlist [x]
Spotify /spotify remove_from_playlist [x]
Spotify /spotify follow_or_unfollow_artist [x]
Spotify /spotify follow_artist [x]
Spotify /spotify unfollow_artist [x]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants