SPDIF encoded output on G5
SPDIF encoded output on G5
- Subject: SPDIF encoded output on G5
- From: Derk-Jan Hartman <email@hidden>
- Date: Wed, 30 Nov 2005 21:35:08 +0100
- Resent-date: Wed, 30 Nov 2005 21:52:44 +0100
- Resent-from: Derk-Jan Hartman <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden
There i am again.
I fixed an issue VLC had with hogging the device, but i'm still not
getting any digital audio out of the thing.
I tried setting Mixable to no, but that apparently is being done
automatically, and i'm not allowed to set it (HALlab says that as well).
The one real difference I could see was the following in the ASBDs
G5
[48000][cac3][94][6144][1536][0][2][16]
Sonica
[48000][cac3][76][6144][1536][0][2][16]
So that is a diff in the formatflags, specifically the IsBigEndian
flag and the isPackedHigh flag.
As far as I can tell however that shouldn't matter correct?
In IOProc I tried switching between different timestamps etc etc. but
it didn't seem to matter. The audio is being put in the buffers, it
simply seems like my receiver can't make heads or tails from it
anymore, yet DVD Player works just fine.
In HALLab I tried comparing the settings of DVD Player with the
settings when VLC is running, and there is simply no difference.
I was looking at the ioproc and did see
[00000294] coreaudio audio output debug: AudioDevice: 257,
OutputBufferlist.#Buffers: 1,
[00000294] coreaudio audio output debug: OutputBufferlist.#channels:
2: OutputBufferlist.datasize: 6144
The #channels, could that be an issue perhaps? Does it have any
relevance in the context of SPDIF ?
Speaking of channels. another idea I was having is that for digital
modes, I set all the options on the "masterchannel" of the device/
stream. However I don't think that could be an issue.
The G5 is the only digital output that VLCs Digital audio output
doesn't seem to work with, and I can't seem to figure out why. Is
there anyone who has been able to use this feature successfully in
his application?
DJ
static OSStatus IOCallback( AudioDeviceID inDevice,
const AudioTimeStamp * inNow,
const void * inInputData,
const AudioTimeStamp * inInputTime,
AudioBufferList * outOutputData,
const AudioTimeStamp * inOutputTime,
void * threadGlobals )
{
aout_buffer_t * p_buffer;
mtime_t current_date;
aout_instance_t * p_aout = (aout_instance_t *)threadGlobals;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
#if 1
p_sys->clock_diff = - (mtime_t)
AudioConvertHostTimeToNanos( AudioGetCurrentHostTime() ) /
1000;
p_sys->clock_diff += mdate();
#endif
current_date = p_sys->clock_diff +
AudioConvertHostTimeToNanos( inNow->mHostTime ) / 1000;
#define B_SPDI (p_aout->output.output.i_format == VLC_FOURCC
('s','p','d','i'))
p_buffer = aout_OutputNextBuffer( p_aout, current_date, B_SPDI );
#undef B_SPDI
#define BUFFER outOutputData->mBuffers[0]
if( p_buffer != NULL )
{
/* move data into output data buffer */
p_aout->p_vlc->pf_memcpy( BUFFER.mData,
p_buffer->p_buffer, p_buffer-
>i_nb_bytes );
aout_BufferFree( p_buffer );
}
else
{
msg_Dbg( p_aout, "no p_buffer");
if( p_aout->output.output.i_format == VLC_FOURCC
('f','l','3','2') )
{
UInt32 i, i_size = p_sys->i_bufframe_size *
p_sys->stream_format.mChannelsPerFrame;
float * p = (float *)BUFFER.mData;
for( i = 0; i < i_size; i++ )
{
*p++ = 0.0;
}
}
else
{
p_aout->p_vlc->pf_memset( BUFFER.mData, 0,
BUFFER.mDataByteSize );
}
}
#undef BUFFER
return( noErr );
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden