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

LRCGET crashes with no error user-facing error message when there is no default audio device #157

Open
RansomTime opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@RansomTime
Copy link

On Windows, when launching LRCGET, if there is no default audio device, LRCGET will crash and close without providing any error message to the user.

I eventally figured it out by cloning the repo and running the code

  ➜  Local:   http://localhost:1420/
  ➜  Network: use --host to expose
        Info Watching C:\Users\Ransom\repos\lrcget\src-tauri for changes...
   Compiling lrcget v0.5.0 (C:\Users\Ransom\repos\lrcget\src-tauri)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.22s
Database file path: C:\Users\Ransom\AppData\Roaming\net.lrclib.lrcget\db.sqlite3
Existing database version: 4
thread 'main' panicked at src/main.rs:450:34:
Failed to initialize audio player: Cannot find the default audio output device
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1202/150041.099:ERROR:window_impl.cc(121)] Failed to unregister class Chrome_WidgetWin_0. Error = 1412

but this should either:

  • Let the user continue without an audio device
  • Show the user an error so they can enable a device to fix the issue
@WinnerWind
Copy link

WinnerWind commented Dec 4, 2024

Hi there!
I'm having this issue on Arch Linux too, version 0.5.0

lrcget 

** (lrcget:28351): WARNING **: 18:27:22.822: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
Database file path: /home/soham/.local/share/net.lrclib.lrcget/db.sqlite3
Existing database version: 4
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
thread 'main' panicked at src/main.rs:450:34:
Failed to initialize audio player: The requested device is no longer available. For example, it has been unplugged.

Caused by:
    The requested device is no longer available. For example, it has been unplugged.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It's quite annoying because I tried poking at the source too and couldn't figure out what to do.

EDIT : do you sometimes have that moment when you're looking through the source code, then you see the readme file?
Turns out I needed pipewire-alsa. Oops!

Anyway since you're on windows, this trick won't work. Sorry.

@tranxuanthang tranxuanthang added the bug Something isn't working label Dec 20, 2024
@tranxuanthang
Copy link
Owner

It's quite annoying because I tried poking at the source too and couldn't figure out what to do.

@WinnerWind Sorry for the late reply! The issue should be in this part of the code:

let player = Player::new().expect("Failed to initialize audio player");

Instead of using expect(), which causes a panic if Player::new() fails, we could handle this more gracefully. For example, we could show a modal dialog in the UI to inform the user and allow them to retry initializing the player with Player::new() later.

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

3 participants