Notes on my long running project to build a HTPC to replace my aging PVR has had many issues. The HDMI output is from the GPU on an Intel i3-3220 CPU in a Gigabyte GA-Z68M-D2H motherboard which is then connected to a Pioneer SC-LX57 AVR and then onto a Panasonic TH50PZ700A 50″ plasma screen.
No sound at 1080p resolution
Initially I was using a Yamaha RXV-3800 AVR and sound was working fine. After returning from holidays and finding the Yamaha had failed. Eventually the failed AVR was replaced with a Pioneer SC-LX57 AVR. At this point I no longer had any HDMI audio and since the HTPC was still a work in progress I could no longer remember if it used to work or not. I thought I had, but wasn’t sure.
After much messing around it wasn’t until the output reverted itself to 720p (due to the second issue below) that I suddenly heard sound from the HTPC via the new Pioneer AVR. It still took some time to figure out that there was no sound at 1080p@60 and 1080p@50 but with any other resolution sound worked fine. So 1080i and 720p both worked fine for example.
The issue turned out to be a timing issue in the Intel driver. Apparently most amplifiers were fine with the wrong timings, but the Pioneer was not happy and refused to decode the audio. The first reference to this issue I could find, along with some clues as to what was going on, was on the alsa-users mailing list:
The eventual fix appeared several months later on the intel-gfx list:
The fix was eventually merged into the main line kernel version 3.13-rc1:
commit 1a91510dc3b8098930ebda3018f5cd72e8428243 Author: Jani Nikula <email@example.com> Date: Wed Oct 16 12:34:48 2013 +0300 drm/i915: set HDMI pixel clock in audio configuration The HDMI audio expects HDMI pixel clock to be set in the audio configuration. We've currently just set 0, using 25.2 / 1.001 kHz frequency, which fails with some modes. v2: Now with a commit message.
After upgrading the kernel to 3.13-rc3 sound was indeed working again at 1080p, and all other resolutions.
Default resolution of 720p
Every time the HTPC was turned on, or a different input device was selected on the AVR and then the HTPC device re-selected the resolution would switch back to 720p. Needless to say this was rather annoying.
There were two different issues at play here. The first was that the display was reporting that it prefered 720p in its EDID information:
[htpc][ 7:01PM]~#> DISPLAY=:0 xrandr --current Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1434mm x 806mm 1280x720 50.0 + 60.0 1920x1080 60.0* 50.0 1920x1080i 30.0 25.0 1440x576i 25.0 1440x480i 30.0 720x576 50.0 720x480 59.9 640x480 59.9 DP2 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis)
The asterisk (*) represents the current mode, while the minus (-) represents the default mode. I would assume the first mode listed is the default since the above order matches what the EDID information from the display.
After trying many different options I ended up using the video command line parameter to request a specific output and video mode:
[htpc][ 2:41PM]~%> grep ^GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="video=HDMI-A-2:1920x1080@60"
The available resolutions can be found in the xrandr output above. The name of the device was a bit more complicated to find. Looking in /sys/class/drm and finding an entry that was enabled is probably the easiest way to determine this:
[htpc][ 6:06PM]~%> for i in /sys/class/drm/card*/enabled; do echo -n "$i\t"; cat $i;done /sys/class/drm/card0-DP-1/enabled disabled /sys/class/drm/card0-DP-2/enabled disabled /sys/class/drm/card0-HDMI-A-1/enabled disabled /sys/class/drm/card0-HDMI-A-2/enabled enabled /sys/class/drm/card0-VGA-1/enabled disabled
With this change made the system boots with 1080p as the default resolution instead of 720p. Other options may have worked, but I was also fighting to get HDMI sound output at the same time! There option I played with was using the kernels built in EDID information via the ‘drm_kms_helper.edid_firmware=HDMI-A-2:edid/1920×1080.bin‘ command line option. While this worked it also seemed to stop sound from working, although I am longer sure if that was due to the ‘no sound at 1080p‘ issue or because this built in EDID needed to contain sound information for sound to work. Since the video options is working perfectly now I have left it as it is.
But even though this change resulted in it starting up the correct resolution it still failed to hold that resolution when switching devices. Changing away from the HTPC and back again more often than not resulted in it returning to 720p. Each time this happened the following kernel messgae was logged by the kernel:
edid_block_ valid] *ERROR* EDID checksum is invalid, remainder is 161
This appears to be an issue with the kernel and its re-reading of the EDID information when the display is re-connected. After upgrading to the latest kernel (3.13-rc3) and xorg (via the xorg-edgers-ppa-precise) this issue has now gone away. It looks like this is a kernel issue so I would assume the kernel upgrade was responsible for fixing this.