B Series DTS bugs & support

Here for general support for B series TVs, request and problem solve area.

smartsmurf
Official SamyGO Developer
Posts: 111
Joined: Thu Jun 24, 2010 8:26 am
Location: Frankfurt, Germany

Re: B Series DTS bugs & support

Post by smartsmurf »

davidhorman wrote: Does anyone have any ideas?

smartsmurf, if you're there, is there a mistake on line 55 of CParsingMedia.cpp?

Code: Select all

 #define S_MatroskaDemuxContextOld MatroskaDemuxContextOld
// should this be:
 #define S_MatroskaDemuxContext MatroskaDemuxContextOld
The line 55 of CParsingMedia.cpp is just OK the way it is.

I should update the README with some build instructions. What you need to do is the following:

(1) get libdca, ffmpeg and samygodca in right place:
<someplace>\ffmpeg
<someplace>\libdca
<someplace>\samygodca

(2) run the patch file over ffmpeg.

(3) configure and make ffmpeg using

Code: Select all

./configure --prefix=/usr/local/arm-chelsea-linux-gnueabi --cross-prefix=arm-chelsea-linux-gnueabi- --enable-cross-compile --arch=arm --cpu=arm1176jzf-s --target-os=linux --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-extra-warnings --disable-debug --enable-stripping --enable-optimizations --disable-memalign-hack --disable-devices --enable-armv6 --enable-armv6t2 --enable-armvfp --disable-network --disable-ffmpeg --disable-ffprobe --disable-ffplay --disable-ffserver --disable-zlib --enable-shared --disable-bsfs --disable-muxers --disable-encoders --disable-filters --disable-swscale-alpha --disable-doc --extra-cflags='-Wall -O3 -fPIC -DPIC -mfpu=vfp -mfloat-abi=softfp -fsingle-precision-constant'  && make
(4) configure and make libdaca using

Code: Select all

./configure --prefix=/usr/local/arm-chelsea-linux-gnueabi/ --host=arm-chelsea-linux-gnueabi --build=i686-pc-cygwin --disable-oss --disable-solaris-audio --disable-al-audio --disable-win --enable-warnings --enable-shared && make
(5) make samygodca

Good luck!
smartsmurf
Official SamyGO Developer
Posts: 111
Joined: Thu Jun 24, 2010 8:26 am
Location: Frankfurt, Germany

Re: B Series DTS bugs & support

Post by smartsmurf »

davidhorman wrote: The downside is that it would also pass raw DTS to the internal speakers, which results in loud, rapid bursts of white noise. A better implementation would be to pass DTS to the optical out, but decode it for the TV's speakers (though personally I'd prefer it not to decode so that the TV doesn't lag as much).
The idea is really good. Unfortunately the HW/SW design of Samsung is not compatible with it. The system uses shared memory for main CPU (ARMV6) and also AIDA audio engine (CalmRISC16). Both parts will be synchronized using a circular buffer with read and write pointers. So there is no way to send two audio frames (one PCM and one DTS) through the same channel.
sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: B Series DTS bugs & support

Post by sbav1 »

davidhorman wrote: :( Oh well... it must be possible, somehow, since AC3 passes through.
AC3 (ES) stream is not going through PCM microcode, it has its own microcode, audio path & settings for Spdif Tx.
From what I see, in T-VAL* C-Series firmware audio paths/engines/microcodes are a little bit different (still AIDA, though), but Spdif hardware looks quite similar to B-Series (pretty much the same registers, on different addresses). I suppose B-series Spdif TX should handle DTS stream just fine on hardware level :).
I'll keep trying!
By all means, it's worth a try. BTW, I'm not 100% sure about "bit-perfect" thing, it's just an educated guess (to confirm this, soundcard with optical input will be really usefull , but I don't have one).
Last edited by sbav1 on Tue Feb 01, 2011 1:23 am, edited 1 time in total.
sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: B Series DTS bugs & support

Post by sbav1 »

davidhorman wrote: sbav1, as an experiment I've just played an AVI (with an mp3 audio track, I believe) on my Samy and recorded the SPDIF output into a PC (with SPDIF/USB box which I know to be a perfect capture device). Then I mixed that with a decoded, and inverted, soundtrack from the same AVI opened on the PC - the result (strangely but encouragingly) was one perfectly blank channel, while the other still had music but the vocal part had been completely cancelled out. I'm not sure what happened exactly, but it does seem to suggest to me that the Samsung PCM output could be bit-perfect without having to be bypassed, and that the mp3 decoder produces identical PCM as that made by Adobe Audition.
That's encouraging. As experiment: mux a small .wav pcm file with avi movie (eg. in virtualdub), play movie on Tv & record audio on PC, convert both original and recorded .wav files to (headerless) 16bit stereo 48kHz .raw/.pcm, and compare the .raw files (with bsdiff, or equivalent tool). Then we will know for sure :).

Another experiment: mux padded (or better, wrapped) .dts file (or just random .wav track ripped from dts audio CD) with avi movie, and try to play it on TV.

Yet another experiment: record in 24bit mode; every 3rd byte in result file should be 0x00.
User avatar
erdem_ua
SamyGO Admin
Posts: 3126
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey
Contact:

Re: B Series DTS bugs & support

Post by erdem_ua »

That is really weird. Why Samsung TV has such a problem on it's digital output?

If that "noise" follows same pattern, how about a avi track with inverse pattern of it? If that noise does not came from analog circuitry, we could feed inverse of that signal, that inversion cancels that "noise" and we have pure silent channel to use for raw data streaming... Also we could faced with synch problems, to match that wave... But if we understand it's nature, (for example if it starts with 50 zero and than 50 +1 every time on digital streaming started) than we could produce code to handle that "bug" too.
sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: B Series DTS bugs & support

Post by sbav1 »

davidhorman wrote: So it seems this may be a dead end
Hell, no! I think in fact it's a really good idea. It may require some additional research, though ;).
though I'm still not sure why the bitstream is so nearly, but not quite, perfect, or why a silent AVI was perfectly recorded.
Good question. As strange as it seems, I belive Samsung is converting anything to 24bit for spdif PCM output. Perhaps they are using 32-bit float audio format for internal processing in PCM AIDA microcode (?), and 00*11* patterns are "collateral damage" related to 32 bit float -> 24 bit int output conversion ?

Anyone (smartsmurf - ?) able to disassemble calmrisc16 AIDA microcode? Binutils? Toolchain?

Also, AIDA engine has a bunch of [virtual] RAM registers; perhaps we just need to flip a couple of bits in those registers to make it bit-perfect?
it may be that without the low-level access the TV uses to stream AC3, we may not be able to stream DTS.
AFAIK AC3 audio path in Samsung B-series is (even more) FUBAR.. maybe it will be usable somehow for DTS stream, but that's not necessarily an easiest way :?. There are many strange (perhaps more useful) things in samdrv.ko: AC3 encoder (!), software/ARM decoders for some audio formats (btw, question: do samdrv.ko "arm decoders" output to AIDA PCM engine, or directly to Spdif Tx / analog codec chips ?)

Post Reply

Return to “[B] Support”