Syntaxerror999
Posts: 9
Joined: Thu Nov 12, 2015 4:04 pm

hdmi_drive=2 .... why?

Mon Jan 02, 2017 8:10 am

Literally every tv ive hooked every pi ive had into has required hdmi_drive=2 to be enabled to get sound working... which beggs the questions...

1 why is it not enabled by default.
2 why is in not a-noob friendly option in your noob friendly configuration program?

User avatar
topguy
Posts: 5566
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: hdmi_drive=2 .... why?

Mon Jan 02, 2017 2:51 pm

Have you literally used the same HDMI cable for all the TVs ?

User avatar
Burngate
Posts: 5882
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: hdmi_drive=2 .... why?

Mon Jan 02, 2017 5:48 pm

topguy wrote:Have you literally used the same HDMI cable for all the TVs ?
... and how does that affect anything?
If hdmi_drive=1, no sound will reach the TV, whatever the cable is like.
If hdmi_drive=2 produces sound, then the cable is capable of carrying the sound, and not putting that in won't change its capability

The OP asks why the default appears to be hdmi_drive=1 rather than hdmi_drive=2

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: hdmi_drive=2 .... why?

Mon Jan 02, 2017 6:41 pm

With hdmi_drive=1 (the default), sound will work in CEA (HDMI) modes, but not in DMT (DVI) modes. hdmi_drive=2 forces sound in DVI modes. I think so anyway - the documentation on raspberrypi.org & elinux isn't very clear on that.

Edited to add: @Syntaxerror999, do you have hdmi_group=2 (force DMT mode) in your config.txt?

klricks
Posts: 6429
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 4:21 am

Reading the comments in /boot/config.txt it appears that the default mode is DVI (no sound).

Code: Select all

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2
I always have to uncomment that line to make sound work on my HDMI TV and have also wondered why hdmi_drive=2 is not the default?
It would not make any difference to users with a DVI monitor as they will always have to get sound via AV port anyway.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

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

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 9:54 am

Odd, never changed the drive option and always get sound over HDMI. Or use to. I'll check with Dom.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5267
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 11:46 am

We use the EDID to determine what modes a display supports and prefers.
There are two broad categories of display modes, CEA (TV style resolutions) and DMT (monitor style resolutions).
CEA modes should be driven with HDMI signalling which supports audio.
DMT modes should be driven with DVI signalling which doesn't support audio.

Now you can drive DMT modes with HDMI signalling which allows some monitors to support audio,
but according to the spec they don't have to support this, and may just report unsupported mode and give no picture.

So, to be safe we follow the specs and don't support audio for DMT modes. You have to enable this manually (and disable it if it causes problems).
Now, I think monitors rejecting HDMI signalling may be rare (I've not seen one), but enabling it by default may well cause issues for some users and would be a risk.
Choosing the option that gives video and no audio is safer than an option that may give no video.

Note: I imagine most Pi users are using standard HDMI TVs using CEA modes and so don't have any problems.
Many computer monitors (probably most) don't support audio, so there isn't an issue.
However if you have a computer monitor that supports audio then you do fall into the category where a manual change is required.

User avatar
bensimmo
Posts: 4059
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 12:01 pm

There are a number of TV's that for example Samsung used where they use a 16:10 panel, aka a 'monitor' size.
I have one and it has speakers of course, I've seen plenty of them around too.

Of course most modern era panels are now 720/1080 16:9 and these work so much easier with the Pi and HDMI.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5267
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 12:31 pm

bensimmo wrote:There are a number of TV's that for example Samsung used where they use a 16:10 panel, aka a 'monitor' size.
I have one and it has speakers of course, I've seen plenty of them around too.

Of course most modern era panels are now 720/1080 16:9 and these work so much easier with the Pi and HDMI.
Yes, the CEA modes predominantly handle the standard SD (4:3) and HD (16:9) aspect ratios.
16:10 modes would be DMT.

Could you provide the EDID of your display? (tvservice -d edid.dat)
I wonder if there is anything we can make use of in there to note it is more of a TV (and so very likely to support HDMI signalling and audio) than a monitor.
E.g. supporting a number of CEA modes (even if CEA isn't its first choice).

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 12:37 pm

AFAICR there was a time when the EU imposed import tariffs on 16:9 displays, deemed to be TVs. So manufacturers fitted 16:10 panels to get round that :roll:. I have such an LG TV/monitor gathering dust - I'll dig it out and report the EDID info.

User avatar
bensimmo
Posts: 4059
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 3:51 pm

I will do and use a fresh clean config.sys to see what happens with current builds.

On the flip side, I did spend a lot of time trying to get sound working on another monitor only to realise half an hour later it had no speakers, so easy to miss the little things causing the problems :-)


Onother thing.
I know we cannot change resolution in Pixel, I cannot remember why, but I do know it would be useful.
One because when using the camera it changes the resolution and I've had it error out and lock in the wrong resolution.
So why with the camera was it possible for it to switch?

User avatar
bensimmo
Posts: 4059
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 4:34 pm

Samsung 225MW
LCD TV Monitor
(Analogue TV in it, UK)

Config.txt commented out completely.
Boots up into 1920x1080i 33.7kHz/ 60Hz as reported by the TV.
No Sound. Blanked out in Pixel.

Settings I would need to faff with are changing it to 1680x1050 and turn sound for speakers on.
I cannot remember if I ever got it all working, it's been a long time since I used it over HDMI or with a Pi.

https://drive.google.com/file/d/0B5TF45 ... p=drivesdk


I have another TV (old freeview) that doesn't detect sound either a Sony Bravia KDL-26S5500, boots up to to 1360x768 60p which is probably it's native, given it is only 720p.
https://drive.google.com/file/d/0B5TF45 ... p=drivesdk

I cannot remember if my Panasonic TX-L37G10B (freeview/freesatHD TV) detected sound either. Will check, I do remember a problem... And that is definitely a TV and 1080.


(Added Sony edid)
Note, I'll check sound again with a new install at some point. In case something is messed up)
Last edited by bensimmo on Tue Jan 03, 2017 5:22 pm, edited 1 time in total.

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: hdmi_drive=2 .... why?

Tue Jan 03, 2017 5:05 pm

edidparser on that Samsung 225MW dump reports a CEA mode as preferred, so sound should work out the box?

I won't have access to my LG until later, but for now here's the parsed edid dump of a Motorla Atrix Lapdock which requires hdmi_drive=2 for sound:

Code: Select all

[email protected]:~ $ tvservice -d AtrixLapdock.b
Written 256 bytes to AtrixLapdock.b
[email protected]:~ $ edidparser AtrixLapdock.b
Enabling fuzzy format match...
Parsing AtrixLapdock.b...
HDMI:EDID version 1.3, 1 extensions, screen size 26x14 cm
HDMI:EDID features - videodef 0x80 !standby !suspend !active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
HDMI:EDID found monitor S/N descriptor tag 0xff
HDMI:EDID found monitor range descriptor tag 0xfd
HDMI:EDID monitor range offsets: V min=0, V max=0, H min=0, H max=0
HDMI:EDID monitor range: vertical is 50-75 Hz, horizontal is 30-85 kHz, max pixel clock is 150 MHz
HDMI:EDID monitor range does not support GTF
HDMI:EDID found monitor name descriptor tag 0xfc
HDMI:EDID monitor name is MotoAttach
HDMI:EDID found preferred DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID established timing I/II bytes are 00 00 00
HDMI:EDID standard timings block x 8: 0x0101 0101 0101 0101 0101 0101 0101 0101
HDMI:EDID parsing v3 CEA extension 0
HDMI:EDID monitor support - underscan IT formats:no, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID failed to find a matching detail format for 0x1080i hfp:88 hs:44 hbp:-116 vfp:2 vs:5 vbp:16 pixel clock:0 MHz
HDMI:EDID calculated refresh rate is 0 Hz
HDMI:EDID guessing the format to be 0x1080i @24 Hz
HDMI:EDID found unknown detail timing format: 0x1080i hfp:88 hs:44 hbp:-116 vfp:2 vs:5 vbp:16 pixel clock:0 MHz
HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz
HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48|96|192 kHz, sample size: 16|20|24 bits
HDMI:EDID found HDMI VSDB length 5
HDMI:EDID HDMI VSDB has physical address 1.0.0.0
HDMI:EDID HDMI VSDB has no extension fields
HDMI:EDID adding mandatory support for DMT (4) 640x480p @ 60Hz
HDMI:EDID adding mandatory support for CEA (2) 720x480p @ 60Hz
HDMI:EDID adding mandatory support for CEA (17) 720x576p @ 50Hz
HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
HDMI:EDID best score mode initialised to DMT (4) 640x480p @ 60 Hz with pixel clock 25 MHz (score 0)
HDMI:EDID best score mode is now CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 43432)
HDMI:EDID best score mode is now CEA (2) 720x480p @ 60 Hz with pixel clock 27 MHz (score 45736)
HDMI:EDID CEA mode (3) 720x480p @ 60 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID DMT mode (4) 640x480p @ 60 Hz with pixel clock 25 MHz has a score of 36864
HDMI:EDID CEA mode (17) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID CEA mode (18) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID best score mode is now DMT (86) 1366x768p @ 60 Hz with pixel clock 72 MHz (score 5188835)
HDMI:EDID preferred mode remained as DMT (86) 1366x768p @ 60 Hz with pixel clock 72 MHz
HDMI:EDID has HDMI support and audio support
edid_parser exited with code 0
[email protected]:~ $
Sound also works on this when fed a CEA 1920x1080i signal from a set top box. I guess that's the "0x1080i" "unknown detail timing format" mode above.

Edited to add: my old LG M2794 works fine, audio with hdmi_drive=1, so no point in posting the edid data.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5267
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: hdmi_drive=2 .... why?

Wed Jan 04, 2017 6:45 pm

I've discussed this issue with our hdmi expert, and he thinks it is probably safe to use hdmi drive for a DMT mode when the monitor reports support for some CEA modes.
This means many users will no longer require hdmi_drive=2 with a change that is hopefully safe.

If anyone wants to experiment with the suggested change then test firmware is here:
https://www.dropbox.com/s/hfbqqgu3unz8o ... i.zip?dl=0

With bensimmo's Sony display:

Code: Select all

[email protected]:~ $ tvservice  -s
state 0x120006 [DVI DMT (39) RGB full 16:9], 1360x768 @ 60.00Hz, progressive
[email protected]:~ $ tvservice  -m CEA
Group CEA has 13 modes:
           mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive 
           mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive 
           mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive 
           mode 4: 1280x720 @ 60Hz 16:9, clock:74MHz progressive 
           mode 5: 1920x1080 @ 60Hz 16:9, clock:74MHz interlaced 
           mode 6: 720x480 @ 60Hz 4:3, clock:27MHz x2 interlaced 
           mode 7: 720x480 @ 60Hz 16:9, clock:27MHz x2 interlaced 
           mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive 
           mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive 
           mode 19: 1280x720 @ 50Hz 16:9, clock:74MHz progressive 
           mode 20: 1920x1080 @ 50Hz 16:9, clock:74MHz interlaced 
           mode 21: 720x576 @ 50Hz 4:3, clock:27MHz x2 interlaced 
           mode 22: 720x576 @ 50Hz 16:9, clock:27MHz x2 interlaced 
and with new firmware:

Code: Select all

[email protected]:~ $ tvservice  -s
state 0x12000a [HDMI DMT (39) RGB full 16:9], 1360x768 @ 60.00Hz, progressive
We are now using HDMI drive by default, so hdmi_drive=2 is no longer required.

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: hdmi_drive=2 .... why?

Wed Jan 04, 2017 7:27 pm

All fine with the Motorola Atrix Lapdock and this test firmware, hdmi_drive=2 no longer needed.

klricks
Posts: 6429
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: hdmi_drive=2 .... why?

Sat Jan 07, 2017 3:43 am

The test firmware works for me as well.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Return to “Raspbian”