-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be nice to be able to add DTS support. #72
Comments
I was just thinking about this. If it were just a software issue, and B9/C9 and BX/CX are really similar TVs, maybe we could toggle or add support... |
CX/C1 is physically able to play DTS track of mkv file. So I guess this is a software issue. |
it is indeed a software issue only. |
Do you mind sharing the steps to try that with a BX? |
EDIT: If you don't want to scroll through the whole thread, you can always access the latest release of
|
grat post! @pbatard ! Can you contact me? I think we can do a lot together. |
@pbatard great! I could play dts on CX by swapping libgstmatroska.so and libgstlibav.so with C9 libs but it worked only with gst-play. So glad you made it working. |
Here's a v2, that downmixes multichannel DTS to stereo and is therefore a lot more usable: Especially, if you don't have an external decoder but just use the internal TV speakers, then the above is pretty much all you need to restore DTS playback. Installation process is the same as before: Extract all the content to If someone wants to write a DTS Enabler webos app, that uses this content to enable DTS automatically (and in a more friendly manner) feel free to go ahead. Obviously, that app will require root access. Ideally, since I pulled the downmix coefficients out of thin air, we'd probably want to have that potential webos app handle the downmix values and feed them to Notes:
|
Just going to add that it appears that floating point DTS tracks appear to be more common than I thought, and these currently won't work, on account that the DTS codec will be trying to output audio as raw 32-bit floating point, and the default LG audio sink does not accept that. So you'll get a This file cannot be played error if the DTS track happens to be a floating point one. It'll probably require quite a bit of time to add support for floating point DTS... |
Here's v3, with the following changes:
Basically this version should play any DTS track (as long as it's embedded into a From this, it should be possible (by somebody else, as I am not planning to do that myself) to create a webos app, that handles the script overrides and also allows the user to set their downmix parameters by updating As far as non multichannel DTS is concerned, this should accomplish pretty much all we need, bearing in mind that, once LG releases their I'm still not too sure about multichannel, as we have at least 3 vectors of attacks there:
As opposed to floating point DTS (which was actually very simple, since the issue was not that there exists "floating point DTS tracks", as I erroneously assumed, but that the libav decoder for regular DTS was set to output floating point PCM by default, and there was just one flag to toggle to change that), this is going to require a lot of time to figure out... Finally, the source for the modified |
And here we go, as a new year's present, here's a working permanent DTS restoration package for LG OLED CX. As LG promised, they finally released the sources for GStreamer (as part of the The nice surprise, which I wasn't really expecting, is that 2x playback also works for DTS (as long as you don't play 4k videos, but that's a global limitation that applies to AC3/AAC too). With this sorted out, I can therefore enable a more permanent means of restoring DTS support, since there shouldn't be any loss of functionality for non DTS media. DownloadYou can download the new archive from HERE and basically the new DTS restore process is as simple as:
That's it. An uninstaller ( Oh, and this new version does not alter any of the original firmware files, such as the GStreamer registry (which we regenerate in SourcesI have now moved all the sources that were used to create the content under https://github.com/orgs/lgstreamer/repositories. Especially, you will find complete details on how you can recompile your own I'm still not completely sure why, since we're using the same source and should also be using the same Limitations (besides root)
Further informationSee https://github.com/lgstreamer/dts_restore. Oh and moving it to its own GitHub repository allows to get some nice Download stats (see above). |
@pbatard great job! |
Thanks @pbatard! |
• Only PCM stereo downmix why is that? isn't it possible to have 5+1? P.S. |
Because the default gstreamer output device (audio sink) that is being used when not decoding audio using the closed source proprietary libraries (that call the hardware directly) only outputs stereo. In short, that device says it accepts multichannel, but LG nerfed it so that only front left and front right are being output and everything else is discarded. And I have not discovered any "trick" to somehow toggle multichannel for that device. As a matter of fact, even when using the vanilla LG player and libraries, multichannel FLAC is not being handled properly and suffers the same issue of only FL + FR being output, because it seems FLAC is also being sent to the default limited gstreamer audio output sink. I sure wish LG had bothered giving us a default audio device that handles multichannel and passthrough, as one would find on any regular Linux distro, but I suspect they designed the default audio output for apps audio output where only stereo was needed (note that movie playback from apps is still being handled by the video playback stack, so it's not limited by this), and they cut corners in terms of the development time they'd have to invest otherwise.
As I believe I explained above, there are 3 possible ways we may be able to get 5.1/7.1 which basically are:
In short, considering that I'm planning to tackle approach 3, I'm hoping that, if I'm lucky, crafting such a plugin may only take me 1 week full time work (and will work, which is still not guaranteed), but as you can imagine, I can't exactly be taking 1 full week away from other activities just like this, so it'll probably be a month or two at best before I can spend enough time on looking into that. And that's hoping that this whole writing a gstreamer manager plugin doesn't turn out to be much more complex than I anaticipate... which, as with any software project, is almost always invariably the case. Now of course, if someone wants to spend their own time looking at the pulse audio and gstreamer source to investigate approach 2, or even more time reverse engineering LG's proprietary libraries to poke 1, feel free to go ahead!
As mentioned here (since this is what I used to root my TV) I'm on |
I don't know if it helps somewhat but for some reason my LG CX could play DTS audio (with full 7.1 audio) through PLEX native app and via Direct Play too. But it only happens for one movie and it's Pan's Labyrinth (2006), with original Spanish language. I'm sorry if it's against the rule but I torrented it and the file name is Pans.Labyrinth.2006.SPANISH.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.7.1-SWTYBLZ. So far I only notice that movie. All the other movies with DTS are always mute when playing dts via PLEX, except that one. Maybe because it is in Spanish and somehow LG lets it pass through? I'm just a casual viewer so maybe you can check it out to see if there's any trick you could discover. |
Have you confirmed that the audio in that file is actually DTS? |
Or the the PLEX application isn't doing transcoding on the fly, which, AFAIK, is what PLEX server does (i.e. it queries the target device to find out what kind of multichannel audio it can output and, if needed, such as if a device cannot output DTS, transcodes DTS to PCM or EAC when sending it to the device). The DTS decoding on CX models is pretty black and white, and LG's explicitly removed DTS demuxing from the Matroska (mkv) gstreamer plugin, so there's absolutely no way you can get DTS playback with the vanilla gstreamer plugins when playing a
My guess is that this movie has an additional EAC3/DD track besides the DTS one, and your other movies don't. The LG player is designed to automatically fall back to an audio track it can play if the first audio track it tries is not supported, and the behaviour you observe with some movies (with only a single DTS track) being silent while others (with a DTS track and an EAC3 track) producing audio is exactly what one would expect. |
Yup, I checked and confirmed it's indeed DTS-MA. I also tried to play it through MPC-HC (PC) and it's mute with the "Audio Not Supported" message. But through PLEX it can play all 7.1 channels.
The others are also bluray movies and they also have multi-tracks with DTS and EAC3 just like this one. And they can only play audio when I choose EAC3, no sound from DTS. Also here is a vid showing Plex's info screen I just recorded: https://youtu.be/9awka3CrlGs P/s: In case anyone wondering, the soundbar you see in this vid is Samsung Q950A that supports all the sound codec and also eARC supported. The setting for the TV and soundbar is Pass-through and all HDMI bitstream. |
Hold on. What happens without the sound bar? Pass through is a very different beast, so I could see how a track that is wrongly advertised as EAC3 but is actually DTS could end up being passed through by the PLEX app (though I have to say, this is one of the avenue I explored with the internal player as well, i.e. modify the gstreamer demuxer to set the audio type of the DTS data to I guess if it turns out that a PLEX player that misreports DTS tracks as EAC can get the TV to just pass through the data, then we might as well try to build a PLEX app that always forces DTS as EAC always, as this should solve the multichannel output for people who have an external DTS decoding device. |
I just checked. Without the soundbar, and with Internal TV Speaker, the DTS audio still comes out just fine. The Plex Info still shows that it was streaming dca and 7.1.
Yeah, unfortunately it doesn't show me what codec it is receiving. The soundbar's display only shows Dolby Atmos text whenever it detects one. edit: remove link of the file |
Please don't post links to copyrighted content, even obfuscated. I would gather that if someone really wants to get their hands on the file you mention, they can do so without needing any other hints but the file name. |
Got it. Thanks for telling me. |
As far as I know plex server transcodes DTS but just leaves original label in app.
|
I'm pretty amateur so my CX isn't rooted yet. So far I only used the Dev-manager method to install Homebrew and Youtube-adfree. Will try to look into alternate rooting method. If success then I will do what you said and post result. But I'm actually confident that there isn't any transcoding process happening. Mainly because my plex server is my PC so I can easily check how much Plex's using resources from my i5 Gen10 cpu. And the absence of loading time also proves it is truly in Direct Play mode. Still I'm gonna try to root my CX for further info. |
Transcoding audio is peanuts. It's transcoding video that is CPU intensive, but for any modern processor, decoding and reencoding DTS to PCM will hardly make a dent in your resource usage.
Then, as far as I know (though I am not that familiar with Plex), there is definitely automatic transcoding happening according to what the client device says it can handle. That's how Plex servers and clients are designed to work. |
ok, no problem. I've installed plex and checked with my CX on the same video file as you did.
Actually seems Plex is not so smart :) |
After many attempts, I can finally root my CX and managed to pull the info:
With Aabytt it's aac but with mine it's ac3.
yes, and I ticked it to DTS support. Plex leaves all the other movies with DTS audio alone, but somehow "secret transcode" Pan's Labyrinth into aac/ac3? Either CX misread the codec or it's just my failed hope all along... I'm looking for a way to check whether Plex transcodes stuff or not in the Client's side, but I guess now I'm not much enthusiasm like before. |
This file has 2 tracks. One is DTS and other is AC3. Plex streams only single selected track. I guess in your case you have AC3 selected and it is just streamed with no transcoding. If you switch to DTS track it will transcode it and you'll see AAC in |
@pbatard Thank you for the time you took to research how they removed the codecs! Wouldn't it be easier to get the relevant files from a B9/C9 and replace them into the BX/CX to allow full functionality? (I mean splitter, decoder, surround and passthrough). After all, both TVs work almost the same. |
The act of playing the audio in a video, any audio, allows DTS-restore to work on the next (or subsequent) attempt. Until the TV is restarted that is. |
@agisthos, I suspect that you have been trying to install the DTS override from a telnet session, and are running into lgstreamer/dts_restore#2. Please make sure that you use an ssh session and not a telnet session when trying to run the script, as telnet will not work because it fails to define the required environment variables. |
@pbatard sorry I was not clear, I got SSH working, installed your DTS_Restore via SSH and DTS audio now works great. But on the G2 all those 'this audio not supported errors' occur, triggered exactly as described above. I then did my sisters G1 and no such errors. So either the 2022 models have new compatibility issues, or the initial failed install attempt in Telnet has mucked something up on my G2. |
I pretty much designed the script so that it can't, and the person who ran into the telnet issue in lgstreamer/dts_restore#2 had no issue once they ran the install script from ssh after initially doing so through telnet. And the one-time errors you see are expected (I mentioned them explicitly above, and they are also mentioned in the README). I get them all the time on my CX, and I am not planning to look into those before I start looking into multichannel DTS, so you will have to live with these for now (or, if you can figure out how to remove them on your own, then I'm interested!). |
@pbatard Is there a log one can view that these errors possibly go into? |
There sure is. From my very first post above:
|
Just a quick note that I just released an updated version of DTS Restore here (v1.1). This is a minor update that makes sure that we use the latest CX sources for the GStreamer plugins (though for the ones we are interested in, I don't believe the code has changed) as well as make sure that we properly detect and report issues with using telnet/not detecting |
Today for some reason I started getting "Audio is not supported" when playing a file with a DTS track in it. I recently rooted my TV but I don't think that should have stopped the ability to pass-through the DTS track to my received. I hadn't experienced this issue before on my LG C1 though and I'm wondering if this could help? It's an OLED55C1AUB TV with webOS 6.3.2 and GStreamer 1.16.2. |
@casenjo wait, you saying that your C1 was passing-throug DTS tracks before? It is hardly possible. |
@aabytt I'm not entirely sure, and if you're saying it's hardly possible then I would lean more towards it being a mistake on my end. I have quite a few video files with DTS tracks that I was able to watch just fine with the C1 but maybe my Kodi setup wasn't configured to do DTS passthrough before and now that it's enabled I'm running into the issue. |
@casenjo, have you been playing movies with some external device over hdmi? Then I guess pass through is possible. DTS decoding is not supported when playing media with webos itself. |
@aabytt no, I was playing movies and shows from Kodi on my home theatre PC connected to the TV which would then pass the audio over to my audio receiver. I never played movies directly from WebOS itself. |
On the LG G2 I have done a few firmware updates and DTS restore was working after each one. But anyway, after regaining root I ran this method again and DTS is back and working! |
Just worked then on rooted G2 with latest 3.33.65 firmware. Best guide to ROOT the TV in the first place is by crashd |
Hi, first off: Thanks @pbatard for your awesome work. I'm impressed what some people are able to achieve, hacking devices like TVs etc. I tried your installer on my already rooted LG OLED C22LB, so 2022 model with WebOS 7 version 03.30.45 (haven't updated since root). Got your warning message (LG OLED CX TVs running |
Hello all. Is there any news about CX DTS -> PCM passtrhough? |
This is not going to happen. You'd have to spend weeks (or more likely months) of full time work to first reverse engineer the proprietary LG libraries and hardware and then rebuild/patch these libraries so that they can accept DTS passthrough. Best you might get is multichannel DTS support (in the form of multichannel PCM sent to the decoder), but whereas I was planning to work on this at one stage, I currently don't think I'll ever find the time/motivation to do so. |
hey @pbatard ever thought about setting up a Patreon/Fundraiser for this? |
The problem is not money. The problem is that, at best, this will help a couple thousand people entertain themselves with regards to technology that is quickly becoming obsolete (because fewer and fewer people care about features related to specific TV models that were released years ago) whereas there are plenty of other projects I can currently use my time on, where the effort I spend will ultimately be beneficial to a lot more folks. As far as I'm concerned, no amount of money can justify spending time on this unless I happen to not have something that I consider more fruitful to do, which is unlikely to happen in the short to medium term... |
This would be great for 99.9% of people. But I understand your position about the project. Sad for me and others. But I understand it. Thanks for the work so far. Now I have to finde a way to add ac3 to all od my dts media. |
@pbatard I used your patch on my C2 and it worked flawless. I'd like to thank you for the time and effort you put into this project. |
I used the DTS patch on my C29 with webOS 8.3 a few days ago. Since then i have a dead Pixel, bright red Pixel and a black vertical Line. |
@djkroko, dead pixel/deal lines are caused by pure hardware issues. They cannot be caused by software. The LG OS (where the DTS component apply, and where these components only apply to the audio processing chain) does not have that kind of premanent direct control of the individual pixels of the display. A more valid explanation, if you want to point at fingers at things you can never have definite proof of, is that the recent solar flare is what caused your dead pixels, since it has been known to cause hardware failures in electronics all over the world. But the most likely explanation is that, hardware does fail, regardless of what you do with it and regardless of the external conditions, and that you experienced a failure that coincided (but was in no way caused) with your usage of the DTS patch. At any rate, since you weren't using a CX model, you will have seen this very explicit message, which you accepted:
|
I patched my rooted C1 recently and DTS works flawlessly with all tested MKVs. |
I used your DTS_Restore patch on my LG CX TV to fix the issue I was having with the LG Plex app where not being able to direct play DTS audio caused high bit rate 4k video to become corrupted. It worked flawlessly and now I can play DTS Audio Any chance you could do a similar fix for TrueHD audio on LG TV's? |
TrueHD should be supported natively. At any rate, I am not planning to spend any more time on this. If you or anybody else wants to add new audio functionality, you can find how this was accomplished for DTS in the repos at https://github.com/orgs/lgstreamer/repositories and do something similar (and yes, I'm afraid you will have to invest your own time on this rather than expect someone else to do it for you). |
LG doesn't handle TrueHD it tries to transcode it down to eac3 and causes this video error with high bitrate 4k Videos The same video corruption I was getting with dts audio files since it cant direct play the audio it also transcodes the video from MKV < MPEGTS. This problem was fixed for 4k files with DTS audio since now with your patch I can now direct play the audio. Someone please look into seeing if the same patch with DTS can be created with TrueHD |
Please add a fix for Truehd codecs not being recognized |
Just FYI I have a G2, rooted and with DTS Restore working but have blocked firmware updates for over a year because of the recent root exploit patching. Did not want to risk it. But I just then updated, first to firmware 4.40.93, then TV updated WebOS to 23, then another firmware update to 13.30.85 Long story short, DTS Restore still works fine. Its now actually better, as previously the first DTS video that was played upon a TV reboot would fail (only the first one) and have to be restarted. Now this does not occur. |
LG OLED CX and later TVs do not support DTS anymore.
It would be nice to add it back.
The text was updated successfully, but these errors were encountered: