[Top][All Lists]

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

PortAudio driver (was Re: [fluid-dev] New development)

From: Pedro Lopez-Cabanillas
Subject: PortAudio driver (was Re: [fluid-dev] New development)
Date: Sun, 1 Feb 2009 02:05:56 +0100
User-agent: KMail/1.9.6 (enterprise 20070904.708012)

Josh Green wrote:
> After looking at the fluid_portaudio.c and seeing how small it was, I
> decided to take a crack at it.  Checked in is the new PortAudio driver
> using PortAudio API 19.  I added device enumeration, but it still needs
> some improvement.  It is using the device names for the setting
> audio.portaudio.device, but these look like they can be rather long and
> I'm not sure if there is any guarantee that they will be unique.  I also
> am using the string "default" to try and select the default device,
> which I was assuming would be device 0, but I'm not sure about that and
> this would also conflict with the ALSA "default" device name.
> PortAudio selects its devices based on index.  Perhaps specifying the
> device numerically would be better, though it would be nice to be able
> to see the names in a drop down list in applications as well.
> Other improvements would be the addition of a new2 driver.
> Anyone willing to try this with ASIO on Windows?
> Best regards,
>       Josh

I've checked in some changes to the PortAudio driver.

- PortAudio enumerates devices having input only ports. As we need audio 
output  devices, I've changed the enumeration to ignore devices with less 
than 2  output channels available.

- For the default device name, I've defined the string "PortAudio Default" 
trying to solve the clash with ALSA's "default" device name. The function 
Pa_GetDefaultOutputDevice() provides the default device index.

- Added an assignment for the device index of the matching requested device 

About the Windows tests. The current status of PortAudio is somewhat sad, 
being optimist. Their autohell build system allows only one backend at once. 
To compile the WDMKS backend the documentation says that it needs DirectX 
SDK, but the needed headers come from the Drivers Kit instead. It compiles, 
but the initialization is deactivated, requiring to uncomment some lines in 
the file "pa_win_hostapis.c". After some googling you realize that there is 
an active ticket about this: http://www.portaudio.com/trac/ticket/47

In order to build Fluidsynth, portaudio.pc needs to be modified by hand. Only 
to  realize that there is no sound at all. Using different devices doesn't 
help. PA Test programs don't produce noise, either. It is a problem with the 
backend code, that only invokes the callback when there is an input stream, 
in addition to the output one. There are some googles talking about this. 
Finally, after commenting out the offending condition, there is sound at 
last!. Buffer size: 64, Buffer count: 2, latency of less than 3 msecs at 
48000 Hz. The sample rate depends on the device: there isn't automatic 
resampling, only the rates supported by the device. The bad news: the first 
underrun affects very badly the audio quality forever. There is no automatic 
recovery, or any other solution than restarting over.


reply via email to

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