[App] libSpdifMode D/E/F/H

Here are software that related with Samsung F series TVs.
Please don't create any new topic here unless you have software to post/release.
Post Reply

zoelechat
SamyGO Moderator
Posts: 8509
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

[App] libSpdifMode D/E/F/H

Post by zoelechat »

Patch allows to quickly switch Spdif mode between available ones (PCM/DD or PCM/DTS) without having to explore TV menus or use any key macro to do so. Mainly designed to be used with libRCremap with CMD support.

Usage:
*For D series (arm), replace every instance of /mnt below by /mtd_rwcommon/widgets/user/SamyGO/SamyGO
  • Get latest samyGOso from there and copy/overwrite samyGOso file (not folder) to /mnt/opt/privateer/usr/bin
  • Set permissions if needed (usually not if overwritten)

    Code: Select all

    chmod +x /mnt/opt/privateer/usr/bin/samyGOso
  • Extract attached archive and copy libSpdifMode.so to /mnt/opt/privateer/usr/libso (create folder if needed)
  • Execute

    Code: Select all

    samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libSpdifMode.so
    Commandline can take MUTE arg if you want to mute TV's internal speakers as soon as SPDIF mode is set to DD/DTS, and to unmute when back to PCM (added this option because DD/DTS decoding generally introduces delay).

    Code: Select all

    samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libSpdifMode.so MUTE
  • If you're using libHDMIpassthru with DTS arg, lib can't detect current audio out mode since all are permanently unlocked. It results in libSpdifMode switching to AC3/DTS once without possibility to go back to PCM. In such case you can use FORCEPCM arg for lib to skip detection, use a flag file instead and switch as expected then.

    Logfile is written to /dtv/SpdifMode.log
Usage with libRCremap with CMD support:
  • Do not directly inject libSpdifMode as CMD, a little intermediate script is needed to prevent consecutive injections, depending on how long you press remote button. Here's sample script (D/E/F only):
    SpoilerShow

    Code: Select all

    #!/bin/sh
    [ $(pidof ${0##*/}) ] 2>/dev/null || exit 0
    SODIR=/mnt/opt/privateer/usr/libso
    SAMYGOSODIR=/mnt/opt/privateer/usr/bin
    
    	$SAMYGOSODIR/samyGOso -A -B -l $SODIR/libSpdifMode.so MUTE
    	sleep 2				# to prevent consecutive injections
    Script is attached in archive (CMD_libSpdifMode), edit paths in it if needed.
  • H-series users have to use another script:
    SpoilerShow

    Code: Select all

    #!/bin/sh
    [ -e /tmp/.${0##*/} ] && exit 0 
    echo OK > /tmp/.${0##*/} 
    SODIR=/mnt/opt/privateer/usr/so
    SAMYGOSODIR=/mnt/opt/privateer/usr/bin
    
    echo "$SAMYGOSODIR/samyGOso -d -A -B -l $SODIR/libSpdifMode.so MUTE" | /dtv/bin/nc localhost 2023
    sleep 2            # no new execution allowed before 2 seconds 
    rm /tmp/.${0##*/}
    CMD_libSpdifMode.zip
  • Copy script to /mnt/opt/privateer/usr/bin
  • Set permissions

    Code: Select all

    chmod +x /mnt/opt/privateer/usr/bin/CMD_libSpdifMode
  • and remap expected key in libRCremap.config to

    Code: Select all

    CMD:/mnt/opt/privateer/usr/bin/CMD_libSpdifMode
  • Check libRCremap with CMD support for more infos :)
*Changelog:

Code: Select all

12/4/2016
v0.1.1 - Added FORCEPCM arg on request
       - Much dirty code removed (almost rewrote everything!)
1/3/2015
v0.1.0 - First public release
You do not have the required permissions to view the files attached to this post.
I do NOT receive any PM. Please use forum.

Rednox
SamyGO Project Donor
Posts: 6
Joined: Wed Apr 06, 2016 12:59 am

Re: [App] libSpdifMode D/E/F/H

Post by Rednox »

Hey,
i have your app running with the hdmipassthrough app. It is working as long i don't use the DTS option for the hdmipassthrough app. If i have the DTS option running, the Dolby Digital & DTS option are always enabled. So your app doesn't work in this specific case.
Is it possible for you to edit the app that it walks through the options PCM-DolbyDigital-DTS!

If you can share the code, i could also help!

Best Regards
Rednox

zoelechat
SamyGO Moderator
Posts: 8509
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libSpdifMode D/E/F/H

Post by zoelechat »

Yeah I'm aware of the problem, but since you're the first one to report it (and even to post here :D) after more than one year, I didn't find worth fixing it! (at least not in public version...) You still can force back to PCM on TV using PCM arg of libHDMIpassthru.

Source code is ALWAYS included in my releases archives :)
I do NOT receive any PM. Please use forum.

zoelechat
SamyGO Moderator
Posts: 8509
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libSpdifMode D/E/F/H

Post by zoelechat »

Here you go, new version posted :)
1ST POST wrote:
  • If you're using libHDMIpassthru with DTS arg, lib can't detect current audio out mode since all are permanently unlocked. It results in libSpdifMode switching to AC3/DTS once without possibility to go back to PCM. In such case you can use FORCEPCM arg for lib to skip detection, use a flag file instead and switch as expected then.
I do NOT receive any PM. Please use forum.

deanicus
Posts: 5
Joined: Wed Aug 18, 2021 11:12 pm

Re: [App] libSpdifMode D/E/F/H

Post by deanicus »

I can't seem to get this to work for me unfortunately

Have a H6400 on MST firmware 2130. I had to edit the CMD file as my port for netcat seems to be 3023. Either way though, if I run the CMD file directly, it does nothing and no logs generated. If I inject the lib directly, the audio does cut out for a second but it doesn't change the mode. Thankfully logs are generated on direct injection

As I mentioned in the other thread, I am running the HDMI passthrough lib with DTS option

See attached logs and CMD file below

Code: Select all

#!/bin/sh
[ -e /tmp/.${0##*/} ] && exit 0 
echo OK > /tmp/.${0##*/} 
SODIR=/mnt/opt/privateer/usr/so
SAMYGOSODIR=/mnt/opt/privateer/usr/bin

echo "$SAMYGOSODIR/samyGOso -d -A -B -l $SODIR/libSpdifMode.so FORCEPCM" | /dtv/bin/nc localhost 3023
sleep 2            # no new execution allowed before 2 seconds 
rm /tmp/.${0##*/}
You do not have the required permissions to view the files attached to this post.

zoelechat
SamyGO Moderator
Posts: 8509
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libSpdifMode D/E/F/H

Post by zoelechat »

There might be several netcat ports opened. You must be sure about it, and the one given in first post is not random.
Anyway maybe not worth struggling with script if direct injection doesn't work. Can't tell if it has already been tested successfully on H (from reports above :D)
But if you hear audio cut it's definitely "doing something"... Maybe try to inject twice (because of FORCEPCM "cant' guess" flag). Also log you've attached doesn't show you used that flag.
I do NOT receive any PM. Please use forum.

deanicus
Posts: 5
Joined: Wed Aug 18, 2021 11:12 pm

Re: [App] libSpdifMode D/E/F/H

Post by deanicus »

zoelechat wrote:
Mon Sep 13, 2021 8:52 pm
There might be several netcat ports opened. You must be sure about it, and the one given in first post is not random.
Anyway maybe not worth struggling with script if direct injection doesn't work. Can't tell if it has already been tested successfully on H (from reports above :D)
But if you hear audio cut it's definitely "doing something"... Maybe try to inject twice (because of FORCEPCM "cant' guess" flag). Also log you've attached doesn't show you used that flag.
You're right re FORCEPCM :D . The TV had been rebooted since I tried it so I just did a quick run without options in order to generate a log! Don't think new logs will help but they're attached anyway

I tried to inject twice but unfortunately it's the same i.e. audio cuts for a second but does not change

Figured out why the CMD script doesn't work. The SODIR directory is wrong, should be "/libso" and not "/so" ;). Not that it matters anyway!

I guess I'll have to go the route of a key macro so but appreciate you engaging with me on this!
You do not have the required permissions to view the files attached to this post.

zoelechat
SamyGO Moderator
Posts: 8509
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libSpdifMode D/E/F/H

Post by zoelechat »

Does it work switching PCM<>AC3, on TV channel or movie having AC3 track, not using DTS arg of libHDMIpassthru nor FORCEPCM of libSpdifMode? (=primary intended usage)
I do NOT receive any PM. Please use forum.

deanicus
Posts: 5
Joined: Wed Aug 18, 2021 11:12 pm

Re: [App] libSpdifMode D/E/F/H

Post by deanicus »

zoelechat wrote:
Wed Sep 15, 2021 9:41 am
Does it work switching PCM<>AC3, on TV channel or movie having AC3 track, not using DTS arg of libHDMIpassthru nor FORCEPCM of libSpdifMode? (=primary intended usage)
Yeah if there is a DD source available, it will switch between DD and PCM! In fact, it will work in this case even if DTS argument is passed in libHDMIpassthru

Only when no DD is available, does it not work.

I think that with libHDMIpassthru and DTS argument, when I select DTS it is probably just DTS Neo as I hear no difference from my soundbar if I switch between. So while it is not "real" DTS, I still like to use it as it sounds better than PCM.

libHDMIpassthru with no DTS argument still gives DTS Neo as an option in the menu but the lib will not switch to this from PCM

zoelechat
SamyGO Moderator
Posts: 8509
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libSpdifMode D/E/F/H

Post by zoelechat »

Then problem is not H, it's H AND DTS. Yet another result of "experimental" feature I guess.
You still can convert your movies audio to DD ;)
I do NOT receive any PM. Please use forum.

Post Reply

Return to “[F] Software”