View Full Version : modify ac3 stream dsurmod field?
plugh
26th March 2008, 17:11
I've been playing with transport stream captures, and have become suspicious about the way my (cheap) sound system handles ac3 2.0 streams.
Using various tools, I have noted that these 2.0 captures have the dsurmod field in the frame headers set to '00' = 'Not Indicated'.
Is there a tool out there that will process an .AC3 file (extracted from a transport stream) and set the dsurmod field to '10'='Dolby Surround encoded' ?
Thanks!
unskinnyboy
26th March 2008, 18:34
'00' is the default, and since AC3 decoders don't use that field, that's probably the reason why encoders don't set a value for dsurmod. If you want to change it to '10', couldn't you just use a Hex editor?
plugh
26th March 2008, 19:38
It's in every frame - that would be LOTS of hex editting, and then I also have to recalc all the frame CRCs...
I think I might be able to modify 'delaycut' to do this, but before I tackle it am still hoping someone already has a tool...
thanks again...
setarip_old
26th March 2008, 22:37
@plugh
Hi!
Perhaps the following provides some insight:
http://en.wikipedia.org/wiki/Dolby_Digital2-channel stereo (Left + Right), optionally carrying matrixed Dolby Surround
unskinnyboy
26th March 2008, 22:58
It's in every frame - that would be LOTS of hex editting, and then I also have to recalc all the frame CRCs...
I think I might be able to modify 'delaycut' to do this, but before I tackle it am still hoping someone already has a tool...Right. I shouldn't have assumed that the AC3 file was a small, manageable one. At the moment, I can't think of any tool which would do what you want (doesn't mean it doesn't exist), but if you are OK with re-encoding, you can use something like Aften to set the field (-dsur 2).
I am not sure what setarip_old is trying to say.
plugh
26th March 2008, 23:40
Turned out to be a very quick and dirty hack to 'delaycut' utility. It already had the code to read the headers, calc the crc's etc, and it has a 'Fix CRC Errors' mode...
So I just added a line of code to change dsurmod for each frame before it verified the crc (which meant every frame then failed the crc check) and then told the program to run in 'fix crc errors' mode. :D
And the end result was --- it didn't make any difference to my sound system.
Oh well...
jruggle
27th March 2008, 22:12
And the end result was --- it didn't make any difference to my sound system.
The dsurmod field is only an indicator that the 2-channel stream has surround channels matrixed-in to left and right channels. The encoder would only turn on the flag if it knows that this is true. But even if you change the field, it still doesn't make the stream surround matrixed. For example, Aften has the option to set the field, but the user still has to provide an already-matrixed input audio stream for it to work properly.
plugh
29th March 2008, 00:39
When I feed audio to my (cheap) sound system via optical, the unit typically either displays 'PCM' 'Dolby Digital' or 'DTS'. However, on RARE occasions I have observed it to MOMENTARILY display 'Dolby Prologic'.
When in PCM mode, or when fed via analog stereo input, 'Dolby Prologic' is a *selectable* mode on the unit. But that selection is NOT available when fed a Dolby Digital 2.0 stream.
This got me curious - was there something in the digital stream that triggerred this mode momentarily? Something that probably was absent from most Dolby Digital 2.0 streams?
dsurmod sure seemed like a candidate.
But my test showed that it wasn't. Oh well...
Just another of modern life's minor mysteries.
jruggle
29th March 2008, 01:57
When I feed audio to my (cheap) sound system via optical, the unit typically either displays 'PCM' 'Dolby Digital' or 'DTS'. However, on RARE occasions I have observed it to MOMENTARILY display 'Dolby Prologic'.
When in PCM mode, or when fed via analog stereo input, 'Dolby Prologic' is a *selectable* mode on the unit. But that selection is NOT available when fed a Dolby Digital 2.0 stream.
This got me curious - was there something in the digital stream that triggerred this mode momentarily? Something that probably was absent from most Dolby Digital 2.0 streams?
dsurmod sure seemed like a candidate.
But my test showed that it wasn't. Oh well...
Just another of modern life's minor mysteries.
possibly the "preferred downmix mode" in the alternate bitstream format?
plugh
29th March 2008, 02:33
Had me excited for a moment - but the A52B spec states for dmixmod "Note: The meaning of this field is only defined as described if the audio coding mode is 3/0, 2/1, 3/1, 2/2, or 3/2. If the audio coding mode is 1+1, 1/0 or 2/0 then the meaning of this field is reserved."
Description of dsurmod sure fits the bill ("not used by the AC-3 decoder, but may be used by other portions of the audio reproduction equipment") as the sort of thing that would switch the system to Pro-logic mode, but the test file I created played the same...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.