linux-sunxi / libvdpau-sunxi

Experimental VDPAU for Allwinner sunxi SoCs (obsolete, see https://linux-sunxi.org/Sunxi-Cedrus)
https://linux-sunxi.org/Cedrus
166 stars 80 forks source link

With Dual display support no video on secondary display. #32

Open punith444 opened 10 years ago

punith444 commented 10 years ago

i ported mpv with cedarx in my A20 ubuntu board , so now i am able to play videos smoothly. but with dual display support i am not getting video output on second display (its full black screen).

[disp_init] disp_init_enable = 1 disp_mode = 4 screen0_output_type = 3 screen0_output_mode = 4 screen1_output_type = 2 screen1_output_mode = 11 fb0_framebuffer_num = 2 fb0_format = 10 fb0_pixel_sequence = 0 fb0_scaler_mode_enable = 0 fb0_width = 0 fb0_height = 0 fb1_framebuffer_num = 2 fb1_format = 10 fb1_pixel_sequence = 0 fb1_scaler_mode_enable = 0 fb1_width = 0 fb1_height = 0 lcd0_backlight = 197 lcd1_backlight = 197 lcd0_bright = 50 lcd0_contrast = 50 lcd0_saturation = 57 lcd0_hue = 50 lcd1_bright = 50 lcd1_contrast = 50 lcd1_saturation = 57 lcd1_hue = 50

Regards Punith

Moorviper commented 10 years ago

https://github.com/mittorn/libvdpau-sunxi/commit/319bd475f30196480ff83afb0dbe841e7978c672

this is not implemented at master branch so only one display is supported

punith444 commented 10 years ago

Hi Mittron, Thanks for your reply. I want two display same frame buffer , so i can play one video in both display smoothly. Is it possible with your branch or can you tell how can i do it. Regards Punith

punith444 commented 10 years ago

Hi Mittrron, some improvements. with export VDPAU_SCREEN=0 i am getting video in HDMI. with export VDPAU_SCREEN=1 i am getting video in TV. But i want on both. can you tell me what need to change in code.

Regards Punith

Regards Punith

mittorn commented 10 years ago

No, it's only possible to use one display now. But you can create layer on both displays, look at https://github.com/linux-sunxi/libvdpau-sunxi/blob/master/presentation_queue.c#L264 Screen number is set in first arg at https://github.com/linux-sunxi/libvdpau-sunxi/blob/master/presentation_queue.c#L322 and other disp ioctls. Note that scaler layer count is limited and if you are using scaler on hdmi (it is needed to prevent image jumping on high resolutions), this will not work.

punith444 commented 10 years ago

i dont any need any scaler to enabled , could this possible by changing the code,

mittorn commented 10 years ago

You need two scaler layers to convert colorspace in video. And in almost all cases you neen scaler in dualscreen configuration. You can use a10disp to check configuration.

mittorn commented 10 years ago

You also can do it without any code change by wrapping ioctl. Look preload code in cedarxplayertest-gui. I wrapped some functions in CedarXPlayerTest and rescaled image and moved it to another screen.

punith444 commented 10 years ago

hi mittorn, if you see my script i disabled bot fb0 and fb1 scaler enable. can you tell me what changes need to do to get video on both display.

punith444 commented 10 years ago

Hi Mittron, i look at source code and did some changes but not yet worked for me. can you kindly tell what needs to do to get video on both display. Regards Punith

mittorn commented 10 years ago

http://codepad.org/giQv9CXj presentation_queue.c You also need to add layer2 to vdpau_private.h It is dirty and break OSD implementation, but work for me.

punith444 commented 10 years ago

Hi Mittorn, i tested with your new code presentation_queue.c and added layer2 to vdpau_private.h. but i am not getting video in second display(TV). getting fallowing errors while playing video.

without osd enabled.

<4>[DISP] request scaler layer fail! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] layer released: 0,101 <4>[DISP] layer released: 1,101 With osd enabled <4>[DISP] layer 2 in screen 0 not inited! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] layer 2 in screen 0 not inited! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] layer 2 in screen 0 not inited! <4>[DISP] request scaler fail <4>[DISP] request scaler layer fail! <4>[DISP] layer 2 in screen 0 not inited! <4>[DISP] layer released: 0,101 <4>[DISP] layer released: 1,101 <4>[DISP] layer released: 1,102
mittorn commented 10 years ago

Try to reboot and manually disable scaller on both displays with a10disp. You also should disable hardware cursor, if present. OSD must be disabled because it is broken with my changes and it uses another layer.

mittorn commented 10 years ago

After few crashes layers was not released because of disp bug, it is only way to reboot to release them.

Moorviper commented 10 years ago

which player do you use on newer kernel the memory for the cedarx ist hardcoded to 80 MB if you use vdr-softhd-device you have to increase it to min. 120MB better 140MB

192 MB is afik the highest amount which could be assigned save.

punith444 commented 10 years ago

hi Mittorn, i am using mpv player and kernel is linux-sunxi 3.4 and how to increase cedarx memory?. and how to disable scaler on both display using a10disp because i am using A20 board. i fallowed the procedure from below link, http://linux-sunxi.org/Cedrus

punith444 commented 10 years ago

thank you mittorn, finally its working on both display once i disable scaler by using a10 disp. but hdmi display ok but in tv display video is not scaled. Is it any way to get video on both display properly (with alittle portion is missing fine).

Moorviper commented 10 years ago

by the way

bildschirmfoto 2014-10-15 um 12 48 24 != bildschirmfoto 2014-10-15 um 12 48 19

this was a link ;-)

bildschirmfoto 2014-10-15 um 12 48 34

mittorn commented 10 years ago

You can recalculate video size in presentation_queue. Or you can simply use only one output. Are you sure that you really need video on both displays at the same time? scalers count is hardcoded in disp code and i think that it's a hardware limit.

mittorn commented 10 years ago

Also you can control layers by a10disp by specifing layer_handle. It is 102 when hardware cursor enabled and 101 when disabled. for example, a10disp --screen 1 --layer-handle 102 enablescaler 0 w100h100 will rescale the video to 100x100, but it wil be reset on window move or other para changes.

punith444 commented 10 years ago

Yes i want on both display , is it possible by changing layerinfo(2 times paasing) for screen0 and screen1. or is it possible with a10disp command. i want video to play on both display without any missing of portion(alittle is ok). Screen 0: Display dimensions are 1280 x 720. Output type is HDMI. Screen 1: Display dimensions are 720 x 576. Output type is TV.

punith444 commented 10 years ago

i dont have --layer-handle option in a10disp command.

mittorn commented 10 years ago

Try use https://github.com/mittorn/a10disp/ , testing branch. It has many new options. https://github.com/mittorn/a10disp/blob/testing/README

punith444 commented 10 years ago

hi mittorn, i tried a10disp --screen 1 disablescaler a10disp --screen 1 --layer-handle 102 enablescaler 0 w100h100 but not get any improvements. how about changing in layer info in presentation_queue.c file?. Regards Punith

mittorn commented 10 years ago

Second command will only work when video is showing.

punith444 commented 10 years ago

Hi MIttron, In my android4.2 i have two display 1.screen 0 is TV 2.screen 1 is HDMI. i am getting mirror image on both display but HDMI is not full screen. so i changed fb0_width to 1280 and fb0_height to 720 then hdmi is full screen but lot of portion is missing in tv display. in my case both display tyes are normal. Is it possible to scale the width and height of tv display without enabling scaler?. can you tell how can i get full screen on both display?.

Regards Punith

mittorn commented 9 years ago

I don't know how it works on android

G332657060 commented 6 years ago

hi punith444

Can you tell me how you add the layer2 layer? I just need to modify this thing in my hands