You are not logged in.

#1 2015-03-23 15:32:00

larsonmars
Member
Registered: 2015-03-23
Posts: 4

HDMI does not come back after disconnect

Hello Archers,

this one is bugging me for a while now, perhaps someone has an idea.

I have a headless ARCH home server that mainly has the following purposes:
1. being a 24/7 file/backup/ssh server for family and friends
2. being an MPD server connected to my music system

The setup may seem a bit exotic. The computer is connected to the music system via HDMI over an S/PDIF audio extractor to the music system. This is because the machine replaced a RaspberryPi that really had crappy analog audio output and my music system has an optical input and can perform the digital to analog conversion itself. I have not installed Pulse just alsa and jack2-dbus.

aplay -l shows the following:

**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: PCH [HDA Intel PCH], Gerät 0: ALC887-VD Analog [ALC887-VD Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: PCH [HDA Intel PCH], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0
The Problem:

Whenever I switch off the music system and later switch it back on, the HDMI-connection is lost and does not get reestablished. I tried various things but essentially only a reboot of the machine helps (which opposes purpose 1 of the machine). On the RaspberryPi I did not have that problem, probably due to the hdmi_force_hotplug=1 in /boot/config.txt.

My Observations so far:
  • The first problem that made the sound disappear was the screen blanker on the console after 10 minutes. This can be prevented with

    setterm --term linux --blank 0 >/dev/tty1   # You need write permission on /dev/tty1 for this to work! 
  • There are no appearant error or warning messages when using e.g. aplay or speaker-test, just no sound at all

  • There are tipps in the forums/the internet sugesting to disable power management on the display involving xset and xrandr. However, I have no X running and the tools complain that they cannot find/open the display

  • In /proc/asound/PCH/codec#2 I find the HDMI codec to show the following as long as it is connected after a reboot:

    Codec: Intel Valleyview2 HDMI
    Address: 2
    AFG Function Id: 0x1 (unsol 0)
    Vendor Id: 0x80862882
    Subsystem Id: 0x80860101
    Revision Id: 0x100000
    No Modem Function Group found
    Default PCM:
        rates [0x0]:
        bits [0x0]:
        formats [0x0]:
    Default Amp-In caps: N/A
    Default Amp-Out caps: N/A
    State of AFG node 0x01:
      Power states:  D0 D3
      Power: setting=D0, actual=D0
    GPIO: io=0, o=0, i=0, unsolicited=0, wake=0
    Node 0x02 [Audio Output] wcaps 0x6611: 8-Channels Digital
      Device: name="HDMI 0", type="HDMI", device=3
      Converter: stream=8, channel=0
      Digital: Enabled GenLevel
      Digital category: 0x2
      IEC Coding Type: 0x0
      PCM:
        rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
        bits [0x1e]: 16 20 24 32
        formats [0x5]: PCM AC3
      Power states:  D0 D3
      Power: setting=D0, actual=D0
    Node 0x03 [Audio Output] wcaps 0x6611: 8-Channels Digital
      Converter: stream=0, channel=0
      Digital: Enabled
      Digital category: 0x0
      IEC Coding Type: 0x0
      PCM:
        rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
        bits [0x1e]: 16 20 24 32
        formats [0x5]: PCM AC3
      Power states:  D0 D3
      Power: setting=D0, actual=D0
    Node 0x04 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
      Control: name="HDMI/DP,pcm=3 Jack", index=0, device=0
      Control: name="IEC958 Playback Con Mask", index=0, device=0
      Control: name="IEC958 Playback Pro Mask", index=0, device=0
      Control: name="IEC958 Playback Default", index=0, device=0
      Control: name="IEC958 Playback Switch", index=0, device=0
      Control: name="ELD", index=0, device=3
      Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
      Amp-Out vals:  [0x00 0x00]
      Pincap 0x09000094: OUT Detect HBR HDMI DP
      Pin Default 0x18560010: [Jack] Digital Out at Int HDMI
        Conn = Digital, Color = Unknown
        DefAssociation = 0x1, Sequence = 0x0
      Pin-ctls: 0x40: OUT
      Unsolicited: tag=01, enabled=1
      Power states:  D0 D3
      Power: setting=D0, actual=D0
      Connection: 2
         0x02* 0x03
    Node 0x05 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
      Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
      Amp-Out vals:  [0x00 0x80]
      Pincap 0x09000094: OUT Detect HBR HDMI DP
      Pin Default 0x58560020: [N/A] Digital Out at Int HDMI
        Conn = Digital, Color = Unknown
        DefAssociation = 0x2, Sequence = 0x0
      Pin-ctls: 0x40: OUT
      Unsolicited: tag=00, enabled=0
      Power states:  D0 D3
      Power: setting=D0, actual=D0
      Connection: 2
         0x02 0x03*
    Node 0x06 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
      Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
      Amp-Out vals:  [0x00 0x80]
      Pincap 0x09000094: OUT Detect HBR HDMI DP
      Pin Default 0x58560030: [N/A] Digital Out at Int HDMI
        Conn = Digital, Color = Unknown
        DefAssociation = 0x3, Sequence = 0x0
      Pin-ctls: 0x40: OUT
      Unsolicited: tag=00, enabled=0
      Power states:  D0 D3
      Power: setting=D0, actual=D0
      Connection: 2
         0x02 0x03*
    Node 0x07 [Vendor Defined Widget] wcaps 0xf00000: Mono

    After disconnect/reconnect it changes to this:

    Codec: Intel Valleyview2 HDMI
    Address: 2
    AFG Function Id: 0x1 (unsol 0)
    Vendor Id: 0x80862882
    Subsystem Id: 0x80860101
    Revision Id: 0x100000
    No Modem Function Group found
    Default PCM:
    N/A
    Default Amp-In caps: N/A
    Default Amp-Out caps: N/A
    State of AFG node 0x01:
      Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK, Setting-reset
    Invalid AFG subtree
  • I figured that the problem is probably related to powermanagement, so I experimented with powertop. This resulted in a reduced consumption of 1W when idle, which is nice but did not solve the original problem...

The Questions
  1. Is there a way to completely reinit the HDMI subsystem just like on a reboot?

  2. Is there an option comparable to hdmi_force_hotplug=1 on the pi that forces the HDMI signal to stay up?

Thank You for Your time!

Best regards,

Lars

Offline

#2 2015-03-27 08:28:22

zofiel
Member
Registered: 2015-03-27
Posts: 11

Re: HDMI does not come back after disconnect

Same problem here when I turn off my TV (HDMI1). No image

As a workaround, I press the keys ctrl + alt + F3 to jump to console mode, the startx and the desktop return smile

Offline

#3 2015-05-30 16:35:28

larsonmars
Member
Registered: 2015-03-23
Posts: 4

Re: HDMI does not come back after disconnect

I can confirm what zofiel said. I have tested it by connecting a TV and HDMI reactivitated by switching from X to console. However, this option only works one time and requires X running in the first place, which I usually have not on a headless server, but it made me think: Obviousely the X server needs to activate the graphics in the first place. Then I came up with an idea for a really messy work around. I could try to remotely start X. Normally, this is not possible and you get:

% startx

/usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

You can force it to work:

sudo startx

You get lots of error messages, but HDMI audio is back, even if one kills the X process afterwards with Ctrl+C (Audio stops, but resumes two seconds later). The downside is that starting X with sudo messes up permissions with the x related files in your home directory and you will have problems to use startx afterwards, so it is probably better to use su instead of sudo. If root does not have a properly configured .xinitrc file then one can also just execute the desktop environment directly e.g., for XFCE:

su - root -c "startxfce4" 

Then kill it with Ctrl+C and you should have HDMI Audio working.

So now I could pack this in a script followed by some command to kill it, but, well, it is an ugly workaround

Is there really no better way?

Offline

#4 2015-05-31 11:06:04

larsonmars
Member
Registered: 2015-03-23
Posts: 4

Re: HDMI does not come back after disconnect

Okay, for now this is the dirty workaround in one line:

sudo -E sh -c 'xinit & PID=$! && sleep 10 && kill $PID'

Perhaps it is useful for someone else.

Note that the 10 is an estimate that I think should be ok for most systems.

Offline

Board footer

Powered by FluxBB