[vlc-devel] Re: [vlc] Re: MacOSX developer offer

Eric Nicolas enicolas at dvdfr.com
Wed Feb 23 20:35:59 CET 2005


Ok, I cannot get to compile VLC yet (see other post), but I've done 
some investigation
in the meantime. Here is what I found. My hardware is a PowerMac G5 
connected using
digital (optical) out to a Dolby Digital and PCM capable amplifier 
(cannot do DTS though).
My OSX config (utilities / audio+midi config panel) is digital output, 
2ca-16bit mode.

Le 23 févr. 05, à 12:26, Derk-Jan Hartman a écrit :

> We at least could use your help with some things for sure.
> 1: Turn all your volumes down to a low volume to make sure you don't 
> accidently damage them with noise (low-risk, but i don't wanna take 
> any changes)
> 2: plug in stereo speakers/headphones
> 3: test stereo file

That works both in speakers and in amplifier.

> 4: test AC3/dolby file/dvd (this should give noise, VLC selects an 
> incorrect output mode it appears (SPDIF). This needs to be solved if 
> you could assist/do this that would be very good)

That gives nothing (just silence) in both speakers and amplifier.
Actually I get a very small noise at the begining and then just silence.

I've tested what coreaudio HAL descriptors gives me. If I list the 
available interfaces, I always
get just ONE, and that's the one I've selected in the utilities / 
audio+midi config panel.

Here is the data given back by coreaudio HAL for the three choices I 
have in that panel for
my digital out (also note that iTunes works only with 2ca-16bit 
selected):

Audio, 2ca-24bit:
         format id    = lpcm
         format flags = 0x16 =
                 kAudioFormatFlagIsBigEndian |
                 kAudioFormatFlagIsSignedInteger |
                 kAudioFormatFlagIsAlignedHigh
         bytes per packet = 4
         frames per packet = 1
         bytes per frame = 4
         channels = 2

Audio, 2ca-16bit:
         format id    = lpcm
         format flags = 0x1E =
                 kAudioFormatFlagIsBigEndian |
                 kAudioFormatFlagIsSignedInteger |
                 kAudioFormatFlagIsPacked |
                 kAudioFormatFlagIsAlignedHigh
         bytes per packet = 4
         frames per packet = 1
         bytes per frame = 4
         channels = 2

Audio, encoded digital:
         format id    = cac3
         format flags = 0x1E = 16 + 8 + 4 + 2
                 kAudioFormatFlagIsBigEndian |
                 kAudioFormatFlagIsSignedInteger |
                 kAudioFormatFlagIsPacked |
                 kAudioFormatFlagIsAlignedHigh
         bytes per packet = 6144
         frames per packet = 1536
         bytes per frame = 0
         channels = 2

So it seems that you cannot guess what's available from just iterating 
the interfaces. My understanding
is that we would need to iterate the interfaces just to see if one 
match what we want, and if not just
take the default one and change its parameters to our needs (and that 
will not work if another app is
already using the audio).

Then for simple output, we should set the parameters to same as 
"2ca-16bit" above.
And for multi-channel output, we should set the parameters to same as 
"encoded digital" above. For
this one do the "bytes per packet" and "frames per packet" make sense 
?? They seem pretty close to
the A52 buffer metrics, no ?

So my guess for now for a working algorithm is :

interface = -1
for(parameters in { multichannel7.1, multichannel5.1, stereo } do

	if(an interface listed already match this config)
	{
		interface = the one that matches
		break
	}
	set the default interface to those parameters
	if(no error)
	{
		interface = the default one
		break
	}
}
if (interface == -1)
{
	report error: cannot find any interface for playing audio (or another
	software already using the audio output)
}

What do you think ?

Eric.


-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list