hans_ar
Posts: 5
Joined: Wed Jul 17, 2019 8:24 am

RPi 4 - Dual screen in CLI

Wed Jul 17, 2019 1:03 pm

Hello,

I have read threads about dual screen on RPi4 but i couldnt find info about how to extend screen in CLI. I tried to configure in GUI and then boot into CLI, but i got only mirror.

Can anyone tell me location of config file? Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 4 - Dual screen in CLI

Wed Jul 17, 2019 1:36 pm

I don't believe Linux allows you to stretch the console framebuffer across two screens. I've never seen it on any install I've ever done. I'm not sure what the gain would be in stretching the screen when at the console.

You can control the two displays independently via libdrm when in the console.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
clicky
Posts: 415
Joined: Thu Oct 25, 2012 7:34 am

Re: RPi 4 - Dual screen in CLI

Wed Jul 17, 2019 1:48 pm

I bet it is possible to have separate consoles on different framebuffers. Last time I was playing with it was for adding additional screens on SPI interface, and assign console to it. I can't remember what I've done then - later I just switched to fbcp and had main (GPU supported) framebuffer just copied to second framebuffer (and run LibGDX without X windows). But, at one point I did set up extra console, somehow, on fb1...

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 4 - Dual screen in CLI

Wed Jul 17, 2019 1:56 pm

clicky wrote:
Wed Jul 17, 2019 1:48 pm
I bet it is possible to have separate consoles on different framebuffers. Last time I was playing with it was for adding additional screens on SPI interface, and assign console to it. I can't remember what I've done then - later I just switched to fbcp and had main (GPU supported) framebuffer just copied to second framebuffer (and run LibGDX without X windows). But, at one point I did set up extra console, somehow, on fb1...
DRM/KMS only exposes one framebuffer though.
X renders direct through DRM (not the framebuffer) therefore it can do what it wants with regard sending images to each display. The console renders to the framebuffer, and that is then rendered through DRM's frame buffer emulation.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

hans_ar
Posts: 5
Joined: Wed Jul 17, 2019 8:24 am

Re: RPi 4 - Dual screen in CLI

Wed Jul 17, 2019 2:11 pm

6by9 wrote:
Wed Jul 17, 2019 1:36 pm
I don't believe Linux allows you to stretch the console framebuffer across two screens. I've never seen it on any install I've ever done. I'm not sure what the gain would be in stretching the screen when at the console.

You can control the two displays independently via libdrm when in the console.
I need to play one video on two screens with omxplayer, but without GUI. Right now im using PiWall, so for 2 screens i use 3 Rpi's .

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 4 - Dual screen in CLI

Wed Jul 17, 2019 2:37 pm

hans_ar wrote:
Wed Jul 17, 2019 2:11 pm
I need to play one video on two screens with omxplayer, but without GUI. Right now im using PiWall, so for 2 screens i use 3 Rpi's .
The same video on both screens, or different videos?

omxplayer won't allow you to replicate the video on both screens directly, but the underlying components will. At the moment it'll have a video_decode component feeding video_scheduler, and then video_render. Insert a video_splitter after video_scheduler, and create a 2nd video_render for the second screen. If kept with IL (or MMAL) then there are no actual image copies involved at all.

You should be able to achieve the same thing with GStreamer and kmssink. kmssink has a connector-id property which allows configuration of which display is to be rendered to via DRM. Getting those magic numbers really needs to use modetest. They're dynamic numbers, so you either need to enumerate them, or have some mechanism to look them up.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

hans_ar
Posts: 5
Joined: Wed Jul 17, 2019 8:24 am

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 6:17 am

6by9 wrote:
Wed Jul 17, 2019 2:37 pm
hans_ar wrote:
Wed Jul 17, 2019 2:11 pm
I need to play one video on two screens with omxplayer, but without GUI. Right now im using PiWall, so for 2 screens i use 3 Rpi's .
The same video on both screens, or different videos?

omxplayer won't allow you to replicate the video on both screens directly, but the underlying components will. At the moment it'll have a video_decode component feeding video_scheduler, and then video_render. Insert a video_splitter after video_scheduler, and create a 2nd video_render for the second screen. If kept with IL (or MMAL) then there are no actual image copies involved at all.

You should be able to achieve the same thing with GStreamer and kmssink. kmssink has a connector-id property which allows configuration of which display is to be rendered to via DRM. Getting those magic numbers really needs to use modetest. They're dynamic numbers, so you either need to enumerate them, or have some mechanism to look them up.
Thanks for your answer.

I want to play video for example, resolution 3840x1080 on two screens (extended), but in CLI.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24116
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 8:55 am

hans_ar wrote:
Thu Jul 18, 2019 6:17 am
6by9 wrote:
Wed Jul 17, 2019 2:37 pm
hans_ar wrote:
Wed Jul 17, 2019 2:11 pm
I need to play one video on two screens with omxplayer, but without GUI. Right now im using PiWall, so for 2 screens i use 3 Rpi's .
The same video on both screens, or different videos?

omxplayer won't allow you to replicate the video on both screens directly, but the underlying components will. At the moment it'll have a video_decode component feeding video_scheduler, and then video_render. Insert a video_splitter after video_scheduler, and create a 2nd video_render for the second screen. If kept with IL (or MMAL) then there are no actual image copies involved at all.

You should be able to achieve the same thing with GStreamer and kmssink. kmssink has a connector-id property which allows configuration of which display is to be rendered to via DRM. Getting those magic numbers really needs to use modetest. They're dynamic numbers, so you either need to enumerate them, or have some mechanism to look them up.
Thanks for your answer.

I want to play video for example, resolution 3840x1080 on two screens (extended), but in CLI.
The H264 decoder cannot handle that width - are you planning to do normal 1920x1080 and stretch it?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

hans_ar
Posts: 5
Joined: Wed Jul 17, 2019 8:24 am

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 9:13 am

jamesh wrote:
Thu Jul 18, 2019 8:55 am
hans_ar wrote:
Thu Jul 18, 2019 6:17 am
6by9 wrote:
Wed Jul 17, 2019 2:37 pm

The same video on both screens, or different videos?

omxplayer won't allow you to replicate the video on both screens directly, but the underlying components will. At the moment it'll have a video_decode component feeding video_scheduler, and then video_render. Insert a video_splitter after video_scheduler, and create a 2nd video_render for the second screen. If kept with IL (or MMAL) then there are no actual image copies involved at all.

You should be able to achieve the same thing with GStreamer and kmssink. kmssink has a connector-id property which allows configuration of which display is to be rendered to via DRM. Getting those magic numbers really needs to use modetest. They're dynamic numbers, so you either need to enumerate them, or have some mechanism to look them up.
Thanks for your answer.

I want to play video for example, resolution 3840x1080 on two screens (extended), but in CLI.
The H264 decoder cannot handle that width - are you planning to do normal 1920x1080 and stretch it?
Yes, i want to strech it but also i want to play videos with 3840x1080.

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24116
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 9:55 am

hans_ar wrote:
Thu Jul 18, 2019 9:13 am
jamesh wrote:
Thu Jul 18, 2019 8:55 am
hans_ar wrote:
Thu Jul 18, 2019 6:17 am


Thanks for your answer.

I want to play video for example, resolution 3840x1080 on two screens (extended), but in CLI.
The H264 decoder cannot handle that width - are you planning to do normal 1920x1080 and stretch it?
Yes, i want to strech it but also i want to play videos with 3840x1080.

Thanks
Only the HEVC decoder can do that high resolution, not the H264 decoder. At the moment the HEVC is only reliably available in Kodi, although we are working on that.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

hans_ar
Posts: 5
Joined: Wed Jul 17, 2019 8:24 am

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 10:14 am

Thank you for your answer, so in GUI I can run strached video?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24116
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 10:30 am

hans_ar wrote:
Thu Jul 18, 2019 10:14 am
Thank you for your answer, so in GUI I can run strached video?
Not sure. I think so on the Pi4 but you would need to try it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 4 - Dual screen in CLI

Thu Jul 18, 2019 8:12 pm

hans_ar wrote:
Thu Jul 18, 2019 10:14 am
Thank you for your answer, so in GUI I can run strached video?
Do you actually want the gui? Your earlier comments said not.
From the console you can use drm to display the same plane on both displays but with different source cropping rectangles (this I how x renders a stretched gui) .
Hevc decode is still being developed, so hooking it up to drm will currently be slightly suboptimal, and we don't have any demo code for it.
With X running everything has to run through gl to be rendered, therefore the system load is significantly higher.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “General discussion”