Difference between revisions of "Linux Media"

From JimboWiki
Jump to: navigation, search
 
Line 4: Line 4:
 
==Audio==
 
==Audio==
 
===Important ALSA Commands===
 
===Important ALSA Commands===
I use ALSA for sound, and so do most people, so here's some important commands that will help get you going with ALSA:
+
I use [http://www.alsa-project.org/ ALSA] for sound, and so do most people, so here's some important commands that will help get you going with ALSA:
 
*alsamixer - a console mixer for all devices
 
*alsamixer - a console mixer for all devices
 
*alsamixergui - GUI version of alsamixer
 
*alsamixergui - GUI version of alsamixer
Line 12: Line 12:
  
 
===Digital Sound===
 
===Digital Sound===
It's possible to have digital sound pass through the system directly to your receiver in AC3 or DTS format.  To do this, you must: *have the proper cabling (digital coax, fiber optics, digital DIN)
+
It's possible to have digital sound pass through the system directly to your receiver in AC3 or DTS format.  To do this, you must:
*have the proper sound card (has a digital connector and is NOT a USB device)
+
*have the proper cabling (digital coax, fiber optics, digital DIN)
 +
*have the proper sound card, which has a digital output connector and is NOT a USB device. (See the [http://www.alsa-project.org/main/index.php/Matrix:Main ALSA sound card compatibility matrix] for more information.)
 
*have a receiver with a digital decoder built in
 
*have a receiver with a digital decoder built in
*have a digital source.  Digital sources include, but are not limited to, DVDs and AVIs with a52 audio streams (like what is created by MythTV if you rip a DVD).
+
*have a digital source.  Digital sources include (but are not limited to) DVDs, AC3 audio tracks, and AVIs with a52 audio streams (like what is created by MythTV if you rip a DVD).
  
 
To get digital audio pass-through to work, there are several things that need to be done:
 
To get digital audio pass-through to work, there are several things that need to be done:
 
*Get ALSA up and running - hopefully this is the default for your distribution
 
*Get ALSA up and running - hopefully this is the default for your distribution
*Cable things properly - self explainitory...
+
*Cable things properly - self explanatory...
 
*Configure the ALSA Mixer (if needed)
 
*Configure the ALSA Mixer (if needed)
 
**The ALSA mixer does not only include volumes - it also has control switches for sound card features
 
**The ALSA mixer does not only include volumes - it also has control switches for sound card features
Line 31: Line 32:
 
***Digital DIN will automatically switch between digital (AC3/DTS) signals and analog signals without reconfiguration of the receiver or ALSA output settings
 
***Digital DIN will automatically switch between digital (AC3/DTS) signals and analog signals without reconfiguration of the receiver or ALSA output settings
 
*Configure your media player
 
*Configure your media player
**mplayer
+
**[http://www.mplayerhq.hu/ mplayer]
 
***add the following command line argument to enable AC3 pass through: -ac hwac3,a52,
 
***add the following command line argument to enable AC3 pass through: -ac hwac3,a52,
 
***This will tell mplayer to:
 
***This will tell mplayer to:
Line 57: Line 58:
 
===Important Files===
 
===Important Files===
 
*~/.lircrc
 
*~/.lircrc
**try this crazy thing: http://lircconfig.commandir.com/
 
 
*lircd.conf
 
*lircd.conf
 +
*try this crazy thing: http://lircconfig.commandir.com/
  
 
===Troubleshooting===
 
===Troubleshooting===
 
mode2
 
mode2
 +
irw
 
lircd -n
 
lircd -n

Revision as of 17:08, 24 August 2007

This is not meant to be a complete walk-through for anything - there's plenty of those and software changes way too fast for me to keep up. Here you will find a simple summary of some important items to know about when setting up high-grade home media stuff in Linux.

MythTV

If you're building a home media server, you're going to want to look at MythTV. It's pretty sweet and is fairly easy to set up. One of the most commonly referenced set up guides is Jarod's Guide, which is usually up to date, and seems to cover most of the important setup work to get you going.

Audio

Important ALSA Commands

I use ALSA for sound, and so do most people, so here's some important commands that will help get you going with ALSA:

  • alsamixer - a console mixer for all devices
  • alsamixergui - GUI version of alsamixer
  • alsactl - learn about installed ALSA devices
  • aplay - play waves and whatnot
  • cat /proc/asound/devices - list all ALSA devices and see what they are for

Digital Sound

It's possible to have digital sound pass through the system directly to your receiver in AC3 or DTS format. To do this, you must:

  • have the proper cabling (digital coax, fiber optics, digital DIN)
  • have the proper sound card, which has a digital output connector and is NOT a USB device. (See the ALSA sound card compatibility matrix for more information.)
  • have a receiver with a digital decoder built in
  • have a digital source. Digital sources include (but are not limited to) DVDs, AC3 audio tracks, and AVIs with a52 audio streams (like what is created by MythTV if you rip a DVD).

To get digital audio pass-through to work, there are several things that need to be done:

  • Get ALSA up and running - hopefully this is the default for your distribution
  • Cable things properly - self explanatory...
  • Configure the ALSA Mixer (if needed)
    • The ALSA mixer does not only include volumes - it also has control switches for sound card features
    • One such feature is often a digital/analog switch, or a power switch for optical output
    • Look on forums with your specific card and ALSA version for proper mixer settings if you have trouble or weird noises
    • For Sound Blaster owners looking to use the "Digital DIN" output (like me):
      • Set "IEC985 Optical" to mute (off)
      • Set "IEC958 Optical Raw" to mute (off)
      • Set the "Analog/Digital output jack" to unmute (on)
      • You may notice 2 sets of surround volume controls - one controls volumes of digital signals, the other controls analog signals
      • Digital DIN will automatically switch between digital (AC3/DTS) signals and analog signals without reconfiguration of the receiver or ALSA output settings
  • Configure your media player
    • mplayer
      • add the following command line argument to enable AC3 pass through: -ac hwac3,a52,
      • This will tell mplayer to:
        • hwac3 - first try to output an AC3 stream (try hwdts for DTS streams)
        • a52 - if that doesn't work (i.e. hardware problem or bad stream) then try decoding the AC3 stream using a52 codec
        • trailing comma - if that doesn't work (i.e. no AC3 stream found) fall back onto regular codecs
      • Some other command line arguments that may be interesting to you:
        • -a52drc 0 - turn off volume leveling (it is on by default)
        • -af-adv force=5 - attempt to use floating point precision when applying filters
        • There's a small encyclopedia worth of additional arguments in the mplayer man page.
    • MythTV
      • There is an option for AC3 pass through under Utilities/Setup --> Setup --> General -> 3rd or so page. I have not seen this work for videos, and I don't have any other digital signals right now.
      • Instead, I just added the mplayer arguments under Utilities/Setup --> Setup --> Media Settings --> Video Settings --> Player Settings

Remote Control (LIRC)

You can probably [www.google.com Google] up an install guide for your particular distribution without much effort.

Important Commands

Here's a quick summary of important commands. Look at their man pages for more detailed information on how to use them.

  • mode2 - Shows raw IR signals that the IR Receiver is seeing. This is useful to check to see if you're getting signals into the computer.
  • irrecord - Remote Recorder. Records the signals a remote sends and maps those raw signals to useful names, then creates a file properly formatted to be used as an lircd.conf file.
  • irw - Remote decoder. Shows the button names the IR Receiver is seeing. This is useful to check a newly configured remote control
  • lircd -n - LIRC Daemon, foreground. This runs the LIRC Daemon without forking off to the background, so you can see all the console messages. This is useful for figuring out why lircd keeps crashing.


Important Files

Troubleshooting

mode2 irw lircd -n