Open lilyyy411 opened 1 year ago
If anyone that is wondering how to fix the audio open failing, I personally was able to fix it on Linux with the following procedure:
cat /proc/asound/cards
/etc/asound.conf
with following:
defaults.pcm.card 1
defaults.ctl.card 1
replacing "1" with number of the desired card you want as default.
I have no idea if this fix works for others, but this is what worked for me
I believe #15182 could be dealt with in a similar way, but it isn't as critical of an error
@4gboframram's fix did not solve the issue for me.
Any ideas on more diagnosis? Can I change the log level to a DEBUG or TRACE level to see more verbose info?
Edit: Looks like the debug level is set during build if I'm reading this line correctly: https://github.com/musescore/MuseScore/blob/5d03be99f7ec7374ae5eaf2b9835a74a737fbcdd/src/framework/global/globalmodule.cpp#L106-L110
If anyone that is wondering how to fix the audio open failing, I personally was able to fix it on Linux with the following procedure:
* Find the desired card with `cat /proc/asound/cards` * Create `/etc/asound.conf` with following:
defaults.pcm.card 1 defaults.ctl.card 1
replacing "1" with number of the desired card you want as default.
I have no idea if this fix works for others, but this is what worked for me
I had to find another fix for my system (Qubes 4.1 with Fedora), which does not use ALSA at all (no physical sound card), and instead communicates entirely to a remote Pulseaudio: Simply install the the alsa-plugins-pulseaudio
package through your package manager.
Yup, I didn't have a default device in aplay -l
likely due to a malformed config file. After deleting my config file at /etc/asound.conf
and re-creating with the default card I'd like listed, MuseScore successfully initialized the Linux Audio Driver.
It seems like the project has plenty of priority items, but can we propagate driver init return codes somehow? Instead of bool
return value, maybe const-like number codes of where driver initialization fails? This would ultimately allow for solving this issue's original intent, notifying the user properly.
It'd be great if we could return const int codes like AUDIO_DEV_OPEN_FAILED
or something in the open
function. https://github.com/musescore/MuseScore/blob/f31d372fc291a8a384d95f19db25b6e96dba1292/src/framework/audio/internal/platform/lin/linuxaudiodriver.cpp#L133-L195
That would need a change to the IAudioDriver
class...
Describe the bug When an audio device fails to open, something like
19:41:57.038 | ERROR | main_thread | AudioModule | setupAudioDriver: audio output open failed
is written to the log. However, an average user would not know if a critical error like this actually occurred and they would continue to use MuseScore in a malformed state where a lot of weird behavior can happen such as crashes when trying to set the buffer size and playback freezing.To Reproduce Steps to reproduce the behavior:
Expected behavior The end user should be notified in some way that an error has occurred. Potentially this could be a popup that could prevent further use of the application, but I'm not an expert in user interface.
Screenshots
Current log message:
An example of just a few of the weird things that can happen when the audio device fails to open, the buffer size being blanked and when changed, the application crashes:
Platform information
Additional context For Linux, I believe the opening seems to fail in a call to alsa's
snd_pcm_open
inLinuxAudioDriver::open
in filesrc/framework/audio/internal/platform/lin/linuxaudiodriver.cpp
line 143 because alsa cannot find a device named "default" on some machines. One cause is bad machine configuration, and MuseScore probably cannot do anything about this.