[mythtv-users] USB Soundcard, Tinny on just some media

Rod Smith mythtv at rodsbooks.com
Mon Dec 15 22:40:41 UTC 2008


On Monday 15 December 2008 04:54:43 pm Mark wrote:
> Hello,
> I have not been able to find anything in the archives on this.
>
> USB soundcard give occasional tinny sound.
>
> Fedora 10, HD-PVR, Trunk. Pulse Audio.
> I am using an external Creative USB sound card. (
> http://sg.creative.com/products/product.asp?category=209&subcategory=668&pr
>oduct=15913 )
>
> When I use the build in sound on the MB ( Intel HD ) all is well, though
> the volume is rather low even when maxed.
> The USB sound is excellent on some media ( some mpg and avi ) but on
> most it is tinny sounding.  All of the HD-PVR recordings give this tinny
> sound.

It could be that your USB sound "card" is capable of playing back sounds 
recorded at certain sample rates (such as 48Kbps) but not at others (such as 
44.1Kbps). (Note that I'm talking about the sample rate, which is distinct 
from the bitrate.) I suggest you try identifying the recording sample rate 
(and other audio recording details, such as the codec used) for a sampling of 
both good and bad files and look for a correlation. The midentify script, 
which is installed on some systems but not others, will do this:

$ midentify 4061_20081212205800.mpg
ID_VIDEO_ID=0
ID_AUDIO_ID=0
ID_FILENAME=4061_20081212205800.mpg
ID_DEMUXER=mpegps
ID_VIDEO_FORMAT=0x10000002
ID_VIDEO_BITRATE=8000000
ID_VIDEO_WIDTH=720
ID_VIDEO_HEIGHT=480
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=80
ID_LENGTH=2580.58
ID_VIDEO_CODEC=mpegpes
ID_AUDIO_BITRATE=384000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=mad

Note the ID_AUDIO_RATE value, which is "48000" above. It's conceivable that 
the audio codec or other factors, such as the number of channels (which 
midentify seems to get wrong when there are other than two channels, at least 
for me) could be the culprit, so I recommend you take notes on anything with 
AUDIO in the identifying name.

In case your system doesn't have midentify, here it is:

------------- begin midentify ----------
#!/bin/sh
#
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer at tdiedrich.de>
# Licensed under GNU GPL.

if [ -z "$1" ]; then
        echo "Usage: midentify <file> [<file> ...]"
	exit 1
fi

mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
        sed -ne '/^ID_/ {
	                  s/[]()|&;<>'"'"'\\!$" []/\\&/g;p
		         }'
------------- end midentify ----------

If this hypothesis is correct, you may be able to adjust the audio sample rate 
for analog encoding cards. The audio sample rate in digital TV signals is 
harder to change, though; you'd need to transcode, or at least write a custom 
script that demuxes the audio and video, re-encodes the audio, and remuxes it 
back together again. Likewise for files obtained from the Internet or other 
sources. In the long run it'd be easier to replace the USB sound "card," or 
at least upgrade its drivers (if such an upgrade is available), if you need 
to play many such files.

Of course, my hypothesis may be wrong, in which case adjusting the recording 
sample rate may not do any good.

-- 
Rod Smith


More information about the mythtv-users mailing list