Dr. Werner Fink wrote: > Guess: the type `TYPE_ES' (Elementary Stream) is identical to > what I've called `RAW' Audio. Also `TYPE_MPEG1' seems _not_ > to be Mepg Audio within PES (Packetized Elementary Stream). TYPE_PES would be "payload of TS packets", i.e. everything except the 4 header bytes and possible adaption fields (so stuffing at the end of a PES packet is removed, too). This is what you normally call a "PES stream". TYPE_ES is only payload data, no PES header, thus no (PTS-)timing information. An .mp3 file, for example, contains only ES data. TYPE_MPEG1 is an mpeg1 system stream, i.e. multiple ("Dual-")PES streams, with some additional header packets (correct me if i'm wrong). It's really not documented anywhere, nor seems the tuxbox way compatible with the av7110 way. Both implementation seems to be very close to the hardware implementation, and are (nearly) undocumented, thus we need something better. (Any complaints? I know that the av7110 way is semi-standard trough the audio.h file, but i don't think it makes much sense there) We still need to declare what kind of data the payload is. We have normal MPEG Layer 1/2(/3), then AC3, DTS (in two flavours, though the LPCM stuff could probably be played with LPCM mode), LPCM. On tuxbox, this is currently done in a way you-don't-want-to-know (AUDIO_SET_BYPASS accepts 0..4 for different formats). Unless i'm mixing something, we need to differentiate the packaging (ES/PES/SYSTEM, maybe PS - what exact kind of difference is there between PES, PS and SYSTEM regarding the processing of one PES stream?), then the format (MPEG, AC3, DTS, LPCM, maybe RAW for outputting decoded data) and then the output format (decoded, decoded w/ mixdown, bypass). may i propose: #define AUDIO_ENCAP_PES 0 #define AUDIO_ENCAP_ES 1 #define AUDIO_ENCAP_SYS 2 #define AUDIO_ENCAP_PS 3 #define AUDIO_FORMAT_MPEG 0 #define AUDIO_FORMAT_AC3 1 #define AUDIO_FORMAT_LPCM 2 #define AUDIO_FORMAT_DTS 3 #define AUDIO_FORMAT_RAWIEC958 4 /* any other we could think of? */ typedef struct audio_format { int encap; int format; } audio_format_t; #define AUDIO_SET_FORMAT _IOW('o', 19, audio_format_t) (plus the already known AUDIO_SET_BYPASS_MODE for the different decoding possibilities) Do audio format need additional specifiers? (does LPCM require the sample rate to be set, or is that included in some headers? What's about AC3 decoding parameters?) We may need to add a "additional" field. Setting encap to AUDIO_ENCAP_ES (or _PES, if you want automatic sync), format to AUDIO_FORMAT_RAWIEC958, bypass to "enable" would allow you to output RAW S/P DIF frames (hardware support provided, of course). btw, has anybody ever used KARAOKE stuff? Do we need this? regards, Felix