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

Linux build fails #10

Closed
eye-wave opened this issue Jul 9, 2024 · 2 comments
Closed

Linux build fails #10

eye-wave opened this issue Jul 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@eye-wave
Copy link

eye-wave commented Jul 9, 2024

Here's the build log after running tauri build ( warnings and notes were removed leaving only errors ).
tested on stable and nightly.

error[E0432]: unresolved import `libpulse_binding`
  --> src/output.rs:50:9
   |
50 |     use libpulse_binding as pulse;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ no external crate `libpulse_binding`

error[E0432]: unresolved import `libpulse_simple_binding`
  --> src/output.rs:51:9
   |
51 |     use libpulse_simple_binding as psimple;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no external crate `libpulse_simple_binding`

error[E0050]: method `write` has 2 parameters but the declaration in trait `AudioOutput::write` has 4
   --> src/output.rs:112:18
    |
21  |     fn write(&mut self, decoded: AudioBufferRef<'_>, ramp_up_samples: u64, ramp_down_samples: u64);
    |              ------------------------------------------------------------------------------------ trait requires 4 parameters
...
112 |         fn write(&mut self, decoded: AudioBufferRef<'_>) -> Result<()> {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 4 parameters, found 2

error[E0046]: not all trait items implemented, missing: `get_sample_rate`, `pause`, `resume`, `update_resampler`, `has_remaining_samples`, `ramp_down`, `ramp_up`
   --> src/output.rs:111:5
    |
23  |     fn get_sample_rate(&self) -> u32;
    |     --------------------------------- `get_sample_rate` from trait
24  |     fn pause(&self);
    |     ---------------- `pause` from trait
25  |     fn resume(&self);
    |     ----------------- `resume` from trait
26  |     fn update_resampler(&mut self, spec: SignalSpec, max_frames: u64) -> bool;
    |     -------------------------------------------------------------------------- `update_resampler` from trait
27  |     fn has_remaining_samples(&self) -> bool;
    |     ---------------------------------------- `has_remaining_samples` from trait
28  |     fn ramp_down(&mut self, buffer: AudioBufferRef, num_samples: usize);
    |     -------------------------------------------------------------------- `ramp_down` from trait
29  |     fn ramp_up(&mut self, buffer: AudioBufferRef, num_samples: usize);
    |     ------------------------------------------------------------------ `ramp_up` from trait
...
111 |     impl AudioOutput for PulseAudioOutput {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `get_sample_rate`, `pause`, `resume`, `update_resampler`, `has_remaining_samples`, `ramp_down`, `ramp_up` in implementation

error[E0061]: this function takes 2 arguments but 8 arguments were supplied
   --> src/player.rs:593:42
    |
593 |                     audio_output.replace(output::try_open(
    |                                          ^^^^^^^^^^^^^^^^
    |

error[E0308]: mismatched types
    --> src/player.rs:593:42
     |
593  |                       audio_output.replace(output::try_open(
     |  __________________________________-------_^
     | |                                  |
     | |                                  arguments to this method are incorrect
594  | |                         spec,
595  | |                         volume_control_receiver.clone(),
596  | |                         sample_offset_receiver.clone(),
...    |
601  | |                         app_handle.clone(),
602  | |                     ));
     | |_____________________^ expected `Result<Arc<Mutex<...>>, ...>`, found `Result<Box<dyn AudioOutput>, ...>`
     |
     = note: expected enum `std::result::Result<Arc<tokio::sync::Mutex<dyn AudioOutput>>, _>`
                found enum `std::result::Result<Box<(dyn AudioOutput + 'static)>, _>`
help: the return type of this call is `std::result::Result<Box<(dyn AudioOutput + 'static)>, AudioOutputError>` due to the type of the argument passed
    --> src/player.rs:593:21
     |
593  |                        audio_output.replace(output::try_open(
     |  ______________________^____________________-
     | | _____________________|
     | ||
594  | ||                         spec,
595  | ||                         volume_control_receiver.clone(),
596  | ||                         sample_offset_receiver.clone(),
...    ||
601  | ||                         app_handle.clone(),
602  | ||                     ));
     | ||_____________________-^
     | |______________________|
     |                        this argument influences the return type of `replace`

Some errors have detailed explanations: E0046, E0050, E0061, E0308, E0432.
For more information about an error, try `rustc --explain E0046`.
warning: `app` (bin "app") generated 49 warnings
error: could not compile `app` (bin "app") due to 6 previous errors; 49 warnings emitted
       Error failed to build app: failed to build app
error: script "tauri" exited with code 1
@basharovV
Copy link
Owner

Hi! Thanks for reporting (and trying out on Linux before I did!).

I think the PulseAudio code can be removed - I borrowed it from an example in the Symphonia repo but ideally this should work directly via cpal instead, which supports ALSA and JACK already so there is no need to have platform-specific audio handling in musicat. It appears that cpal uses ALSA by default on Linux, but jack can also be enabled via a feature flag.

You're welcome to submit a PR!

@basharovV basharovV added the bug Something isn't working label Jul 9, 2024
@basharovV
Copy link
Owner

I have removed the PulseAudio code, and created a Linux-specific tauri.linux.conf.json file. Tested on Ubuntu 20.04 and it builds successfully. Import and playback works, but on quick glance the UI looks off, WebRTC viz doesn't work due to lack of support in webkit2gtk. I'm sure there's more issues, need to test further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants