LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-19-2011, 04:57 AM   #1
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Automatically switching tv layout and sound hardware when connecting HDMI


Howdy,

Does anyone know if there are any shortcuts to automatically enable video and audio through HDMI when I plug my laptop into my AV Receiver?

Currently in Gnome I go into system settings, displays, enable the new 2nd screen and set the resolution and apply. then I go to sound preferences and change the hardware from internal analog duplex to hdmi output.

I'm not that fussed about it all configuring by itself, but I'd really like to be able to script the config changes at least.

Any clues?
 
Old 09-19-2011, 07:22 PM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
acid

since you are a moderator...forgive me for asking but have you considered creating an udev rule?
 
Old 09-20-2011, 01:32 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
to do what? I can certainly fire off a bunch of commands when I plug my TV in, but what would those commands actually be? TBH I'm not even sure what controls the sound config these days. I've been "just using" fedora for so long I've paid so little attention to what's under the hood!
 
Old 09-20-2011, 03:02 AM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
sorry I don't use fedora but until you get a better reply try this when you get a chance pls

1) with laptop not plugged into device....consider posting the output of your xorg.conf
then plug in to device......if xorg changes post both before and after files pls.......we can use them to create an udev rule.

2) Not sure why gnome uses for sound....do you have pulseaudio running? or oss or alsa?

You may wish to double post to http://forums.fedoraforum.org/?
 
Old 09-20-2011, 03:05 AM   #5
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
sorry I am having trouble with my browser which I have reported.

we will also need the output of

lspci

2) Can you also have a look at where your udev rules are pls

mine are at /etc/udev/rules.d
 
Old 09-20-2011, 03:11 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Pffft! Why is it so so often the case that I can't make any progress until I ask for help then work it out myself anyway???

Code:
#!/bin/sh
if [[ $1 ]]
then
  xrandr --output HDMI1 --off
  pactl set-card-profile 0 output:analog-stereo+input:analog-stereo
else
  xrandr --output HDMI1 --mode 1280x720 --right-of LVDS1
  pactl set-card-profile 0 output:hdmi-stereo+input:analog-stereo
fi

Hurrah. job done. I don't know if it's feasible to make a udev rule for removal as my laptop seems to screw up royally if I try to look at the display layout if the TV is configured but absent. Nice enough start though. Thanks for the mind nudge.

Last edited by acid_kewpie; 09-20-2011 at 03:41 AM.
 
Old 09-20-2011, 03:17 AM   #7
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
ok I think I found my udev for my sound elsewhere at

/run/udev/data/~soundcard and its contents are

I:5497203
E:SOUND_INITIALIZED=1
E:ID_VENDOR_FROM_DATABASE=Intel Corporation
E:ID_MODEL_FROM_DATABASE=N10/ICH 7 Family High Definition Audio Controller
E:ID_BUS=pci
E:ID_VENDOR_ID=0x8086
E:ID_MODEL_ID=0x27d8
E:ID_PATH=pci-0000:00:1b.0
E:ID_PATH_TAG=pci-0000_00_1b_0
E:SOUND_FORM_FACTOR=internal
 
Old 09-20-2011, 03:18 AM   #8
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
just saw your reply well done
 
Old 01-02-2014, 05:44 PM   #9
weinerwad3000
Member
 
Registered: Aug 2013
Posts: 62

Rep: Reputation: Disabled
I'm having the same problem except it only happens with the audio. The video is automatic but i have to go into sound and change it manually when hooked up to hdmi. I don't want to screw anything up so if I use your code and just leave out the video settings will this work or do I have to change any of the values?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting an HDMI Motherboard to an HD TV Woodsman Linux - Hardware 2 05-17-2009 05:53 PM
Switching keyboard layout - Mandriva2006 - K.D.E. Windows Layout! itz2000 Mandriva 3 08-13-2006 06:43 PM
Keyboard layout switching problems OpossumPetya SUSE / openSUSE 1 01-01-2006 05:33 PM
Keyboard layout switching in KDE kornerr Linux - General 2 02-04-2005 09:16 AM
keyboard layout is switching goestin Linux - General 0 11-23-2004 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration