Audio and video questions

Russell Bateman
March 2014
last update:

Audacious audio—listening to music on Linux

I'm running Mint 13 LTS (Ubuntu 12.04 LTS) on a Lenovo ThinkPad with 4 Gb of memory and 240Gb SSD drive.

Of all the audio players I've tried, Audacious is a) the one that actually works and b) close to the behavior of (and even better than) WinAmp. I don't care about skins (and WinAmp had a lot of great skins), but I love the playlist functionality of Audacious which is even more straight-forward than WinAmp. Audacious offers a more natural interface than Banshee, Rhythmbox, or the M Players (GNOME MPlayer, plain old mplayer, etc.).

$ sudo apt-get install audacious

(Note: if on Fedora, yum install audacious will leave you missing very important plug-ins such as for MP3. Use also yum install audacious-plugins-freeworld.)

I got myself into a situation where Audacious Player audio no longer worked. I was able to hear output from jt.france2.fr on-line journals after unplugging my headphones (so, the sound coming from notebook speakers), but not Audacious, which had been working.

Video difficulties

This possibly happened after having trouble removing my notebook computer from its dock to use with a projector. I had various problems with monitor settings that I ultimately had to resolve by only using the following procedure:

  1. Determine that I need to go remote with my notebook.
  2. Close up all browsers windows carefully to ensure that when reopened, I get the content (pages) I want.
  3. Close up all other applications.
  4. Shut down Mint.
  5. Remove from dock, then use remotely as desired. It starts on notebook monitor, with projector, etc.
  6. Shut down when ready to return to office and dock.
  7. Reinsert into dock and start normally. Big monitors will work.

Note that I use ThinkPad notebook at work with two Hewlett-Packard 24" (1920×1200) monitors run from a simple dock. I need to take it remote to conference rooms and other settings, mostly for doing code reviews. I've never liked doing this because of the mess I'm left with having to switch from the notebook monitor/projector back to my dual monitor set-up.

Audio continued...

The symptoms were basically that my wireless headphones would not work.

I Googled around; there wasn't much. Questions on Audacious no longer outputing sound were few and successes were not much explained, but this link made a cryptic reference to something called pavucontrol. I did this:

~ $ pavucontrol
The program 'pavucontrol' is currently not installed.  You can install it by typing:
sudo apt-get install pavucontrol
~ $ sudo apt-get install pavucontrol
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  pavucontrol
0 upgraded, 1 newly installed, 0 to remove and 31 not upgraded.
...
~ $ which pavucontrol
/usr/bin/pavucontrol
~ $ pavucontrol &

Running pavucontrol, I saw this:

I looked around through all the tabs and options, but in the end audio began working again when I changed the Audacious control from "High Definition Audio Controller Digital Stereo (HDMI)" to "Built-in Audio Analog Stereo" as shown here:

pavucontrol settings

pavucontrol installs in whatever language is current (Cinnamon). If you were playing with languages and don't like the one it was installed with, uninstall, then reinstall it.

Here are pictures of my settings while working:


Translating WMA to MP3...

I found a blog post detailing how to convert Windows Media files (WMA) to MP3. I have an audio book of Tolkien's Silmarillion and I haven't been able to listen to it in my car. Here's a script—the for loops of which I mostly plagierized directly from that post. You need mplayer and lame on your host.

wma2mp3.sh:
#!/bin/bash
# Verify that mplayer and lame are there...
exists=`which mplayer`
if [ $? -ne 0 ]; then
  echo "mplayer is not found on this system!"
  exit -1
fi
exists=`which lame`
if [ $? -ne 0 ]; then
  echo "lame is not found on this system!"
  exit -1
fi

current_directory=$(pwd)

# Remove spaces from filenames to make this easier...
for i in *.wma; do
  mv "$i" `echo $i | tr ' ' '_'`
done

# Rip with mplayer, encode with lame...
for i in *.wma ; do
  mplayer -vo null              \
        -vc dummy             \
        -af resample=44100    \
        -ao pcm:waveheader $i \
        && lame -m s audiodump.wav -o $i
done

# Convert file names to .mp3...
for i in *.wma; do
  mv "$i" "`basename "$i" .wma`.mp3"
done

# Add spaces back into original names (if there were spaces)...
for i in *.mp3; do
  mv "$i" "`echo "$i" | tr '_' ' '`"
done

rm audiodump.wav

It runs like this:

~/Music/J.R.R. Tolkien/Silmarillion.MP3 $ wma2mp3.sh
LAME 3.99.3 64bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding audiodump.wav to Silmarillion_V1D1-01-Ainulindalë_1.wma
Encoding as 44.1 kHz stereo MPEG-1 Layer III (11x) 128 kbps qval=3
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 11717/11717 (100%)|    0:08/    0:08|    0:08/    0:08|   35.222x|    0:00
-----------------------------------------------------------------------------------------------------------
   kbps        LR  %     long switch short %
  128.0      100.0        92.2   4.1   3.7
Writing LAME Tag...done
ReplayGain: 0.0dB
MPlayer2 UNKNOWN (C) 2000-2011 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Silmarillion_V1D1-02-Ainulindalë_2.wma.
Detected file format: ASF format (libavformat)
[lavf] stream 0: audio (wmav2), -aid 0, -alang eng
Clip info:
 WMFSDKVersion: 9.00.00.2980
 WMFSDKNeeded: 0.0.0.0000
 IsVBR: 0
 album: Silmarillion V1D1
 WM/Year: 1977
 genre: Book
 track: 2
 WM/AlbumCoverURL: http://www.albumcoverurl.com
 WM/MCDI: 10+96+5A38+A5F6+F0F0+14C7D+1A19A+1F9D5+217B7+27012+2C40C+32E23+37502+3B171+40F87+464BA+4B0B0+4E6C7
 title: Ainulindalë 2
 artist: J.R.R. Tolkien
Load subtitles in .
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 64.0 kbit/4.54% (ratio: 8000->176400)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
[AO PCM] File: audiodump.wav (WAVE)
PCM: Samplerate: 44100 Hz   Channels: 2   Format: s16le
[AO PCM] Info: Faster dumping is achieved with -novideo
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 258.6 (04:18.5) of 258.5 (04:18.5)  0.1%


Exiting... (End of file)

Televisions: Refresh at 120Hz versus 60Hz...

A question on refresh speed. My nephew can be thanked for this answer.

"I've been operating under the possibly mistaken assumption that higher rates of screen refresh are crucial for:

  • video game use (not a personal concern)
  • fast-action movies (very much a concern)
  • Blu-ray movies (whether action or not)

"I have considered then that 120Hz is the minimum acceptable rate for large-screen televisions, but that rate is never/rarely seen on smaller screens (under about 46").

"What can you tell me about this? For example, what am I losing watching Blu-ray on 19" 60Hz LEDs vs. my 47" 120Hz LED? If I bought a mid-sized unit, is that still going to be the same experience as on my 19" TVs?"

Answer

"The 120 Hz refresh rate is most often taken advantage of by Blu-ray action movies. It provides a smoother experience and is often seen by most people to be slightly nicer on the eyes when staring at the screen for long periods of time. I admit I can tell a difference between the two, but I will also admit it is very minute. I have a 60Hz 40" Samsung and it works beautifully. The 120Hz refresh rate is more of a luxury than any kind of necessity. You probably won't notice much of a difference. It might as be interesting to note that 240Hz is often seen as too high giving a "fake" look to the video.

"If you're willing to spend the extra money and get a really nice TV, I would recommend 120Hz, but 60Hz on a 40" TV should be fine. I doubt you'd notice much difference by going to 120Hz.

"Most TVs are only 120Hz at higher screen size because the manufacturer think that if a consumer is going to spend the money to get something that big, he probably doesn't mind spending the money to get a higher refresh rate. At smaller than 48", the cost-to-who-cares ratio is too low to make it worth making a 120Hz screen."


What is the "digital copy" disk on the DVD set?

A question about DVD/Blu-ray packaging answered by my nephew.

"What is the 'digital copy' disk on the DVD set of, for exmaple, Narnia: The Voyage of the Dawn Treader'? In this set, there are two disks, the DVD and this second disk I've never paid attention to.

"Should this disk simply contain what I would otherwise be ripping using Handbrake?"

Answer

"The set contains a file, probably in .m4a or .wmv format, and of the movie in DVD quality. Theoretically, you can stick it in your computer and have an instant digital copy of the movie. In reality, the file requires you to sign in, sign up, sign away your firstborn, and then it'll let you download the file—a file with so much DRM on it that almost nothing on this planet can play it.

"It's not really worth trying to get their files to work. It's better just to rip it yourself from the original DVD. I suppose you could use a program in Linux to remove the DRM. That is possible, and I know it works for music (transferring iTunes files over to other players once required a Linux method that stripped out the DRM so the music could be played.)

"You can always try throwing the disc into your drive and see what they have to offer, but I've never had a good experience with those digital copies."


Microphone on Cinnamon

See Microphone on Cinnamon.