[vlc-devel] Re: Building on MacOS X (for surround debuging)

Derk-Jan Hartman hartman at videolan.org
Thu Feb 19 16:23:59 CET 2004

On 19 feb 2004, at 11:23, Jean-Alexis Montignies wrote:
> On Wed, 18 Feb 2004 23:57:07 +0100
>  Derk-Jan Hartman <hartman at videolan.org> wrote:
>> On 18 feb 2004, at 15:09, Jean-Alexis Montignies wrote:
>>> Hi, Bonjour,
>>> I'd like to take a look at the bug reports 1765 (I initiated) and  
>>> 1421 which I think is related.
>>> Is the build bootstrap system up to date?
>>> http://www.videolan.org/pub/videolan/devtools/macosx-usr- 
>>> local.tar.bz2
>>> (Christophe Massiot did put it initially).
>>> I didn't try the 0.7.1 test version but I guess audio support did  
>>> not change.
>>> Greetings,
>>> Jean-Alexis
>> Hi good to have someone else on board willing to look into this.
>> We no longer use /macosx-usr-local.tar.bz2 in 0.7.0 and higher.
>> You can read about the new procedure here:
>> http://developers.videolan.org/vlc/osx-compile.html
> Ok, I tried that, but of course I missed many of the required  
> frameworks :).
> So it'll take some time until I have a can start on it. Especially, I  
> don't have a decent internet connection currently.

Yeah it can be a real b%tch in that case.

>> What i know so far of the issue.
>> - On the G5 we need to take hog before changing streams..
> This is only to switch to/from encoded streams which cannot be mixed  
> by CoreAudio.
> I don't have a G5 to check this.
A G5 is always in digital mode, so if you want to output pcm, you need  
to switch and you need to take hog mode while you do that.

>> - VLC does a lot of Device selection etc, but it's not 100% correct.  
>> I believe we should just use the default output.
> We'll still need a selection for the kind of output we want (stereo  
> downmix, Dolby Prologic downmix, surround, untouched digital output).

VLC has a channel selector (audio-channel) to switch between mono,  
stereo, reverse stereo, dolby. The audio-device variable in VLC can be  
used to switch between lpcm and digital mode. VLC devices need to be  
created for this.
What is also important in this respect is that if you switch the  
stream, you need to switch back when you are done. Apple once told us  

> Ideally we should use the settings in AudioMidi setup for the  
> stereo/surround ouputs for which outputs to use. But this would work  
> only from Panther (or Jaguar).

??? I don't really understand

>> - The portaudio project is running into the same problems.
>> http://techweb.rfa.org/pipermail/portaudio/2004-February/003093.html
>> they also seem to be a long way to fixing the issue. I think we  
>> should adopt their code.
>> - They don't have s/pdif support. This is the big mystery. There is  
>> no documentation available on what is allowed or required when  
>> setting the digital mode of a device. We are definitely doing  
>> something illegal here.
> The interface I have don't have hog mode, it has digital outs but only  
> supports PCM.
> But even on this interface, stream selection doesn't work (all streams  
> are available at the same time, so no switching is even required).
>> I also have some code that is a bit more barebones and correct than  
>> what is in CVS, but not nearly finished.
> Ok, I'll let you now when I can compile everything.
> Jean-Alexis

As far as i now understand it, the order should be like this i think.

- select device
- add the device to vlc, if the device supports digital, add another  
device to VLC.
- create a srcFormat from p_aout->output data this is the requested  
- use *somethingProperty* with kAudioDevicePropertyStreamFormatMatch to  
find the closest match that the device supports..
- take hog (no-op if device doesn't have hog mode)
- select the correct stream. remember the old format so we can switch  
- release hog
- use the return of this to set p_sys->output. (so a resampler  
(AudioConverter) can be inserted when it is needed)
- setup audio pipeline.

for pcm this will mostly be just fine, for digital i have no clue  
now to code it :) for which i don't really have the time atm. :(


Universiteit Twente
Derk-Jan Hartman (d.hartman at student.utwente dot nl)

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>

More information about the vlc-devel mailing list