FS#41768 - [fluidsynth] Detect PA and change default configuration accordingly

Attached to Project: Arch Linux
Opened by Ernest Skrzypczyk (emeres) - Sunday, 31 August 2014, 13:44 GMT
Last edited by Ray Rashif (schivmeister) - Thursday, 30 October 2014, 18:35 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Ray Rashif (schivmeister)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Could something like this be added to post_install function in fluidsynth.install?
[code]
if (pidof pulseaudio > /dev/null); then sed -i 's/a\ alsa/a\ pulseaudio/' /etc/fluidsynth.conf; fi
[/code]

Additional info:
There are reoccurring cases where users come across this behaviour and even though it is explained on the PA wiki, this could be easily fixed by the line above. So should a user run pulaseaudio at the time of installation, that would be the default driver for fluidsynth, which would avoid blocking the audio device for pulseaudio. One of recent cases: https://bbs.archlinux.org/viewtopic.php?id=186427.

Steps to reproduce:
Since I do not use PA myself, I can only speculate based on reports from others: Install fluidsynth on a system with PA and reboot with the service enabled without changing the default configuration.
This task depends upon

Closed by  Ray Rashif (schivmeister)
Thursday, 30 October 2014, 18:35 GMT
Reason for closing:  Implemented
Additional comments about closing:  fluidsynth 1.1.6-4
Comment by Ray Rashif (schivmeister) - Sunday, 31 August 2014, 20:36 GMT
The underlying problem that you seek to solve is actually a problem in the configuration; the fluidsynth service starts without a soundfount, making no attempt to inform the user of its useLESSness. This is partly my oversight.

For most other things fluidsynth picks pre-programmed defaults in the absence of configuration. Editing the configuration is supposed to be mandatory in order to supply the path to a soundfont, so any modification of parameters should be part of this first intervention.

Although I see no reason to dismiss your proposal as being too intrusive, there are alternative less-intrusive ways to go about this. I would prefer a better configuration file that makes parameters clear and prevents starting the service without manual intervention:

~~~{/etc/conf.d/fluidsynth}
# Mandatory parameters (please uncomment)
#SOUND_FONT=/path/to/a/soundfont
#AUDIO_DRIVER=pulseaudio # see 'fluidsynth -a help'

# Optional parameters (may be helpful)
#OTHER_OPTS='-m alsa_seq -r 48000' # man fluidsynth, please
~~~

Note that this in effect prevents fluidsynth from being started without configuration, hence also preventing it from grabbing the sound card unknowingly. Let me know what you think.
Comment by Ernest Skrzypczyk (emeres) - Sunday, 31 August 2014, 22:53 GMT
That approach is more than satisfactory.
Comment by Ray Rashif (schivmeister) - Monday, 01 September 2014, 14:07 GMT
Update has been rolled to [testing]. I would also like some feedback from PA users if using the fluidsynth daemon with PA actually works. If you see the post-install message, I have linked an old discussion about an issue with running fluidsynth at startup on a PA system.
Comment by Leonard de Ruijter (leonardder) - Tuesday, 02 September 2014, 06:20 GMT
Please note that the soundfont isn't mandatory. I have a setup which loads the soundfont from a command line file specified with the -f parameter.
Comment by Ray Rashif (schivmeister) - Wednesday, 03 September 2014, 16:02 GMT
You are correct, it (the parameter) is certainly not mandatory in that sense. However, if you are supplying the soundfont via other means, configuration is still mandatory (the purpose of the daemon is to be playback-ready, so it must start with one or more soundfonts).

You can then simply replace the path with a quoted string including the -f parameter and the argument (file). Let me know if I didn't get you right.

Loading...