Learning about Dolby Vision and CoreELEC development

Yes fire cube 2nd gen on CE

Play a video in tv-led mode on that. Then post the outputs of

cat /sys/kernel/debug/amhdmitx/hdmi_pkt


cat /sys/devices/virtual/amhdmitx/amhdmitx0/config

while it is running.

While your at it also cat /sys/devices/virtual/amhdmitx/amhdmitx0/dv_cap just to check the supported modes.

Hi keep getting permission denied, any ideas? Thanks

No idea, those are standard commands that just print info. For all of them? Restart?

Yes i tried that , will look into it, @Vasco any ideas? Thanks.


 cat /sys/class/amhdmitx/amhdmitx0/rawedid

If the problem is what I suspect, the other commands are preferable for fixing it, but this should at least check my suspicion.

This the outcome.


Ok. So that at least nails down the source of the issue. I’ve hardcoded sending a packet that assumes newer version of Dolby support, but your TV only supports an older version.

I made a typo :rofl:(dropped the last letter) in the previous command that would have caused your permission problem, post the output of

cat /sys/kernel/debug/amhdmitx/hdmi_pkt

when tv-led DV is working and I’ll add an option to send the packet that suits the older version that you have.

1 Like

Whoa massive data:

---HDMITX packets--------
--------parsing ACR--------
ACR.enable: enable
[0x10003206]: 0x4
ifsfactor: 64xFs
N: 4459
ncts_atomic_write: 1
CTS: 234428
CTS_manual: 0
N_shift: 1
actual N = audN[19:0]/N_shift
--------parsing AudSample--------
AudSample.enable: enable
[0x10003100]: 0x21
i2s_select: I2S
I2S_in_en: 0x1
[0x10003101]: 0x18
I2S_width: 24 bit
I2S_mode: standard
[0x10003103]: 0x0
HBR mode enable: 0
NLPCM mode enable: 0
[0x10003301]: 0x18
SPDIF_width: 24 bit
[0x10001063]: 0x0
layout: 0
sample flat: 0
[0x10001064]: 0x1
sample present: 1
[0x10001065]: 0x0
audio sample validity flag
channel 0/1/2/3, Left: 0/0/0/0
channel 0/1/2/3, Right: 0/0/0/0
[0x10001066]: 0x0
audio sample user flag
channel 0/1/2/3, Left: 0/0/0/0
channel 0/1/2/3, Right: 0/0/0/0
--------parsing GCP--------
GCP.enable: enable
[0x10001018]: 0x0
clear_avmute: 0
set_avmute: 0
default_phase: 0
[0x10000800]: 0x0
packing_phase: 0
[0x10000801]: 0x0
color_depth: 24bit
[0x10000803]: 0x0
YCC 422 size: 16bit
[0x10000804]: 0x46
output selector: 8bit bypass
bypass select: 1
YCC 422 enable: 0
pixel repeater enable: 0
pixel packing enable: 0
bypass enable: 1
[0x100010b7]: 0x7
datauto mode: auto
--------parsing VSIF--------
VSIF.enable: disable
[0x10001029]: 0x3
[0x1000102a]: 0x18
[0x1000102b]: 0x0
[0x1000102c]: 0x0
[0x1000102d]: 0x0
[0x1000102e]: 0x0
[0x1000102f]: 0x0
[0x10001030]: 0xc
[0x10001031]: 0x0
[0x10001032]: 0x20
[0x10001033]: 0x3
[0x10001034]: 0x0
[0x10001035]: 0x0
[0x10001036]: 0x0
[0x10001037]: 0x0
[0x10001038]: 0x0
[0x10001039]: 0x0
[0x1000103a]: 0x0
[0x1000103b]: 0x0
[0x1000103c]: 0x0
[0x1000103d]: 0x0
[0x1000103e]: 0x0
[0x1000103f]: 0x0
[0x10001040]: 0x0
[0x10001041]: 0x0
[0x10001042]: 0x0
[0x10001043]: 0x0
[0x10001044]: 0x0
[0x10001045]: 0x0
[0x10001046]: 0x0
[0x10001047]: 0x0
[0x10001048]: 0x0
[0x10001049]: 0x0
size: 24
ieee_id: 0xc03
HDMI 4K hdmitx_parsing_vsifpkt[1303]
vic: 0x3
--------parsing AVIInfo--------
AVIInfo.enable: enable
[0x10001019]: 0x40
colorspace: RGB
active_format_present: enable
bar: disable
scan: disable
[0x1000101a]: 0xe8
colorimetry: Extended
picture_aspect: 16:9
active_aspect: Same as picture_aspect
[0x1000101b]: 0x68
itc: disable
extended_colorimetriy: BT.2020
quantization_range: full
nups: unknown
[0x1000101c]: 0x0
vic: 0
[0x10001017]: 0x0
ycc_quantization_range: limited
content_type: graphics
[0x100010e0]: 0x10
pixel_repetition: no
[0x100010b7]: 0x7
datauto: RDRB
[0x100010be]: 0x0
rdrb_interpolation: 0
[0x100010bf]: 0x1a
rdrb_perframe: 1
rdrb_linespace: 10
--------parsing SPDInfo--------
SPDInfo.enable: enable
[0x1000104a]: 0x41
[0x1000104b]: 0x6d
[0x1000104c]: 0x6c
[0x1000104d]: 0x6f
[0x1000104e]: 0x67
[0x1000104f]: 0x69
[0x10001050]: 0x63
[0x10001051]: 0x0
[0x10001052]: 0x4d
[0x10001053]: 0x42
[0x10001054]: 0x6f
[0x10001055]: 0x78
[0x10001056]: 0x20
[0x10001057]: 0x4d
[0x10001058]: 0x65
[0x10001059]: 0x73
[0x1000105a]: 0x6f
[0x1000105b]: 0x6e
[0x1000105c]: 0x20
[0x1000105d]: 0x52
[0x1000105e]: 0x65
[0x1000105f]: 0x66
[0x10001060]: 0x0
[0x10001061]: 0x0
[0x10001062]: 0x1
vendor name: Amlogic
product description: MBox Meson Ref
--------parsing AudioInfo--------
AudioInfo.enable: enable
[0x10001025]: 0x10
coding_type: refer to stream header
channel_count: 2 channels
[0x10001026]: 0x0
sample_frequency: refer to stream header
sample_size: refer to stream header
[0x10001027]: 0x0
channel_allocation: 0
[0x10001028]: 0x0
level_shift_value: 0
down_mix_enable: 0
LFE_playback_info: 0
[0x100010b7]: 0x7
datauto: auto
--------parsing AudChannelSt--------
[0x10001067]: 0x0
iec_copyright: 0
iec_cgmsa: 0
[0x10001068]: 0x0
iec_categorycode: 0
[0x10001069]: 0x0
iec_sourcenumber: 0
iec_pcmaudiomode: 0
[0x1000106a]: 0x42
iec_channelnumcr0: 2
iec_channelnumcr1: 4
iec_channelnumcr2: 6
iec_channelnumcr3: 8
[0x1000106c]: 0x31
iec_channelnumcl0: 1
iec_channelnumcl1: 3
[0x1000106d]: 0x75
iec_channelnumcl2: 5
iec_channelnumcl3: 7
[0x1000106e]: 0x0
iec_sampfreq: 44.1kHz
iec_clk: 0
iec_sampfreq_ext: 0
[0x1000106f]: 0xfb
iec_worldlength: 24bit
iec_origsamplefreq: 44.1kHz
--------parsing DRM/HDR--------
hdr_transfer_feature: 0x1
hdmi_current_hdr_mode: 0x0
hdmi_last_hdr_mode: 0x0
DRM.enable: disable
[0x10001168]: 0x0
version: 0
[0x10001169]: 0x0
size: 0
[0x1000116a]: 0x0
eotf: sdr
[0x1000116b]: 0x0
metadata_id: static metadata
0, 0,
0, 0,
0, 0,
white_point: 0, 0,
luminance: 0, 0,
max_content: 0
max_frame_average: 0
1 Like

@xmlcom Try this build 248.12 MB file on MEGA

You will need to need to make sure the display mode matches that the data you posted, so 2160p 24Hz. So the 60Hz video you tried earlier won’t work.

After it boots, enter

 echo 0 > /sys/module/amvideo/parameters/toggle_metadata_count_limit

Then try instructions from Learning about Dolby Vision and CoreELEC development - #220 by doppingkoala.

Let me know if your tv goes into DV mode using the rise of gru sample I posted, if it doesn’t post outputs of each of

cat /sys/kernel/debug/amhdmitx/hdmi_pkt
cat /sys/devices/virtual/amhdmitx/amhdmitx0/config
cat /sys/devices/virtual/amhdmitx/amhdmitx0/dv_cap

and a dmesg log.

If that sample video works, but the second lot of commands that embed data on the fly don’t, I will explain some trial-and-error testing you will need to do that should get it going.

Either way, let me know the results of both the approaches.

1 Like

You are a genius, yes the gru sample works, for 2nd on any video, DV is activated but black screen with audio only, Thanks again ,i don’t how you achieve this but is insane to think this is possible.

1 Like

Great. Making progress.

Interesting differences in TV’s, when I have a problem with osd injection approach I get a picture but to DV mode.

So in the second approach, data is being injected into the osd layer, but before it goes through a color space conversion. I guessing this is slightly different (i.e., not bit identical) on your S922X-H chip compared to my S905X3 rev B. So we will need to find values for you to embed, such that, the values after the color space conversion are what is needed.

This problem is really why using the second gui layer over the top of the first, but without a color space conversion would be better. It would avoid this problem, but I haven’t worked out how to do it (yet).

Anyway, onto to the trial and error search to find numbers that work for you. Different values to embed can be controlled with /sys/module/amvideo/parameters/random_data_count. Can read with

cat /sys/module/amvideo/parameters/random_data_count

and write with, for example a value of 0, by

echo 0 > /sys/module/amvideo/parameters/random_data_count

valid values to use are are 0-255.

You will need to get to the stage for the 2nd approach you were at before and then test values until tv-led DV it starts working properly with a picture.

To make this process easier, enter

echo 0 > /sys/module/amvideo/parameters/random_data_count
echo 125 > /sys/module/amvideo/parameters/toggle_metadata_count_limit

and the value will increment from 0 automatically every ~5 seconds. Sit and watch you TV until DV mode works, you can check progress by reading random_data_count (command as above, at any time). As soon as a picture shows up with DV mode, do

cat /sys/module/amvideo/parameters/random_data_count

and a value will print out. By the time you do this, the value will probably have already changed (and the DV stopped working on your tv). So disable the auto increment with

echo 0 > /sys/module/amvideo/parameters/toggle_metadata_count_limit

From there, just manually work backwards from the value that was printed until tv-led DV starts working again using the commands to read/write to random_data_count at the top of the post, i.e., if 50 was printed try 50, 49,48, … So commands would be

echo 50 > /sys/module/amvideo/parameters/random_data_count

and so on.

Good luck.

This process may take some time, when I was playing around to get 10-bit mode working as well I got no results until about 60, so it may take you a while …

If you do find a value that works be sure to post it to save others with the same device the effort.

And thanks for all your testing

1 Like

Hi, sorry to interrupt, I also have a C6 with am6b+, trouble with dv aswell.
Using latest nightly.

With that device DV is fully supported, this whole thread isn’t relevant for you.

Hi thanks, doing it now.
Just to clarify:

  1. Start a long video
    2.Enter Cmd from previous post to get DV but not picture.
    3.Use 0-125 Echo Cmd to wtite
    4.As soon as picture shows, read random count Cmd to get number.
    5.Disable write Cmd
    6.Work backwards echo write cmd to get exact number.

Please confirm if above steps is ok.

Edit1: played a long video-once upon a time in Hollywood hdr movie- it cycle from 0 to 125 and started again but no picture just blank with DV activated.

Hopefully, I find a better approach later, but for now…

Yes. those are the steps.

1 Like

Thanks, update above .


The value from cat /sys/module/amvideo/parameters/random_data_count should cycle from 0 to 255.

You could try again by changing from 12-bit to 10-bit. Different numbers worked for me with different bit depths

1 Like

Maybe a different way of embedding the metadata is needed that isn’t so error prone.

That said, the default rgb values of (255,255,255) and (0,0,0) worked for me. But only in 12-bit mode, I needed to do that trial and error to get 10-bit mode working …

I see i thought echo 0 - 125 limit should be 0 - 255 limit?

echo 0 > /sys/module/amvideo/parameters/random_data_count
echo 125 > /sys/module/amvideo/parameters/toggle_metadata_count_limit