Posts tagged ·



fix digital optical (SPDIF) output in Ubuntu Raring Ringtail


I recently upgraded my HTPC from Ubuntu 12.04 to 13.04, and I was a bit miffed to find digital optical (which I use to send to my home speakers) was no longer working.
I search around without much luck, finding solutions that involved driver tweaks and such. In my case, none of that applied, as my Intel sound device was correctly detected and working in every other way. Ubuntu’s sound controls even showed the optical S/PDIF as present, and unmuted.

Eventually, I stumbled across this bug:

It turns out, all you need to do is start up alsamixer:

Then unmute S/PDIF 1 (arrow over to select it, then hit the ‘m’ key. You should see the ‘mm’ at the bottom replaced by ’00’).

It looks like the default for this channel on Intel devices was set to muted in recent versions of Ubuntu, probably because so few people use it and were scared by a little red light coming out of their machines. Unfortunately, the alsamixer mute isn’t exposed by the Pulse Audio sound controls in Ubuntu, so you’ve got to re-enable it this way for now.

better, simpler searching and scripting with bash globstar

no comments

Do you use bash 4.0 or newer?  (You probably do.  Type ‘bash –version’ in your terminal to find out).

If so, you could be living a better life.

Globstar is a feature not typically enabled, but present in bash 4+, and it allows you to do more easily select files in bash, using a double star **.

For example, if you want to every .text file, in all subdirectories, you no longer even need to use the find command.

ls **/*.text

The ** here will traverse any number of directories, not just the current directory.  Here’s another very useful, easy to remember example.  Ever want to find a line of text somewhere in a huge pile of files, but you know some part of the file name?  You can do a recursive grep to easily find it, without some abstruse find command.

grep -r needle **/*haystack*

To begin using globstar, you need to enable it.  It should be the default, if you ask me, but enabling is simple.  From the terminal, type:

shopt -s globstar

You’ll probably want to add that line to your ~/.bashrc file, too, so it’s enabled every time you open a terminal or login.

Happy Globbing!