...making Linux just a little more fun!

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Knowledge Base

The Answer Gang

By Jim Dennis, Jason Creighton, Chris G, Karl-Heinz, and... (meet the Gang) ... the Editors of Linux Gazette... and You!



(?) Sound disappearing with KDE upgrade

From Mike Orr

Answered By: Jimmy O'Regan, Karl-Heinz Herrmann, Ben Okopnik

I upgraded to KDE 3.4 from 3.3 and went through a ritual that's unfortunately too familiar: figuring out why my sound disappeared.

The first indication was an error message from my CD player: "Unable to open cdrom device /dev/cdrom".

$ ls -l /dev/cdrom
lrwxrwxrwx  1 root root 3 Aug 15 06:00 /dev/cdrom -> hdc
$ ls -l /dev/hdc
brw-rw----  1 root audio 22, 0 Jul 15  2004 /dev/hdc
$ groups
wheel floppy audio cdrom dialout cdrw users portage rex
$ su -c 'chgrp audio /dev/hdc'
Password:
$ ls -l /dev/hdc
brw-rw----  1 root audio 22, 0 Jul 15  2004 /dev/hdc

Now my CD program would start but was silent. There was a slash over the speaker icon in the system tray. Having had problems with mute before, I clicked that to open KMix. There were more items under the 'Output' and 'Input' tabs than previously, and I quickly saw the "Output: Master" and "Input: CD", but where was the output for /dev/dsp, and is that the same thing as "Output: PCM"? I knew the buttons above or below the sliders were 'mute', but which position is muted? I fiddled around to what I thought was right but not a peep from the computer, so I put on a record instead and went to sleep.

As always, things seem clearer after a good sleep. I checked the permissions of /dev/dsp, which was symlinked to /dev/sound/dsp. It already had write permission for group 'audio', of which I was a member, so I went hunting further. The speaker still had a slash, so I single-clicked it and saw a 'Mute' item, which was checked. I unchecked it and the 'Ouput: Master' button in KMix went from dark to light. Aha, that's the unmuted position.

I tried playing a CD again but the permission problem had returned. I chgrp'd it and looked through the logs for some message about what it's doing now, or what it had been doing before the upgrade that it isn't doing now, but nothing.

I picked a show on the To The Point (http://kcrw.org/show/tp) webpage (RealAudio) and it played OK. (The main thing I listen to is time-shifted NPR programs. TiVo for radio, I guess. It's frustrating when you wake up late Saturday morning and can't listen to Weekend Edition or Car Talk (http://www.cartalk.com). Then you remember, "Oh yeah, people used to have to listen to programs when they were broadcast....")

Anyway, back to the silent CD player. Its volume control and 'mute' button did nothing, so I perused KMix again. 'Input: CD' had the green and red buttons both dark, so I clicked the green button and Badorb's "'Ow Much?" played on top of top of Warren Olney. (The show was called "Googled! Will the Internet Come Back to Haunt You?", about how Google's CEO didn't like having his personal information published after a reporter, er, googled it. Oops.")

So everything is resolved now except the wandering groupness of /dev/hdc. Since it's Gentoo I'll have to check whether devfs is operating and whether it's restoring permissions from a tarball. Hmm, what all did KDE upgrade with itself? /var/log/emerge.log shows arts, pam, kdebasepam, gstreamer, gst* as potential culprits. And cdparanoia. Probably not, but I like the thought of blaming things on cdparanoia. (To make emerge.log more readable I wrote a Python program that converts tick dates to ISO format.)

See attached format_emerge_log.py.txt

Well. everything is resolved except that TkMan's font is unreadable. So much for "New Century Schoolbook". I tried "Helvetica - medium - normal" and the results look, well, vaguely like Hebrew.

See attached tkman.png

Well, and the fact that Konqueror lost my bookmarks. Not only that, they reverted to a configuration not seen since before my Firefox import. That was easily fixed with "Bookmarks -> Edit Bookmarks -> File -> Import -> Import Mozilla Bookmarks".

Anyone know how to tame Firefox into playing this sound link? http://www.npr.org/templates/story/story.php?storyId=4800040 ("No Static at All: Hi-Tech Radio") It's got some Javascript function to choose the file that seems to be too much for Firefox.

(!) [Jimmy] Whenever I came across a site like that, I normally tried to pick apart the javascript to find the actual URL, and just grabbed that.

(?) Yes. It's finding and deciphering the Javascript function that stumped me.

(!) [Jimmy] Oh. It's in http://www.npr.org/include/javascript/jsfuncs.js
It's called with "javascript:getMedia('ME', '15-Aug-2005', '8', 'RM,WM');", so assuming you want the Real Media version, the URL should be:
http://www.npr.org/dmg/dmg.php?prgCode=ME&showDate=15-Aug-2005&segNum=8&mediaPref=RM
(!) [Jimmy] I used to have a few shell functions for different sites that amounted to "wget http://some.site/foo/bar?baz=$1"
(!) [Karl-Heinz] I'm regularly recording radio shows, musik programs etc. from two German stations which also broadcast mp3. I'm also using wget, but wanted it to record a specified time and then terminate. Also I had to check if the wget actually is running, because for weekly crime radio show (I still don't know a good translation for Hrspiel, like a book reading but with different actors) the first trys to get a connection sometimes failed.
It's probably still quite clumsy, but it the best way I found to get the pid of the wget from the starting script. I usually run it with at and get an E-mail with the messages.

See attached radiograb.sh.txt

(!) [Ben] Just FYI: the PID of the last backgrounded process you've launched is contained in "$!" - at least under any "sh"-derived shell.
ben@Fenrir:~$ date & echo $!
Sat Aug 27 14:54:05 EDT 2005
[1] 6152
6152
[1]   Done                    date
ben@Fenrir:~$
Any synchronous processes launched after that don't affect the value in "$!"; it has to be an asynch process.
ben@Fenrir:~$ date; echo $!
Sat Aug 27 14:55:57 EDT 2005
6152
ben@Fenrir:~$

(?) I'm thinking about making a cron job that pulls the web pages of my half-dozen favorite radio shows and makes a menu of the latest ones, so I can just choose an interesting-sounding title and play it. Some of the sites have RSS feeds, so that'll make it easier.

(!) [Jimmy] Sometimes you need to set a referer, sometimes you need to masquerade as another browser, but it's quicker than browsing most of those sites.

(?) On a good note, Firefox can now play the BBC's embedded radio player. http://www.bbc.co.uk/radio/aod/mainframe.shtml?http://www.bbc.co.uk/radio/aod/index.shtml

(!) [Jimmy] I used to use MPlayer's 'dumpstream' option to listen to the book readings on BBC4 (usually whenever they had pTerry readings) because streaming audio annoys the crap out of me.

This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


Each TAG thread Copyright © its authors, 2005

Published in issue 118 of Linux Gazette September 2005

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Knowledge Base
Tux