Hi Pedro,
since we haven't made any progress so far on this issue, I would like to
recap and find a final solution to fix it.
Given facts:
- FluidSynth supports PortAudio
- PortAudio can be compiled with multiple drivers (e.g. ASIO + WDMKS +
DirectSound)
- PortAudio can return different devices with the same name (e.g. "Device
XY" for DirectSound and "Device XY" for WDMKS)
- PortAudio devices must be selected by index and not by name
- PortAudio devices can be selected from FluidSynth only by name
- an application linking Fluidsynth should know nothing about PortAudio and
its indexes
- FluidSynth sorts the devices list alphabetically from v 1.1.0, losing the
original PortAudio index match
Said that, I see two possible solution for this issue:
1) add "audio.portaudio.index" and "audio.list.sorting" to disable the
alphabetical sort and give the application the possibility to select a
device by FluidSynth index.(NOT PortAudio index). The application could
still sort the list and do whatever manpulation of it. In this case the app
must save the device index. It could also save the device name
to perform a cross check of name/index in case of USB hot-pluggable audio
cards.
2) in case of duplicate PortAudio device name, FluidSynth will add something
like "_1" or " (1)" to the name. When the application will select such
device
FluidSynth must be able to retrieve back the original device name and the
related PortAudio index.
Please let me know your view and I will make the code change once we're all
happy on a solution :)
Regards,
Massimo
----- Original Message -----
From: "Pedro Lopez-Cabanillas" <pedro.lopez.cabanil...@gmail.com>
To: "Massimo Callegari" <massimocalleg...@yahoo.it>
Cc: "FluidSynth mailing list" <fluid-dev@nongnu.org>
Sent: Wednesday, June 06, 2012 5:38 PM
Subject: Re: [fluid-dev] Fluidsynth + Portaudio device selection
On Wednesday 06 June 2012, Massimo Callegari wrote:
Can you explain the other "use cases" you're talking about ? If I can
help
to cover most of them I would be happy to do so.
I'm talking about Qsynth ( http://qsynth.sourceforge.net )
If you take a look to the audio tab of the setup dialog, the "Audio
Device"
combo box is populated when you choose PortAudio in the "Audio Driver"
using
the list of names returned by the "audio.portaudio.device" settings. The
user can only select the device names displayed in that drop-down list.
BTW I didn't mean "hardcoded" device names. I meant that if an
application
allows users to select a device by name, it will probably save the string
on a config file for later uses. Changing the names in FS would mean one
day those users will start their application and most likely won't hear
any sound since the saved name doesn't exist anymore. (unless a good
segfault kicks in :P)
The saved device name is not reliable anyway between sessions. I've
noticed
that you have a "M-Audio USB" device. What happens now if you saved that
name in your program configuration, and later you start your program when
that USB device is unplugged? The USB / Firewire / Bluetooth audio and
MIDI
devices are pretty common nowadays, and all of them are hot-pluggable. My
advice is that a program should never assume that any present device will
be
available the next time the program is run, and never segfault because
this.
Instead, let the user know the problem and suggest the possible solutions,
like choosing another device, or restarting / reopening the audio after
connecting the old device.
Regards,
Pedro
-----
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 2012.0.2177 / Database dei virus: 2433/5054 - Data di rilascio:
07/06/12
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev