Results 1 to 2 of 2

Thread: Trying to automatically switch to HDMI audio when cable is plugged in

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Beans
    1,634
    Distro
    Ubuntu 14.04 Trusty Tahr

    Question Trying to automatically switch to HDMI audio when cable is plugged in

    All I need is a way to:
    1. Automatically detect when HDMI is connected
    2. Switch to HDMI audio, basically simulate opening the sound settings and clicking on HDMI out
    3. Switch back to laptop speakers when HDMI is unplugged

    What event is triggered when an HDMI cable is plugged in, and would I be able to tie into it? I've checked dmesg and found nothing useful (as far as I could tell).

    I found this, which looks like what I want, but it doesn't work for me because I have no /sys/class/drm directory. This is an updated version of the script that does some extra stuff, but it's still based on that same /sys/class/drm directory.

    This post from 2010 provides a script that can be bound to a keyboard shortcut, but I want it to be automatic. Apparently it doesn't work on 12.04 anyway, but user psmbfuer posted his own version of the script 1 day ago (as of this post) that apparently does. I haven't tried it, because
    Code:
    pactl list cards
    lists my single soundcard as 2 different cards, one for HDMI and one for the laptop speakers.

    Any suggestions for approaching this?
    Don't forget to give thanks and mark your thread as solved

  2. #2
    Join Date
    Feb 2007
    Beans
    7

    Re: Trying to automatically switch to HDMI audio when cable is plugged in

    up for this. I've just installed Ubuntu 12.04 - HDMI video works nicely, but I still have to manually switch the HDMI sound =(

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •