Hi Pedro,
ok, this is getting clearer.
To be honest I would prefer to select devices by PortAudio index as well. In my
application I have a direct interface to PA, so retrieving the right index
would be a piece of cake for me :)
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.
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)
All considered, what do you suggest at this point ? You're the boss :)
I tried to compile FS on Ubuntu 10.04 and unistd.h is not needed. Of course I'm
not sure if it's the same on other Unix systems. So I guess protecting the
include line like you suggested is the best way.
Cheers,
Massimo
________________________________
Da: Pedro Lopez-Cabanillas <pedro.lopez.cabanil...@gmail.com>
A: Massimo Callegari <massimocalleg...@yahoo.it>
Cc: FluidSynth mailing list <fluid-dev@nongnu.org>
Inviato: Mercoledì 6 Giugno 2012 12:04
Oggetto: Re: [fluid-dev] Fluidsynth + Portaudio device selection
On Wed, Jun 6, 2012 at 9:47 AM, Massimo Callegari <massimocalleg...@yahoo.it>
wrote:
>The option "audio.portaudio.index" may be useful for some use cases, but the
>problem for Qsynth users remains: PortAudio may return the same name for two
>different indexes (one for DirectSound, and another for WDMKS) so FluidSynth
>will remember only one option. The only general solution for this problem is
>modifying the strings stored as options for "audio.portaudio.device",
>including the device type, index, both, or whatever else.
>
>
>I do not agree here. "audio.portaudio.index" can NOT be the PortAudio index,
>since we're talking about applications linking Fluidsynth, and not PortAudio
>directly. So "audio.portaudio.index" has to be an index of the FS devices
>list. That's the whole point of doing this change.
>Moreover in my solution I kept backward compatibility. Changing the names of
>the PA devices returned by FS would break all the applications out there that
>work on devices names.
Your first message to the list about this issue explained the problem very
clearly: PortAudio returns the same device name for several device indexes, and
this prevents a FluidSynth client to select other than the first one. Your
preference may be to choose devices by index, but a correct solution for the
FluidSynth project must take into account other use cases as well.
PortAudio distributions include a "pa_devs" utility, that prints a list of the
devices as they are known by PA. So using the PA index is possible, for some
use cases.
The PA device names used by FluidSynth are different from one machine to
another; they cannot be considered part of the API. If a FluidSynth client
program has hardcoded a device name, that program is wrong written and deserves
the breakage and be ashamed for that.
>OTOH, the <unistd.h> header inclusion should be protected (instead of removed)
>
>#if HAVE_UNISTD_H
>#include <unistd.h>
>#endif
>
>HAVE_UNISTD_H is defined (or not) in the cmake generated header "config.h"
>
>
>Unistd.h include can be removed. It's useless either in Windows or Linux,
>since FS builds fine without it.
Have you tested that in all Unix variants where FluidSynth can be compiled?
Regards,
Pedro
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev