flowerdog
Posts: 3
Joined: Wed Jun 08, 2016 8:14 pm

[How To] Auto detect hdmi while having dsi display connected

Wed Jun 08, 2016 9:11 pm

Hi guys,

the search is over. Here you will find an easy guide to autodetect hdmi on boot.

After following this guide you can use displays connected to hdmi, while the dsi display is connected.
If hdmi is connected on boot, it will use hdmi, otherwise it uses the integrated dsi display.

I have been searching the web already a whole day and know how painful and annoying it is.

So I share my solution:
I followed the guide on https://github.com/procount/pinn/blob/m ... ME_PINN.md . Scroll down there and you will find some instructions on autodetect hdmi. They are not so clear, so I write it more clearly down here.

I just tried it with rasbian, I don't know, if it works with other os
You need to use PINN and install rasbian with it, edit some files and then it works

In this instructions F:\ is the sd card

First of all:

1. Download PINN-Lite - https://sourceforge.net/projects/pinn/? ... p_redirect
- PINN is an extended NOOBS, which can detect hdmi on boot

2. Format your sd card with Formatter etc.- https://www.sdcard.org/downloads/formatter_4/

3. Copy the files from the PINN Lite zip file onto the formatted sd card

4. Download rasbian and copy it into the os-folder on the sd card e.g. F:\os\Rasbian

5. Mount sd card into raspberry pi and start installation

6. After Rasbarian starts and graphical user interface starts up, turn it off. Put the sd card back into windows computer.

7. Edit "recovery.cmdline" in F:\, add to the end of the line " dsi" , dont fortget the space-character, and save

8. Go to F:\ and create a config.txt and add the line "ignore_lcd=1" and save
- when starting, the output will be forced onto hdmi with this command. PINN menu will only be visible on hdmi source now
- this is important, so the dsi display does not blink, while using hdmi

9. Mount sd card back into raspberry pi and start into rasbian.

10.Open terminal and go to /boot/

11. Create file "config.dsi" in /boot/ - this config will be loaded, when hdmi is not connected
- dsi display loads automatically and does not need any commands, so the config.dsi can be empty
- you can add later, what usually would go into config.txt to configure your dsi display

12. Create file "config.hdmi" in /boot/ - this config will be loaded, when hdmi is connected
- add line "ignore_lcd=1" to config.hdmi, this forces to ignore the dsi display

13. Make sure all files are saved, reboot raspberry pi and READY ! :D

It's working for me without any problems.
Thanks to ProCount PINN!


I am looking for another solution, to turn off the dsi display backlight, while using hdmi, but this solutions works well.

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Wed Jun 15, 2016 1:14 pm

Hi Flowerdog,

Glad you found a use for my PINN!
Sorry if my instructions were too brief - I will have to improve them.

To turn off the RPI backlight, try viewtopic.php?f=108&t=120296#p838338. I assume it works whether the HDMI is the main screen or not, but I haven't checked. Maybe you know different as you posed the question....
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

SunnySmiles
Posts: 2
Joined: Mon Aug 01, 2016 1:47 am

Re: [How To] Auto detect hdmi while having dsi display conne

Mon Aug 01, 2016 1:59 am

Hi, and thanks for the posting this guide.

I am able to follow up to step 10, where I need to add the config.dsi file to /boot. Each time I try to add the file, I continue to receive "bash: config.dsi: Permission denied".

I've tried checking elsewhere for a solution to get past the permissions (adding sudo, chmod), but I continue to receive the same message (I am also very new with linux and raspberry pi).

To summarize, this is what I write: "pi@raspberrypi:/boot $ cat > config.dsi"
I receive: "bash: config.dsi: Permission denied"

Would you have any idea's on how to solve this?

Thanks!

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Mon Aug 01, 2016 8:03 am

It is better to try

Code: Select all

pi@raspberrypi:/boot $ sudo nano config.dsi
and then enter the configuration text that you need.
cat > config.dsi
will probably just create an empty file. You didn't specify anything to put in config.dsi.
But it won't work even if you type

Code: Select all

sudo cat > config.dsi
because the sudo will only apply to the 'cat' command and not to the config.dsi file.
To do it with sudo you would need to type:

Code: Select all

sudo sh -c "cat xxxx > config.dsi"
where xxxx is whatever file you want to insert into config.dsi.
Or what about

Code: Select all

sudo cp [file] config.dsi
?

You can find some example files for Retropie at https://sourceforge.net/projects/pinn/f ... opie2/dsi/
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

SunnySmiles
Posts: 2
Joined: Mon Aug 01, 2016 1:47 am

Re: [How To] Auto detect hdmi while having dsi display conne

Mon Aug 01, 2016 3:19 pm

Thanks for all your help!

active33
Posts: 6
Joined: Mon Aug 08, 2016 8:30 am

Re: [How To] Auto detect hdmi while having dsi display conne

Mon Aug 08, 2016 9:13 am

Hi Flowerdog / Procount

Firstly, thank you for this excellent workaround. I am making a touch screen based media center for my senior citizen father to simply his music/video requirements. However, I just cannot get it to work! Kindly excuse my novice questions as i'm a newbie to programming. On power up the Pinn-Lite boot interface shows on the HDMI screen but rasbian os reverts to the DSI LCD. After trying a dozen times I begin to doubt if I'm doing things right. A couple of questions on my mind...

1. DSI Keyword: I have simply added the word "dsi" to the recovery.cmdline (preceded by a space) using wordpad. Is this ok?

2. Do the config.dsi & config.hdmi files (apart from adding "ignore_lcd=1") need to contain any more details? I checked the retropie config.dsi & config.hdmi files & they had a lot of lines mentioned?

Really appreciate your suggestions.

Thanks!

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Mon Aug 08, 2016 12:55 pm

1. Yes
2. It depends, but probably yes.

Config.txt is used to configure the Pi for how you need it, so probably you need some settings here for the screen resolution, memory, mpeg licenses etc. It depends what you need for your setup.
The 'dsi' addition to recovery.cmdline tells PINN to try and detect whether a HDMI or DSI screen is fitted, and switch to the appropriate config.txt file to select the appropriate settings to enable that display as the default display. It is essentially inverting the normal priority of how the Pi decides which display to use.

The intent of this 'dsi' switch is to use the dsi touchscreen by default, but if an HDMI screen is attached and detected, then it will switch to using this display when it boots into the selected OS.

So you should start off with a known working config.txt file that you want, then copy this to config.dsi and config.hdmi.
Finally edit config.dsi to add :

Code: Select all

#To use the touchscreen
display_default_lcd=1
amd edit config.hdmi to add:

Code: Select all

hdmi_force_hotplug=1
#disable the touchscreen
display_default_lcd=0
EDIT: If you are not sure what should go in config.txt, start off with the one that is installed in Raspbian by default, or see this page for possible settings.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

active33
Posts: 6
Joined: Mon Aug 08, 2016 8:30 am

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Aug 09, 2016 4:56 am

Procount,

Thank you for the detailed explanation. I now have better clarity on its working. However even after trying all recommended suggestions, I still cannot get it to work. I feel that for some reason pinn-lite isn't able to either detect hdmi & so on or not able to load the relevant config files. If I add "ignore_lcd=1" into boot/ config.txt, I am able to display raspbian on the hdmi output. But that's not really providing any display option.

Any inputs?

Thanks!

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Aug 09, 2016 6:22 am

I've read through your posts a couple of times and I'm not exactly sure which part is not working for you.

Could you please explain exactly what you want to do. Please include what happens at each step including which displays are attached and what you expect it to do (& hence which part is not working). Then I can try & figure out what the problem is.

Also, in a Raspbian shell, please post the output of

Code: Select all

tvservice -n
when your hdmi screen is attached.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

active33
Posts: 6
Joined: Mon Aug 08, 2016 8:30 am

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Aug 09, 2016 7:30 am

Procount,

To my Pi3, I have attached a 7" LCD display via DSI & a Toshiba LCD tv via HDMI. As offered by PINN -Lite, I would like the display to be output to HDMI (when present) or default to DSI when no HDMI device is attached or turned on.

Eventually to be used as a media center, I would like to have either OSMC or OpenElec to be the OS. I have currently installed Rasbian to check out the auto display output feature.

As instructed, I have added to the (Recovery)H:\ folder a config.txt file with the line "ignore_lcd=1". To the recovery.cmdline, I have added the " dsi" keyword. The final text looks like this..

Code: Select all

quiet ramdisk_size=32768 root=/dev/ram0 init=/init vt.cur_default=1 elevator=deadline alt_image_source=http://raw.githubusercontent.com/procount/pinn-os/master/os/os_list_v3.json
 dsi
In Rasbian, I went into the /boot/ folder & added a config.dsi file

Code: Select all

#To use the touchscreen
display_default_lcd=1
& also added a config.hdmi

Code: Select all

hdmi_force_hotplug=1
#disable the touchscreen
display_default_lcd=0
The config.txt in /boot/ is left at default.

On rebooting, the HDMI screen shows the 'rainbow' image & pressing SHIFT shows the PINN v1.9.4 recovery console. On exiting the console, the HDMI screen goes blank & the rasbian desktop loads on the DSI LCD screen.

Output of "tvservice -n" with HDMI screen attached

pi@raspberrypi:~ $ tvservice -n
device_name=TSB-TOSHIBA-TV
pi@raspberrypi:~ $

Hope this helps.

Thanks!

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Aug 09, 2016 7:54 am

Yes, that will help a lot. I will check it out over the next couple of days.

One change to your instructions would be to copy the original config.txt to config.dsi and config.hdmi and then add the extra lines to them.

Pinn will overwrite the original config.txt with one of these files when it boots. So to keep any settings in config.txt you must first copy them into the 2 new files.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

active33
Posts: 6
Joined: Mon Aug 08, 2016 8:30 am

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Aug 09, 2016 8:32 am

Hi,

Tried the suggested changes. Same issues.

Thanks.

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Aug 09, 2016 11:38 pm

Hi Active33,

I just downloaded Raspbian with PINN and set it up for dsi as I described and it worked fine.
It switched automatically between my DSI 7" touchscreen and my HDMiPi.
Your instructions seem the same, so I'm not quite sure where your problem lies yet.
I shall have to study them more to see where any possible differences are.
If I can't find it, I will have to create a debug version for you so we can see where it is going wrong.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

active33
Posts: 6
Joined: Mon Aug 08, 2016 8:30 am

Re: [How To] Auto detect hdmi while having dsi display conne

Thu Aug 11, 2016 3:34 am

Thank you very much for your efforts & trouble taken to help me with a solution.

active33
Posts: 6
Joined: Mon Aug 08, 2016 8:30 am

Re: [How To] Auto detect hdmi while having dsi display conne

Fri Aug 12, 2016 5:36 am

Hi, Procount

Just wanted to let you know, last evening I installed OpenElec via Pinn-Lite to try out my Hifiberry Amp+. Also tried the settings for DSI/HDMI auto detection. Noticed the same behavior as with Raspbian.

Thanks!

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Fri Aug 12, 2016 6:17 am

I have sent you a PM.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Sat Aug 13, 2016 8:01 am

Glad I was able to help you get it working.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Midinotes
Posts: 1
Joined: Sat Oct 22, 2016 10:49 pm

Re: [How To] Auto detect hdmi while having dsi display conne

Sat Oct 22, 2016 10:55 pm

So pleased to have found this thread after days of hunting a solution for OSMC. I am a beginner with the Pi and have just built a OSMC media centre using the Raspberry Pi 3 with the official 7" touchscreen. Like the author I sometimes want to be able to use the HDMI output to the TV but also to use the LCD when the TV is off (for music etc). So far the only way I've found to do this is to manually edit the config.txt file within My OSMC > Raspberry Pi settings and then reboot. Needless to say I'd love the system to give me an option to switch between the outputs, or to auto detect. As far as I can make out this discussion explains how to do this, but being a newb I would appreciate some help on how I can do this with OSMC (step by step if poss!).

Most thankful in anticipation
Simon

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Sun Oct 23, 2016 9:35 pm

I've not tried it with OSMC, but (without checking) I think it should work in the same way. Just try following the above instructions, or check out my PINN documentation.
Sorry, but I'm away and not able to try it myself over the next week, but just start with a blank SD card and give it a go. Post questions here if you get stuck and I (or someone else) will try to help you out. You'll probably learn a lot more by experimenting yourself.

Have a look here for examples of the config files in the DSI folder for retropie, and a PINN /noobsconfig flavour.txt file. You'll have to download OSMC onto your PINN SD card, or onto a USB stick and put the additional DSI files with it in order for it to install. PINN will only install the flavour if it is a local install, but I hope to customise distros installed from the internet as well in the future.

Have a read of noobsconfig first too, as that will help you understand how the custom flavours work (just replace NOOBS with PINN allow the DSI switching to work). Otherwise, you'll have to be patient if you need step-by-step instructions.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

masinac007
Posts: 1
Joined: Tue Nov 29, 2016 4:25 pm

Re: [How To] Auto detect hdmi while having dsi display conne

Tue Nov 29, 2016 4:32 pm

I got a minor problem, I have done everything till the step about transfering Rasbian on SD card, I downloaded it from official site in zip format and I transfered it on SD card in "os" folder (also tried making another folder like /os/rasbian) after that I put a SD card in raspberry and on install menu i only have those avalaible online (tried installing that way raspbian but something is not working)

so question is how to transfer rasbian to sd in which format. Thanks a lot.

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Wed Nov 30, 2016 9:48 am

My original instructions were for a "noobsconfig" automated install of an OS that provided 2 flavours, one with DSI switching and one without. For this to work, you have to install the OS from a local source.
However, it you want to configure it manually, you don't even need to download the OS to the SD card, just let PINN choose it from the internet download server. (This will save you some space on your SD card)
Once it is installed, you can follow @flowerdog's instructions from step 6.

For completeness, and for anyone else who wants to download it to the SD card.....

Download this file: http://downloads.raspberrypi.org/NOOBS/ ... v2_1_1.zip (or a more recent version if one exists)
This file contains NOOBS and the correct OS files to install Raspbian.
Unzip this file to your PC. Now copy only the /os/Raspbian folder and all its contents to your SD card that has PINN on it.
Then follow the instructions as above from step 5

NOOBS/PINN will only display the latest version of an OS to install, so if you are connected to the internet when you run it, it may still select the version on the internet if it is the same or a later version than the one on the SD card. This should not be a problem.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

aguayoismael
Posts: 1
Joined: Wed Jan 25, 2017 8:43 pm

Re: [How To] Auto detect hdmi while having dsi display conne

Wed Jan 25, 2017 8:46 pm

Can someone please help me, I tried to follow these instructions and still a no go,.....Im running Berryboot OS (Kali and RetroPie)

Im trying to have my Pi auto detect if there is an HDMI plugged in and use that, But if not, then use the connected DSI screen.


A video or something will help, I tried these directions up and down :(

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Wed Jan 25, 2017 11:22 pm

Berryboot does not support this functionality. You can only do it with PINN as it includes specific support for it. PINN already supports installing / booting retropie, but you'll need to convert Kali to install it as a custom os according to the noobs or pinn instructions on github.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

john.t
Posts: 28
Joined: Fri Sep 23, 2016 10:56 am

Re: [How To] Auto detect hdmi while having dsi display conne

Fri Feb 03, 2017 1:22 pm

flowerdog wrote:Hi guys,

the search is over. Here you will find an easy guide to autodetect hdmi on boot.

After following this guide you can use displays connected to hdmi, while the dsi display is connected.
If hdmi is connected on boot, it will use hdmi, otherwise it uses the integrated dsi display.

I have been searching the web already a whole day and know how painful and annoying it is.

So I share my solution:
I followed the guide on https://github.com/procount/pinn/blob/m ... ME_PINN.md . Scroll down there and you will find some instructions on autodetect hdmi. They are not so clear, so I write it more clearly down here.

I just tried it with rasbian, I don't know, if it works with other os
You need to use PINN and install rasbian with it, edit some files and then it works

In this instructions F:\ is the sd card

First of all:

1. Download PINN-Lite - https://sourceforge.net/projects/pinn/? ... p_redirect
- PINN is an extended NOOBS, which can detect hdmi on boot

2. Format your sd card with Formatter etc.- https://www.sdcard.org/downloads/formatter_4/

3. Copy the files from the PINN Lite zip file onto the formatted sd card

4. Download rasbian and copy it into the os-folder on the sd card e.g. F:\os\Rasbian

5. Mount sd card into raspberry pi and start installation

6. After Rasbarian starts and graphical user interface starts up, turn it off. Put the sd card back into windows computer.

7. Edit "recovery.cmdline" in F:\, add to the end of the line " dsi" , dont fortget the space-character, and save

8. Go to F:\ and create a config.txt and add the line "ignore_lcd=1" and save
- when starting, the output will be forced onto hdmi with this command. PINN menu will only be visible on hdmi source now
- this is important, so the dsi display does not blink, while using hdmi

9. Mount sd card back into raspberry pi and start into rasbian.

10.Open terminal and go to /boot/

11. Create file "config.dsi" in /boot/ - this config will be loaded, when hdmi is not connected
- dsi display loads automatically and does not need any commands, so the config.dsi can be empty
- you can add later, what usually would go into config.txt to configure your dsi display

12. Create file "config.hdmi" in /boot/ - this config will be loaded, when hdmi is connected
- add line "ignore_lcd=1" to config.hdmi, this forces to ignore the dsi display

13. Make sure all files are saved, reboot raspberry pi and READY ! :D

It's working for me without any problems.
Thanks to ProCount PINN!


I am looking for another solution, to turn off the dsi display backlight, while using hdmi, but this solutions works well.
Hello ,
would this also work for vga666 and hdmi?i'm currently looking for a way to show my python code(its an image generator) via hdmi and vga. it doesn't have to show the image simultaneously but it would be nice to switch from vga to hdmi without editing config.txt via terminal everytime.

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [How To] Auto detect hdmi while having dsi display conne

Mon Feb 06, 2017 12:52 pm

@john.t - Have you seen the following thread: viewtopic.php?f=29&t=135210 ?
Maybe it will help you in your quest...?
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Official Foundation Display”