wasabi icon indicating copy to clipboard operation
wasabi copied to clipboard

Remove KDMAPI lib for FreeBSD and other OSes

Open yurivict opened this issue 1 year ago • 14 comments

Build fails:

error[E0308]: mismatched types
  --> /wrkdirs/usr/ports/audio/wasabi/work/kdmapi-rs-e1db353ab5f0726b362ac24179f942cd5fd1c29d/src/lib.rs:55:5
   |
55 | /     unsafe {
56 | |         #[cfg(target_os = "windows")]
57 | |         {
58 | |             // Try "OmniMIDI\\OmniMIDI"
...  |
73 | |         return Library::new("libOmniMIDI.dylib");
74 | |     }
   | |_____^ expected `Result<Library, Error>`, found `()`
   |
   = note:   expected enum `Result<libloading::Library, libloading::Error>`
           found unit type `()`

rust-nightly-1.84.0.20241104 Version: 1.0.0 FreeBSD 14.2

yurivict avatar Jan 12 '25 19:01 yurivict

Build fails:

error[E0308]: mismatched types
  --> /wrkdirs/usr/ports/audio/wasabi/work/kdmapi-rs-e1db353ab5f0726b362ac24179f942cd5fd1c29d/src/lib.rs:55:5
   |
55 | /     unsafe {
56 | |         #[cfg(target_os = "windows")]
57 | |         {
58 | |             // Try "OmniMIDI\\OmniMIDI"
...  |
73 | |         return Library::new("libOmniMIDI.dylib");
74 | |     }
   | |_____^ expected `Result<Library, Error>`, found `()`
   |
   = note:   expected enum `Result<libloading::Library, libloading::Error>`
           found unit type `()`

rust-nightly-1.84.0.20241104 Version: 1.0.0 FreeBSD 14.2

You do not have OmniMidi registered afaik

nomoemptypointer avatar Feb 11 '25 08:02 nomoemptypointer

@yurivict OmniMIDI/KDMAPI does not support FreeBSD. So inherently Wasabi cannot be compiled on operating systems other than Windows, macOS and Linux. I will keep this issue open to possibly remove KDMAPI completely when compiling for other OSes.

MyBlackMIDIScore avatar Mar 12 '25 18:03 MyBlackMIDIScore

1.0.1 still has this breakage. The FreeBSD port remains to be marked BROKEN.

yurivict avatar Mar 16 '25 19:03 yurivict

1.0.1 still has this breakage. The FreeBSD port remains to be marked BROKEN.

That's because we have yet to add support for FreeBSD

Kaydax avatar Mar 16 '25 22:03 Kaydax

@MyBlackMIDIScore Removing KDMAPI doesn't even solve the issue, XSynth itself does not support FreeBSD due to alsa-sys not being able to be compiled on FreeBSD. So even supporting FreeBSD will basically be removing two of the core features of Wasabi just to make it work, and that's assuming there isn't other stuff that isn't supported

Kaydax avatar Mar 16 '25 22:03 Kaydax

[...] alsa-sys not being able to be compiled on freebsd [...]

Do you have a bug report for this? What is the reason?

yurivict avatar Mar 16 '25 23:03 yurivict

[...] alsa-sys not being able to be compiled on freebsd [...]

Do you have a bug report for this? What is the reason?

FreeBSD does not support ALSA, it uses OSS. You can get some parts of ALSA working on FreeBSD, but thats with mapping it to OSS devices and isn't actually full ALSA

Kaydax avatar Mar 16 '25 23:03 Kaydax

FreeBSD does not support ALSA, it uses OSS.

No, both are supported.

yurivict avatar Mar 16 '25 23:03 yurivict

FreeBSD does not support ALSA, it uses OSS.

No, both are supported.

Can you give sources on where it says ALSA is supported on FreeBSD? Because from all the searching I could find nothing on it actually working native on FreeBSD as the main sound driver and also found a lot of topics on it being really bad or broken

Kaydax avatar Mar 16 '25 23:03 Kaydax

Many projects work through ALSA. For example, audio/qtractor works through the ALSA backend, among others. I don't know what would qualify as "sources".

yurivict avatar Mar 16 '25 23:03 yurivict

Many projects work through ALSA. For example, audio/qtractor works through the ALSA backend, among others. I don't know what would qualify as "sources".

Sources as on websites or forums threads that say its possible to compile ALSA on FreeBSD. Of course ALSA programs can work on FreeBSD, as FreeBSD has a shim for them to work. But ALSA itself does not work on FreeBSD, and the alsa-sys library depends on the ALSA library as a hard dependent, meaning you need ALSA on the system to compile alsa-sys.

Kaydax avatar Mar 16 '25 23:03 Kaydax

I don't understand. For example, qBittorrent works on FreeBSD. Are there "sources" that are saying that yes, qBittorrent works on FreeBSD? There is the port and package net-p2p/qbittorrent that just works. Same with ALSA: here is the functional port for ALSA lib: https://cgit.freebsd.org/ports/tree/audio/alsa-lib It is API compatible with Linux libalsa.so that all apps use. There is also a kernel ALSA API that is naturally not supported on FreeBSD, but only libalsa uses it, and for all practical purposes libalsa should be sufficient.

yurivict avatar Mar 16 '25 23:03 yurivict

Ok if you can get XSynth compiled and working on FreeBSD then I can easily fix the KDMAPI issue

Kaydax avatar Mar 16 '25 23:03 Kaydax

XSynth compiles fine on FreeBSD: https://cgit.freebsd.org/ports/tree/audio/xsynth

yurivict avatar Mar 17 '25 00:03 yurivict

Any chance to get this resolved and to make a new release with the fix?

Thanks, Yuri

yurivict avatar May 27 '25 17:05 yurivict

Sure, sorry for the delay.

@arduano can you take a quick look at the PR for this so we can merge?

MyBlackMIDIScore avatar May 28 '25 06:05 MyBlackMIDIScore

@yurivict Try the latest commit, it should compile under FreeBSD now with XSynth support. I won't make a new tag for it since there are no changes for the supported operating systems.

MyBlackMIDIScore avatar May 31 '25 09:05 MyBlackMIDIScore