Auto-connection request for scummvm

I’d like to request two auto-connections for the ScummVM snap (https://snapcraft.io/scummvm). The snap is currently maintaned by the Snapcrafters community, with me (being a member of the ScummVM dev team) as a contributor. The recipe for building the snap is available at https://github.com/snapcrafters/scummvm/blob/master/snap/snapcraft.yaml.

  • joystick: ScummVM allows the usage of joysticks and gamepads as additional input sources. Using a gamepad might be especially interesting for playing the RPGs we support.
  • alsa: A lot of games we support make use of MIDI for playing back music. ScummVM supports not only playing back the MIDI music via emulation, but also via real hardware synthesizers. For example, it’s possible to hook up a real Roland MT32 device or an OPL2LPT sound board and using those devices for audio playback. Those low-level approaches require direct access to ALSA, since this can’t be handled via PulsAudio at the moment.

If you have any questions or in case of missing information - just ping me! :slight_smile:

Thanks
Lothar

+1 for joystick.

The rationale for using alsa makes a lot of sense, but I’m not sure it should be auto-connected since a lot of hardware is not capable of multiplexing and the alsa interface would allow locking out other applications from the sound devices on such hardware (this is one of the reasons why most applications use pulseaudio since it handles multiplexing for clients on such hardware). As such:

  • How does your application handle hardware like this?
  • Is the use of hardware synthesizers on by default?
  • Is direct use of alsa only for hardware synthesizers? If not, does scummvm default to using pulseaudio except for hardware synthesizers?
  • What is the UX if the alsa interface is not connected?

Depending on your answers, it may be best to leave it manually connected but use ‘snapctl is-connected alsa’ to detect when it isn’t connected so you can guide the user to connect.

Thanks for the feedback, @jdstrand!

  • How does your application handle hardware like this?
  • Is the use of hardware synthesizers on by default?
  • Is direct use of alsa only for hardware synthesizers? If not, does scummvm default to using pulseaudio except for hardware synthesizers?

“Real” hardware is accessed via the /dev/seq devuce files. Support for it is enabled by default, but the user has to select the device on his own - the usual way to output the MIDI music is via the software synthesizer. In this case, ScummVM is able to use PulseAudio instead.

  • What is the UX if the alsa interface is not connected?

If the ALSA interface is not connected, the user will see several warning messages/errors in the log window, referencing the inability to access /dev/seq. When trying to use the hardware synthesizers, it will more or less silently fail unfortunately. Since we don’t have a way to detect this situation in ScummVM itself, the message regarding /dev/seq is the only way to tell the user that something is wrong.

Thanks for pointing me to ‘snapctl is-connected alsa’ - I’ll make use of it in case the decision is against auto-connecting ALSA by showing an appropriate info message.

AIUI, scummvm defaults to pulseaudio and only goes to alsa if the user chooses a hardware synthesizer. As such, it won’t by default takeover alsa hardware for systems that don’t support multiplexing on these devices.

Considering this, +1 to auto-connect alsa (I already voted +1 for joystick). @reviewers - can others please vote?

@lotharsm can you confirm if the above statement by @jdstrand is correct? If so, +1 from me too for auto-connect of alsa for scummvm

Likewise from me, +1 from me for alsa and +1 for joystick.

Yes, I can confirm this. By default, ScummVM uses PulseAudio and only uses ALSA in case we need it for the “low-level stuff”. If you want, you can verify this by running scummvm -d5 (the -d switch enables debug output), it will report back SDL_AUDIODRIVER: pulseaudio.

Thanks for the confirmation @lotharsm.

+3 votes for, 0 votes against auto-connect of joystick and alsa for scummvm - this is now live.

1 Like

Thanks a lot to all reviewers and for approving this request! :slight_smile: