Skip to content
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

Interlaced modes don't work #25

Closed
warped-rudi opened this issue Oct 20, 2015 · 17 comments
Closed

Interlaced modes don't work #25

warped-rudi opened this issue Oct 20, 2015 · 17 comments

Comments

@warped-rudi
Copy link

Any of the interlaced modes enabled via 7b45e80 (here S:1440x576i-50, S:1440x480i-60, S:1440x576i-50, S:1920x1080i-60 and S:1920x1080i-50) makes my TV screen go blank/blue which indicates a bad input signal.

@linux4kix
Copy link

Yes, this patch was accepted and merged into the upstream yocto kernel repo. We are working to sort out the validity of this patch and either drop or fix it.

@mk01
Copy link

mk01 commented Dec 18, 2015

@warped-rudi

regarding this and http://forum.solid-run.com/cubox-i-hardware-lab-f16/power-but-no-picture-t2798.html#p19769, have you retested with the patches (FSL) added later ?

there is one limitation though, interlaced modes do work ONLY with the timings specified in ./mxc_edid.c (so any DMT modes parsed from EDID do not work - never found why).

@warped-rudi
Copy link
Author

I only use code from this repository. Just re-tested and no change. No idea if other patches exist and where to find them. About mxc_edid.c: Do you have any idea why left_margin/right_margin and upper_margin/lower_margin are swapped when comparing progressive and interlaced modes of the same resolution?

@mk01
Copy link

mk01 commented Dec 22, 2015

@warped-rudi
no, there are no more patches (afaik).

(I assume) swapped values (and this is also why DMT-i modes do not work) is because IPU registers have different meaning for progressive/interlaced signal - and this would be stu*id but fast way.
this would mean wrong videoinfo frames with swapped margins. could be your monitor/tv has issue with it.
I have some other theories - for instance fbdev having support functions not considering vmode (or storing/restoring structures where vmode is lost) or where refresh(Hz) is back calculated from pixclock. the latter case would make for example modes 1920x1080p30 and 1920x1080i60 indistinguishable.

I don't know if wrong infoframe can lead to completely not working mode on output, but try it with swapped margins for interlaced modes - http://sprunge.us/iFba . for me it still works.

@warped-rudi
Copy link
Author

I tried quite a lot of things, including your patch. But no avail. When using a PC monitor (Philips 239C4QHSB) instead of the TV, I get some garbled content that shows up for a few seconds, then blanks and comes back again repeatedly. Could it be it's working on DVI only? I'm using HDMI here...

@mk01
Copy link

mk01 commented Dec 29, 2015

@warped-rudi
and you also have ac17eb1 and b6eaaf2 , do you ?

the Interlaced support is independent of DVI/HDMI, only difference is that in DVI mode it can add modes / timings different from those in mxc_edid::mxc_cea_mode[] .

@warped-rudi
Copy link
Author

@mk01
Yes, I'm using c3cae44 (Nov 7 commit). But with a different kernel config...

@mk01
Copy link

mk01 commented Dec 29, 2015

@warped-rudi
wanted to check with your build, but the geekbox pkg has no interlaced allowed.

@warped-rudi
Copy link
Author

Find both - a plain zImage as well as a full kernel package - here. They are of the same version level as the 201512145 snapshot, but allow to select interlaced modes. Normally it should be sufficient to replace zImage...

@warped-rudi
Copy link
Author

Looks like I've found the problem. See #32.
BTW, I've started a bigger overhaul of the mode settings stuff here. Currently modes that require double clocking (i.e. 720x480i, 720x576i, 720x240p and 720x288p) do not work and some others (1440x480p) show a few lines from the bottom on the top. But otherwise it seems O.K. Fractional support uses the (n-1) approach. I.e. S:1920x1080p-59 refers to 59.96Hz while S:1920x1080p-60 - as expected - to 60Hz. Note that this is WIP...

@mk01
Copy link

mk01 commented Dec 30, 2015

@warped-rudi

worked as expected on both TVs (original image you sent).

1440x576i-50
1440x480i-60
1920x1080i-50
1920x1080i-60

only those are supported (reported in EDID)

@mk01
Copy link

mk01 commented Dec 30, 2015

@warped-rudi

regarding fractional modes - the kernel internally supports them already as is. this was assured by previous commits. only thing missing was/is the 'interface' to user space to trigger them - which is here 9b71359

(there is /sys/class/graphics/fb0/ntsc_mode created, if set to 1, configured modes will have ntsc timing, 0 pal)

@warped-rudi
Copy link
Author

@mk01

worked as expected on both TVs (original image you sent)

Obviously some TVs are more forgiving than others. Without #32 I get no picture at all.

only thing missing was/is the 'interface' to user space to trigger them
...
/sys/class/graphics/fb0/ntsc_mode created

Hmm, while this approach requires less messing with the Freescale code, I'm a bit reluctant when it comes to introducing a new userspace APIs and changing common kernel modules. BTW, did you notice that some of the entries in mxc_cea_mode[] already describe the NTSC timings while others do not?

@linux4kix
Copy link

Rudi, the fbdev subsystem is dead. We need to figure out what works until
we switch to kms.

On Wed, Dec 30, 2015, 7:46 PM Rudi Ihle notifications@github.com wrote:

@mk01 https://github.com/mk01

worked as expected on both TVs (original image you sent)

Obviously some TVs are more forgiving than others. Without #32
#32 I get no picture at all.

only thing missing was/is the 'interface' to user space to trigger them

...
/sys/class/graphics/fb0/ntsc_mode created

Hmm, while this approach requires less messing with the Freescale code,
I'm a bit reluctant when it comes to introducing a new userspace APIs and
changing common kernel modules. BTW, did you notice that some of the
entries in mxc_cea_mode[] already describe the NTSC timings while others do
not?


Reply to this email directly or view it on GitHub
#25 (comment).

@mk01
Copy link

mk01 commented Dec 31, 2015

@warped-rudi

#32 improved displaying text.

ad the timings - yes, I have seen your commits. Mine TVs do not list those modes as supported so I never realised the timings are wrong. But they all work (as I tested now).
The changes on PS clk are OK, but 1440x240. You changed the clock to "correct" 27000kHz, but with this mode and clk the timing is 59.940. 60 is with 37070ps.

ad fract - initially I had implemented similar as you did. Only I didn't use '59', but lowercase letter -

s:1920x1080p-24 - was 23.967 

don't have the backport to 3.14 anymore but it can be seen here before this commit xbianonpi/xbian-sources-kernel@14a3f90 .

it's breakage of vanilla code was just single line added to fbsys.c.
btw: in Kodi I kept support of both xbianonpi/xbian-sources-xbmc@a8ca74e

For more reasons I liked the cloning of modes (as fract) more, as without touching fbdev at all everything was transparent trough fbdev chain. @jnettlet's wish was a PAL/NTSC switch (as per KMS way).

@warped-rudi
Copy link
Author

@mk01
According to the CEA table 1440x240p (vic 8 and 9) should use 27027kHz for 60Hz and 27000kHz for 59.94Hz. That's what I do. Interestingly, both 22 or 23 vertical blanking lines are allowed (we use 22) and there is always a deviation from the ideal refresh rate. The same applies to 2880x240p (vic 12 and 13), which we do not implement. However, at the moment none of the x240p, x288p, x480i and x576i modes work. They require double clocking which is not set up. I'm unsure how much effort to spend on that. Looks like it needs more work than just specifying the proper output repeat rate to the packetizer. If it gets too complicated, I would tend to disable these modes...

ad fract - initially I had implemented similar as you did. Only I didn't use '59', but lowercase letter -

Hmm, not much different, indeed. The only thing that could happen is that some really stupid program might get crazy about the unexpected letter.

@tomlohave
Copy link

Pull request #32 fixes my problem

mk01 pushed a commit to mk01/linux-fslc that referenced this issue Mar 2, 2016
commit f5cdedd upstream.

We can handle the special case of num_stripes == 0 directly inside
btrfs_read_sys_array. The BUG_ON in btrfs_chunk_item_size is there to
catch other unhandled cases where we fail to validate external data.

A crafted or corrupted image crashes at mount time:

BTRFS: device fsid 9006933e-2a9a-44f0-917f-514252aeec2c devid 1 transid 7 /dev/loop0
BTRFS info (device loop0): disk space caching is enabled
BUG: failure at fs/btrfs/ctree.h:337/btrfs_chunk_item_size()!
Kernel panic - not syncing: BUG!
CPU: 0 PID: 313 Comm: mount Not tainted 4.2.5-00657-ge047887-dirty SolidRun#25
Stack:
 637af890 60062489 602aeb2e 604192ba
 60387961 00000011 637af8a0 6038a835
 637af9c0 6038776b 634ef32b 00000000
Call Trace:
 [<6001c86d>] show_stack+0xfe/0x15b
 [<6038a835>] dump_stack+0x2a/0x2c
 [<6038776b>] panic+0x13e/0x2b3
 [<6020f099>] btrfs_read_sys_array+0x25d/0x2ff
 [<601cfbbe>] open_ctree+0x192d/0x27af
 [<6019c2c1>] btrfs_mount+0x8f5/0xb9a
 [<600bc9a7>] mount_fs+0x11/0xf3
 [<600d5167>] vfs_kern_mount+0x75/0x11a
 [<6019bcb0>] btrfs_mount+0x2e4/0xb9a
 [<600bc9a7>] mount_fs+0x11/0xf3
 [<600d5167>] vfs_kern_mount+0x75/0x11a
 [<600d710b>] do_mount+0xa35/0xbc9
 [<600d7557>] SyS_mount+0x95/0xc8
 [<6001e884>] handle_syscall+0x6b/0x8e

Reported-by: Jiri Slaby <jslaby@suse.com>
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@jnettlet jnettlet closed this as completed Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants