fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Fluidsynth + Portaudio device selection


From: Pedro Lopez-Cabanillas
Subject: Re: [fluid-dev] Fluidsynth + Portaudio device selection
Date: Mon, 21 May 2012 22:43:01 +0200
User-agent: KMail/1.13.5 (Linux/2.6.34.10-0.6-desktop; KDE/4.4.4; i686; ; )

On Sunday 20 May 2012, Massimo Callegari wrote:
> Hi,
> I am using Fluidsynth + Portaudio through a Java JNI.
> 
> However, there is one thing I noticed that makes the use of Portaudio not 
fully working.
> As you know, Portaudio can be compiled with several audio type support in 
it. For example in Windows you can build a DLL with DirectSound+ASIO+WDM-SK 
all in one.
> This is very good because it saves space and because Java is very bad in 
unloading DLLs...
> 
> But here's the bad news. When Fluidsynth selects an audio device, it does it 
by name. So if different PA drivers return the same name (very common thing), 
then Fluidsynth will select the first name that matches the PA devices list.
> 
> Here's the code of fluid_portaudio.c that does it:
> 
>     for (i = 0; i < numDevices; i++)
>     {
>       deviceInfo = Pa_GetDeviceInfo (i);
> 
>       if (strcmp (device, deviceInfo->name) == 0)
>       {
>         outputParams.device = i;
>         break;
>       }
>     }
> 
> In my case the list Portaudio returns is the following:
> 
>  ID: 0, Name: Driver primario di acquisizione suoni,  Type: Direct Sound
>  ID: 1, Name: Fast Track Pro In 1/2, Type: Direct Sound
>  ID: 2, Name: Realtek HD Audio Input, Type: Direct Sound
>  ID: 3, Name: Fast Track Pro In S/PDIF, Type: Direct Sound
>  ID: 4, Name: Driver audio principale, Type: Direct Sound
>  ID: 5, Name: Fast Track Pro Out 1/2, Type: Direct Sound
>  ID: 6, Name: Realtek HD Audio output, Type: Direct Sound
>  ID: 7, Name: Fast Track Pro Out 3/4, Type: Direct Sound
>  ID: 8, Name: ASIO4ALL v2, Type: ASIO
>  ID: 9, Name: M-Audio USB ASIO, Type: ASIO
>  ID: 10, Name: Realtek HD Audio Input, Type: Windows WDM-KS
>  ID: 11, Name: Realtek HD Audio output, Type: Windows WDM-KS
>  ID: 12, Name: Fast Track Pro In 1/2, Type: Windows WDM-KS
>  ID: 13, Name: Fast Track Pro In S/PDIF, Type: Windows WDM-KS
>  ID: 14, Name: Fast Track Pro Out 1/2, Type: Windows WDM-KS
>  ID: 15, Name: Fast Track Pro Out 3/4, Type: Windows WDM-KS
> 
> So if my application wants to use device 14 it can't, cause Fluidsynth will 
select 5, cause of the name match.
> 
> Since Portaudio devices can be selected by index (PaDeviceIndex) it would 
make more sense if Fluidsynth would do the same.
> 
> The easiest way to fix this is probably to set the index through a 
Fluidysnth setting (like "audio.portaudio.device_index"). Don't know if this 
makes sense to you.

It makes perfect sense to me. Drivers may offer any number of options specific 
for exclusive features. For instance, the jack driver has  
audio.jack.autoconnect, audio.jack.id, audio.jack.multi and audio.jack.server, 
in this case we may add an index setting (or alternatively a type setting).  

A complementary point of view: if something in a driver can't be used without 
enabling a new setting, then this setting can and should be added, IMO.

Patches welcome! ;)

Regards,
Pedro



reply via email to

[Prev in Thread] Current Thread [Next in Thread]