User:GnEeErKd

From LinuxMCE
Revision as of 07:10, 11 January 2010 by GnEeErKd (Talk | contribs) (Set the Skype options)

Jump to: navigation, search

Core/MD Hybrid

  • This is a one network card installation
  • There is no capture card/MythTV in this setup
  • There is no phone system control in this setup

Hardware

  • Asus T3-P5945GCX Barebones with 3.00GHz Pentium 4
  • Nvidia GeForce 6600 256 MB PCI-E 16x Video Card (DVI Output)
  • 2 GB Generic RAM
  • 80 GB Seagate ST380215A Hard Drive (for the OS and temporary media storage)
  • 1 TB Western Digital 10EAVS External Hard drive (for media storage)
  • DVDRAM GSA-4167B

Peripherals and Accessories

  • 24 inch Sceptre LCD Monitor (DVI)
  • 5.1 Channel Creative Sound System
  • Gigaware microphone
  • Generic USB 5 Button Wireless Optical Mouse with Scroll Wheel
  • Generic Wireless PS/2 keyboard
  • Ezonics EZCam USB Webcam
  • Microsoft NX-6000 Webcam
  • Generic 7-port USB Hub
  • USB Bluetooth Dongle with CSR chipset
  • HP Deskjet 2545 USB Printer

Software

  • LinuxMCE 0810 beta2
  • lmce-activate-orbiter-plasmoid
  • kubuntu-restricted-extras
  • libdvdread3
  • xbindkeys
  • xautomation
  • alsamixer
  • VNC/Remote Desktop Viewer
  • BlueProximity

X10 Devices

Controlling

  • Controller: CM11A
  • Remote: KR22A

Controlled

  • LM465 is dimmable
  • AM466 is not dimmable
  • RR501 is not dimmable and is a remote control receiver (Can only be unit code 1 or 9)
 Device Code | Module | Description
      B1     | RR501  | Sound System Power
      B2     | LM465  | Floor Light
      B3     | LM465  | Light Tree
      B4     | LM465  | Desk Light
      B5     | AM466  | Monitor Power
      B6     | AM466  | Rope Lights & Strobe Light
      B7     | AM466  | Fan
      B8 ------------------------------------------
      B9     | RR501  | Black Lights

The Installation

  • This is a one network card installation
  • There is no capture card/MythTV in this setup
  • There is no phone system control in this setup
  • Single quotes (i.e. 'sudo apt-get install foo') represent commands to be typed into the terminal
  • Web Admin can be accessed by going to http://localhost on the core or by going to http://<core-network-IP-address> from a computer on the network.
  • Some sections assume the completion of preceeding sections
    • Skype setup assumes completion of the sound setup
    • Many assume KDE starts on boot
    • Remote Desktop and others assume Firewall is disabled
    • Probably others as well

LMCE 0810 beta2 Installation

  1. Follow the internet installation instructions located here
  2. Upon reboot, temporarily hook the monitor to VGA to go through AVWizard
  3. Choose DVI output, 1080p, 60 Hz, OpenGL with Alpha Blending, stereo sound, 100% volume, and hit I Agree
  4. Upon finishing the AVWizard, there is a grey screen with large text displaying each package that is installed
  5. This continues until it gets to the Orbiter Regeneration
  6. After the orbiter regeneration, I receive the infamous grey screen with a cursor
  7. Use Ctrl+Alt+F2 to get to tty2, and log in
  8. Edit the /etc/network/interfaces file as seen in the configuration files section
  9. After rebooting, the Setup Wizard starts up which steps through the rest of the install process
  10. That's it, after some more big text, MCE starts up fine and begins displaying Flickr pictures on the screensaver

Auto-start KDE desktop behind MCE on boot

  • By default, the KDE desktop environment only starts if you click "KDE desktop" on the OnScreen orbiter
  • To get certain programs and services to run, it is easiest to have KDE startup behind the OnScreen orbiter on boot
  1. Edit /etc/init.d/linuxmce to contain the line shown in the configuration files section

Activate Orbiter Button

  • Once you go to KDE from the on screen orbiter, there's no good way to go back besides reloading the router or clicking on OrbiterGL on the taskbar which rarely works
  • The plasmoid might work, see those instructions here
  • This did not work for me, so I did this instead with much more reliable results:
  1. Open terminal and type 'sudo kate ~/Desktop/Activate-Orbiter.sh'
  2. In the window that appears, paste in the file from the configuration files section
  3. Save and exit this window
  4. Now run 'sudo chmod 755 ~/Desktop/Activate-Orbiter.sh'
  5. Right click on an empty area on the Desktop plasmoid and click "Link to Application"
  6. Replace "Link to Application" with "Activate Orbiter"
  7. Click the ? icon to choose an icon (I made it tux)
  8. Go to the "Application" tab
  9. In the "Command" box enter "~/Desktop/Activate-Orbiter.sh"
  10. Click OK
  11. Click on the newly created shortcut to bring up the OnScreen orbiter
  12. Drag onto the desktop to make it act like a plasmoid

Disable Phone Systems

  • Since this system doesn't do any phone system control, they can be disabled to save time and resources
  1. Web Admin > Wizard > Devices > Core
  2. Uncheck the "Telecom Handlers" box
  3. Click Update
  4. Web Admin > Wizard > Scenarios > Telecom Scenarios
  5. Uncheck each scenario
  6. From the OnScreen orbiter click Advanced > Advanced > Reload & regen all orbiters
  7. Telecom scenarios should be gone
  8. On reboot, core should not try to start the phone devices any more (except the orbiter embedded phone, which seems to regenerate itself if you delete it)

External Hard Drive

  1. After plugging in the external hard drive, a message comes up asking what to do with it
  2. After selecting "use without modifying" the drive is set up by MCE
  3. Web Admin > Files & Media > Media Files Sync
  4. Navigate to the hard drive and resynchronize Movies folder and Music Folder

Configure 5.1 Channel Sound

  • Selecting stereo in the AVWizard does not enable multi-channel analog audio...this is how to fix it
  • Here is this because I will want it later
  1. Web Admin > Wizard > Devices> Media Directors
  2. At the bottom of the media director device settings, change the "Audio Settings" Drop-Down menu to "Multi-channel analog"
  3. Open adept (K menu > applications > add/remove software)
  4. Do a search for "alsa" and then choose the "Settings" category on the left
  5. Select to install "Default sound card" and then click preview and apply changes to install it
  6. Once installed go to K menu > applications > settings > asoundconf-gtk
  7. Choose the intel sound card and quit
  8. Reboot the computer
  9. There should now be a speaker icon in the task bar, click it and then click "mixer"
  10. By default, my surround, center, and LFE (subwoofer) were muted...
  11. Unmuting and adjusting the volume on these works for testing, but they will be set back to these values on reboot
  12. 'sudo kate ~/.kde/Autostart/Set-Volume.sh'
  13. Paste in the script as seen in the configuration files section, the levels and mute/unmute status will be set on startup
  14. Save the file
  15. 'sudo chmod 755 ~/.kde/Autostart/Set-Volume.sh'
  16. Reboot the computer to test this and make sure they are properly set

Get DVDs to play

Instructions grabbed here

  1. Open Terminal
  2. 'sudo apt-get install -y kubuntu-restricted-extras libdvdread3'
  3. 'sudo /usr/share/doc/libdvdread3/install-css.sh'

X10 interface and lighting setup

  1. Plug in all the X10 modules and give them the unit codes described above
  2. Plug in the CM11A controller and hook it to the serial port
  3. Follow the directions here.
  4. Reload the router and regenerate orbiter when it asks to
  5. Tested each module with the Lights > Floorplan button in MCE

Set lighting scenarios

  • By default, lmce gives you Sleep, Wakeup, and House to sleep mode as the Lighting Scenarios
  • Scenarios can be added, deleted, and modified
  1. Web Admin > Wizard > Scenarios > Lighting Scenarios
  2. Click on the scenario to be edited or Add Scenario to make a new one
  3. Choose "Advanced Wizard" from the drop down menu
  4. Choose the items you wish to turn on/off/leave unchanged/set level
  5. Set any media settings (volume level, pause, etc)
  6. Set any security settings (security mode, etc)
  7. Click Update
  8. Once all scenarios are made and configured, go into the OnScreen orbiter and go to Advanced > Advanced > Reload & Regen All Orbiters
  9. Once everything is regenerated and reloaded, the scenarios should now be available by clicking "Lights" on the OnScreen or other orbiter

Internet Radio Channels

Instructions grabbed here

  • If you have a few favorite internet radio stations, you can set them as their own scenarios
  • I will use http://di.fm, but other radio stations should work very similarly
  1. Web Admin > Wizard > Scenarios > Media Scenarios
  2. In the description box, type the name of the channel (Trance)
  3. In the Entertain Area, select the Bedroom(Master)
  4. Choose the Xine Player device
  5. For type, select "LinuxMCE Audio file"
  6. Click Add
  7. Click Edit to the right of the new scenario
  8. In a new window go to the radio station of choice and download the channel playlist (the playlist provides links to each mirror)
  9. Go to that file on that computer and right click > open with
  10. Choose a text editor
  11. Copy the URL of one of the file names (http://scfire-ntc-aa07.stream.aol.com:80/stream/1003)
  12. Paste that into the File Name field of your scenario
  13. Click Save
  14. From the OnScreen orbiter click Advanced > Advanced > Reload & Regen All Orbiters
  15. Once that is finished, there should be a button for that station under "Media" on the orbiters

Disable the Firewall

  • Since this is a single-nic installation, I don't find the firewall very necessary, and it makes other features easier to get working if it is disabled
  1. Web Admin > Advanced > Network > Firewall Rules
  2. Check the "Firewall Disabled" box
  3. Click OK on on the warning dialog

Access Features outside of the Network

  1. Create an account at DynDNS.org
  2. Register a host name for your Media Center using the free DNS service
  3. Web Admin > Advanced > Network > Dynamic DNS Settings
  4. Enter the information you just registered with DynDNS.org
  5. Check the "obtain IP address from the web" box
  6. Click Save
  7. Web Admin > Wizard > Security > Outside Access
  8. Check "Allow outside access on port: " and specify port 8080
  9. Click "Update"
  10. If the Media Center is behind a router, port 8080 will need to be forwarded to the Media Center's IP or name

(This process is slightly different for each router but in my case, the router configuration was located at http://192.168.200.1, Most home routers will have the IP 192.168.0.1 or 192.168.1.1)

  1. On a computer with internet access, you should be able to go to http://<your-dyndns-hostname>:8080 and bring up the Web Admin
  • Sometimes attempting to use http://<your-dyndns-hostname>:8080 while on the same local network won't work, so have a friend test it out or try it on a web-enabled cell phone
  • If that isn't working, maybe MCE needs a router reload or a computer restart

Enable the Web Orbiter

Instructions grabbed here

  1. Web admin > Show Devices Tree > Core
  2. Create Child Device at the top
  3. Pick Device Template
  4. Device Category: Peripherals
  5. Template ID: 1748 (Generic Web Device)
  6. Pick device template
  7. Wait until orbiter generation is finished (progress can be seen at Wizard > Devices > Orbiters)
  8. Quick Reload Router
  9. My proxy orbiter had problems starting up, so I rebooted the whole machine to get it all working nicely
  10. Access the web orbiter by going to http://<core_ip>/lmce-admin/weborbiter.php or clicking the link on the login page of the web admin on any computer on the network
  11. Orbiter settings and preferences can be set at Wizard > Devices> Orbiters and then regenerated accordingly
  12. Assuming previous steps to "Access Features outside of the Network" were followed, web orbiter can be accessed by any computer on the internet by going to http://<your-dyndns-hostname>:8080 and clicking on the link on the login page or by going to http://<your-dyndns-hostname>:8080/lmce-admin/weborbiter.php directly

Enable remote desktop

  1. Go to the KDE desktop on the Media Center
  2. K Menu > Applications > Internet > Desktop Sharing
  3. Click "Configure"
  4. Click "Security"
  5. Check the "Allow uninvited connections" box
  6. Check the "Allow remote connections to control..." box
  7. Uncheck the "Ask before..." box
  8. Enter a password
  9. Click Apply and OK
  10. Use VNC or Remote Desktop Viewer from another computer to control it

Enable Network File Sharing

  • This seems to be enabled by default in LMCE 0810 beta2 so just get on a network computer and connect to \\dcerouter and login
  • External hard drive should be accessible directly or through /public/other/

Assign Functions to mouse buttons

Instructions grabbed here

  1. BACKUP xorg.conf: 'sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup'
  2. edit /etc/X11/xorg.conf mouse settings to look something like that in the configuration files section
  3. run 'xev' in terminal and single click each mouse button in the box that appears, paying attention to the output in the terminal to make sure each button number is correct (if it doesn't you have some trouble shooting to do here)
  4. 'sudo apt-get install -y xbindkeys xautomation
  5. Create the file ~/.xbinkeysrc ('sudo kate ~/.xbindkeysrc')
  6. Modify as seen in the configuration files section
  7. Run 'xbindkeys -n -v' (not as daemon, verbose) to test the configuration
  8. Once the configuration is how you want it, add xbindkeys to the startup of KDE by running 'sudo cp /usr/bin/xbindkeys /home/matt/.kde/Autostart/' in terminal
  9. Upon restart, the configuration should automatically take effect
  10. I often have to click the middle mouse button while in the OnScreen orbiter to get them to start responding, for some reason

Bluetooth Proximity Control

  • Using the bluetooth signal from a phone or some other device that you routinely carry in your pocket, the computer can automatically detect when you enter and leave the room (or at least the general vicinity)
  • This method isn't so good when multiple Media Directors are being used, because bluetooth can only connect and monitor signal strength between one pair at a time
  1. Upon insertion of the bluetooth dongle, MCE should automatically recognize it and set bluetooth up for you
  2. After this, it may ask to reload, regen, etc
  3. If any bluetooth devices are in the area and visible, MCE will ask you if you want to use them, etc
  4. My phone is not supported as a mobile orbiter, so I clicked "do not use"
  5. Once all that is done and the dongle is setup, go to the KDE desktop
  6. Web Admin > Wizard > Devices > Security
  7. Click "Add Device"
  8. Under Device Template, select "Generic Sensor" and click "Pick Device Template"
  9. Select "Bedroom(Master)" from the drop down menu on the left
  10. Click Update at the bottom
  11. Make note of the device number at the top left corner
  12. In terminal run 'sudo apt-get install blueproximity'
  13. Run BlueProximity by going to K menu > Applications > Utilities > BlueProximity
  14. Right click the BlueProximity icon (bluetooth icon with key) and click preferences
  15. Put your bluetooth phone or device in discoverable/visible mode (See device's documentation)
  16. Click on "Scan for Devices"
  17. When it has finished scanning, click the desired device and then "Use Selected Device"
  18. A pairing request should then appear on the phone, accept it and enter a passkey
  19. Enter that same pass key on the computer when it asks
  20. If your phone gives the option, choose "Always Connect" (This will automatically connect the phone and media center when they are in range of each other)
  21. The sliders in the "Proximity Details" tab can be adjusted to the proper settings for being outside the room (Locking) and inside the room (Unlocking)...this takes some trial and error to get the right setting, but be patient and it will work
  22. In the "Locking" tab, replace the "Locking command" with "/usr/pluto/bin/MessageSend localhost 62 -1000 2 9 25 0" replacing 62 with the device code of the generic sensor you created
  23. Replace the "Unlocking command" with "/usr/pluto/bin/MessageSend localhost 62 -1000 2 9 25 1" again replacing 62 with the device code of the generic sensor
  24. Erase the "Proximity Command"
  25. The generic sensor will now be tripped when the phone is in range, and untripped when it is out of range
  26. Web Admin > Events Handler > Respond to Events
  27. Set the description to "Bluetooth enters room"
  28. Choose "A sensor is Tripped" in the drop down menu
  29. Click Add
  30. Set what device to "= Generic Sensor"
  31. Set trigger state to "tripped = 1"
  32. Click update
  33. Choose "Lighting Wizard" from the drop down and select the lights you would like to turn on/off/set level/leave unchanged when you enter the room
  34. Repeat the last 8 steps, with the description "Bluetooth leaves room" and the trigger state "tripped = 0" for the lights you want to turn on/off, etc when you leave the room
  35. After a reload router/orbiter regen...and possibly a full reboot...you should have proximity set up for you to leave the room and come back in
  36. Fine tune the sliders in BlueProximity to avoid lights turning off unintentionally

Webcams and Skype

Ok, this ended up being obnoxious, and I got information from all over...so here is what SHOULD work...but I am typing this after the fact

  • There is some information on getting the NX-6000 working with gstfakevideo...but this doesn't seem to be necessary and I had better luck with the other method of pre-loading "v4l1compat.so"
  • I have 2 webcams, one is an ezonics ezcam that will be used as just a security camera later...the other is the Microsoft NX-6000 which I use only for skype

Basic webcam preparation

  1. 'lsusb' should show both cameras
  2. 'ls /dev/vid*' should show video0 and video1
  3. Make note of the vendor and product ID of the NZ-6000 (045e:00f8)
  4. 'sudo kate /etc/udev/rules.d/95-webcam.rules'
  5. Enter the information in the configuration files section making sure to replace the vendor and product id with those from the lsusb
  6. 'sudo /etc/init.d/udev restart'
  7. 'ls /dev/vid*' should now show video0 and video5(because of the previous configuration, video0 is the EZCam and video5 is the NX-6000)
  8. Before going crazy, go into the user manager (K menu > applications > system > User manager), find your user name (matt in my case) and add it to the "audio" and "video" groups...a reboot will be needed to put this into effect, but it can wait until after the driver update

Install the newest UVC drivers

  1. 'mkdir ~/UVC'
  2. 'cd ~/UVC'
  3. 'wget http://linuxtv.org/hg/~pinchartl/uvcvideo/archive/tip.tar.bz2'
  4. 'tar -xzvf tip.tar.gz'
  5. 'cd uvcvideo...' there is a string of numbers after uvcvideo, use tab completion
  6. 'make'
  7. 'sudo make install'
  8. 'sudo depmod -a'
  9. 'sudo modprobe uvcvideo'
  10. 'sudo reboot' to make sure everything takes effect (including the group changes made in the previous subsection)

Test out the NX-6000

  1. 'sudo apt-get install luvcview'
  2. 'lucview -d /dev/video5' That should bring up the NX-6000 based on the setup done earlier

Enable the v4l1compat preload

  1. 'sudo mv /usr/bin/skype /usr/bin/skype.real'
  2. 'sudo kate /usr/bin/skype'
  3. Insert the code in the configuration files section
  4. Save
  5. 'sudo chmod 755 /usr/bin/skype'

Fix Skype

  1. Run Skype (K menu > applications > internet > Skype)
  2. Try to log in
  3. If this throws an the error "Another Skype instance may exist", run 'sudo chown -R matt.matt ~/.Skype/' replacing matt.matt with your username.username
  4. Go into the video options (S > options > video devices and try to test video5 (the NX-6000)
  5. If this crashes Skype, start it again, and try to make a video call...sometimes the test doesnt work, but video calls work fine

Set the Skype options

  • Once Skype is working and tested, it should be set to startup on boot, log in, and then act a certain way
  1. Check the box that says "Sign me in when Skype starts" on the login screen and log in
  2. Go into S Menu > Options
  3. Click the "Start a Call" bubble in the General section
  4. Make sure the "Start Skype minimized to the system tray" box is UNCHECKED
  5. In the Privacy section, check the "Automatically answer incoming calls"
  6. In the Sound Devices section, make sure all devices correctly work by making selections and Making a test call
  7. Uncheck the "Allow Skype to automatically adjust my mixer levels" box in the Sound Devices section
  8. In the Video Devices section, make sure the top two boxes are checked
  9. Also in the Video Devices section, choose video5 from the dropdown menu and check the "anybody" bubble
  10. Click Apply at the bottom then click close
  11. Quit Skype (S Menu > quit) and then Restart it to make sure the settings were all saved
  12. For some reason I was having troubles saving files, until I set them one by one, applying and restarting skype after each
  13. Once all those are set and good, have someone call you and give it all a test (it should automatically answer and bring up their video without you pressing anything)
  14. 'sudo cp /usr/bin/skype ~/.kde/Autostart/skype' should make skype start on boot

Set things to work right with MCE

  • With this setup, Skype audio seems to be overpowered by any media playing in MCE, this should even that out
  • This should also make the call window remain visible in the OnScreen orbiter instead of disappearing when anything is clicked (Allowing a change in music, etc without interrupting the call)


Configuration Files

/etc/init.d/linuxmce

  • I don't know if the specific placement of this line really matters, but this worked for me
StartService "Setting SSH Keys" "/usr/pluto/bin/SSH_Keys.sh" "&"
StartService "Setting Coredump Location" "/usr/pluto/bin/corefile.sh"
StartService "Creating Firewire 2 Video4Linux Pipes" "/usr/pluto/bin/Firewire2Video4Linux.sh"
StartService "Configuring Pluto Storage Devices" "/usr/pluto/bin/StorageDevices_Setup.sh"
/etc/init.d/samba start
StartService "Detecting Timezone" "/usr/pluto/bin/Timezone_Detect.sh" "&"
StartService "Status Radar" "/usr/pluto/bin/StorageDevices_StatusRadar.sh"
StartService "Samba Radar" "/usr/pluto/bin/StorageDevices_SambaRadar.sh"
StartService "PVR-250 tuner restore" "/usr/pluto/bin/CaptureCards_BootConfig_PVR-250.sh"
StartService "KDE Desktop" "/usr/pluto/bin/Start_KDE.sh"
## Setup ALSA mixers
...


/etc/network/interfaces

  • (the eth0 configuration should be set according to the network the media center is connected to)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
   address 192.168.200.42
   netmask 255.255.255.0
   gateway 192.168.200.1
auto eth0:1
iface eth0:1 inet static
   address 192.168.80.1
   netmask 255.255.255.0

~/Desktop/Activate-Orbiter.sh

  • Change "21" to the device number of your OnScreen orbiter
  • This can be found by going to Web Admin > Show Devices Tree > Core > The core/hybrid, click on OnScreen Orbiter and look in the black box at the top left of the information displayed
#!/bin/bash
/usr/pluto/bin/MessageSend localhost 0 21 1 912 119 "0"

~/.kde/Autostart/Set-Volume.sh

#!/bin/sh
amixer sset Front 100% unmute
amixer sset Surround 100% unmute
amixer sset Center 100% unmute
amixer sset LFE 100% unmute
amixer sset 'Front Mic Boost' 100% unmute
amixer sset 'Front Mic' 100% unmute
amixer sset 'Input Source' 'Front Mic'
amixer sset 'Capture' 100% unmute

/etc/X11/xorg.conf

  • Options may very depending on your setup and mouse, this is the config for my setup
  • The protocol ExplorerPS/2 seems to have the best luck, but auto may work as well
...
Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "ExplorerPS/2"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
    Option         "Buttons" "7"
    Option         "ButtonMapping" "1 2 3 6 7"
EndSection
   ...

~/.xbindkeysrc

  • b:# is the mouse button, modify according to the functions you want
  • use 'xev' to determine the mouse button numbers
  • use 'xbindkeys -k' to determine keyboard button codes (they are case-sensitive)
"xte 'keydown F7' &"
  b:2
"xte 'keyup F7' &"
  b:2+release
"xte 'keydown Prior' &"
  b:4
"xte 'keyup Prior' &"
  b:4+release
"xte 'keydown Next' &"
  b:5
"xte 'keyup Next' &"
  b:5+release
"xte 'keydown F6' &"
  b:6
"xte 'keyup F6' &"
  b:6+release
"xte 'keydown F8' &"
  b:7
"xte 'keyup F8' &"
  b:7+release

/etc/udev/rules.d/95-webcam.rules

  • Modify the vendor and product ID to match that of your camera
KERNEL=="video*", SYSFS{idVendor}=="045e", SYSFS{idProduct}=="00f8", NAME="video5"

/usr/bin/skype

#!/bin/sh
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype.real