Pioneer SC-LX57, Linux, MythTv, Intel (i915) GPU and HDMI issues

The HTPC

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:

https://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg29210.html

The eventual fix appeared several months later on the intel-gfx list:

http://www.mail-archive.com/intel-gfx@lists.freedesktop.org/msg27874.html

The fix was eventually merged into the main line kernel version 3.13-rc1:

commit 1a91510dc3b8098930ebda3018f5cd72e8428243
Author: Jani Nikula <jani.nikula@intel.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:

[527883.367864] [drm:drm_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.

Pioneer SC-LX57 (SC-75) I/O assignments

The following image shows the inputs available on the rear of the Pioneer SC-LX57:

Pioneer SC-LX57 rear panel inputs

There are eight HDMI inputs (IN1, BD, IN2, IN3, IN4, IN6, IN7 and IN8) on the back panel with an additional HDMI input on the front (IN5/MHL). There are two component inputs, two coaxial digital inputs, two optical digital inputs and a number of analog and composite video inputs. Other inputs include the adapter port for an optional bluetooth adapter, an Ethernet port and a WiFi adapter (usb) port (not shown) for network access and a USB port on the front.

The available options for input assignment to devices wasn’t totally clear from the manual. After some experimentation I now have a full table of what inputs can be used with each device, as shown in the following table:

Input assignments
INPUT
DEVICE
OPT
1
OPT
2
COAX
1
COAX
2
HDMI/
BD
HDMI/
IN1
HDMI/
IN2
HDMI/
IN3
HDMI/
IN4
HDMI
/MHL/
IN5
HDMI/
IN6
HDMI/
IN7
HDMI/
IN8
Comp-
onent

1
Comp-
onent

2
Analog
1
Fixed
Analog
Fixed
Comp-
osite
Direct
Remote
Key
TV Y Y Y Y                       Y     TV
CD Y Y Y Y                       Y     CD
BD         Y                           BD
DVD Y Y Y Y   Y Y Y Y Y Y Y Y Y Y   DVD DVD DVD
SAT/CBL Y Y Y Y   Y Y Y Y Y Y Y Y Y Y   SAT SAT SAT/CBL
BDR/DVR Y Y Y Y   Y Y Y Y Y Y Y Y Y Y   BDR BDR BDR/DVR
VIDEO Y Y Y Y   Y Y Y Y Y Y Y Y Y Y   VIDEO VIDEO  
HDMI5           Y Y Y Y Y Y Y Y           MHL
HDMI6           Y Y Y Y Y Y Y Y            
HDMI7           Y Y Y Y Y Y Y Y            
HDMI8           Y Y Y Y Y Y Y Y            

Some additional notes an the input assignments:

  • Audio assignment for the TV device is not available when HDMI ARC (‘Audio Return’) is enabled. When ARC is enabled the audio is taken from the return audio path via the HDMI OUT 1 output.
  • The Analog and Composite fixed inputs are dedicated to the specified device and not assignable.
  • All devices have IR input codes to directly select the device.
  • All devices have separate  ‘Auto’ input IR codes that as well as selecting the device will also power on the AVR if it is not already powered on and then switch to the selected input. This is very handy in that it avoids a delay that would normally be needed to wait for the AVR to power up before selecting the correct input.
  • It is not possible to select video and audio devices separately (so no way to watch the SAT/CBL device while listening to the CD device for example.)
  • When an audio only device is selected the HDMI output appears to be turned off.
  • HDMI4, HDMI6, HDMI7 and HDMI8 are connected via an internal HDMI switch. This does not effect assignment or input selection but it does effect the HD-ZONE output (If using the third HDMI output as a separate zone.) It is not possible to have more than one source from this group active at any time.
  • The inputs without a direct access key on the remote can still be selected by using the HDMI input cycle button or the next/previous device button.
  • The MHL remote button does not have any device code associated with it. It switches the remote to the Pioneer MHL control IR code set.
  • The HDMI remote button does have a device code associated with it, but it will also cycle through any HDMI input that are not skipped each time it is pressed.

In many ways this is far more complex to setup and far more restrictive than the Yamaha RXV-3800 that it replaced. All the extra inputs and the full list of IR codes made available by Pioneer though have made this far less of a problem  then it might have otherwise been.

Note that the Pioneer SC-LX57 is also known as the SC-75 in other markets. The SC-LX77 and SC-LX87 (SC-77 and SC-79 in other markets) are practically identical from the input device configuration point of view (with the addition of a PHONO and USB DAC inputs being the main differences).