[pvrusb2] pvrusb2-mci-20070114 radio support - stereo?

Rick Macdonald rickm at timshel.ca
Thu Jan 18 23:39:07 CST 2007


Mike Isely wrote:
> On Thu, 18 Jan 2007, Rick Macdonald wrote:
>
>   
>> (This is a resend of an email I sent directory to Mike - sorry, I wasn't 
>> thinking and should have sent it to the list.)
>>
>> I'm writing to ask if pvrusb2-mci-20070114 supports stereo FM.
>> I tried to make this short, but...
>>
>> Two years ago I bought a PVR USB2, really just wanting FM stereo radio.
>> I _believe_ the unit is stereo but I guess I don't know for sure.
>> Neither the WinTV box nor manual mentions FM stereo, but the web site
>> does (and did back then, I believe, or I wouldn't have bought the
>> unit).   I bought it without researching the state of the Linux driver
>> support  very well and found that the driver didn't do radio. I made do
>> by plugging an old external tuner into my Line-In.
>>
>> Since then I've moved to a new computer. It has a WinTV PVR-150 MCE. I
>> got TV and Radio working, but the radio seems to be only FM _mono_.
>>
>> I was pleased to find that pvrusb2 now has radio support, so I built the
>> latest pvrusb2-mci-20070114 and replaced the 2.6.18 kernel version. TV
>> still works, but when I play the radio, it's still mono.   I've tried
>> with both a cable TV feed and the wire FM antena that comes with the PVR
>> USB2.  Is the pvrusb2 driver meant to support stereo?
>>     
>
> How can you tell it is mono?  Is the driver telling you that, or does it 
> just "sound" mono?  I'm not disagreeing with you here - I just haven't 
> investigated something like this yet.
>   
I have an FM stereo walkman hooked up to the stereo LineIn on my sound 
card (well, motherboard sound connector). I have a second FM stereo 
walkman hooked up to a mono Mic input. I can switch between these two 
and the two WinTV radios fairly quickly. It's pretty obvious by 
listening that the only stereo sound is the LineIn.

The Hauppauge website specs never say any model is mono, but certain 
ones say stereo, namely the PVR USB2. The 350 doesn't say stereo either, 
but I can't imagine that it wouldn't be!
>> I can't play the radio as I would expect. Perhaps I'm using the wrong
>> program (ivtv-radio)? I have to run "mplayer /dev/radio1" which gives an
>> empty video window while the radio audio plays. mplayer says this about
>> the audio:
>>
>> ==========================================================================
>> Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
>> AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000)
>> Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
>> ==========================================================================
>>
>> Here is the internal WinTV radio playing OK with "ivtv-radio", but MONO:
>>
>> $ ivtv-radio -d /dev/radio0 -f 98.7
>> set to freq 98.70
>> Running: aplay -f dat < /dev/video24
>> Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz,
>> Stereo
>>
>> Here is the PVR USB2. I haven't located ivtv-detect yet:
>>
>> $ ivtv-radio -d /dev/radio1 -f 107.3
>> set to freq 107.30
>> /dev/video24 belongs to a different ivtv driver then /dev/radio1.
>> Run ivtv-detect to discover the correct radio/PCM out combination.
>>
>> The above _does_ change the radio station. I can also change it with:
>>
>> echo 107300000 > /sys/class/pvrusb2/sn-7570160/ctl_frequency/cur_val
>>
>> Here are my devices. You can see by the date stamps that pvrusb2 caused
>> /dev/radio1 and /dev/video2 to be created today.
>>
>> # ls -l /dev/rad* /dev/vid*
>> crw-rw---- 1 root video 81, 64 2007-01-15 22:24 /dev/radio0
>> crw-rw---- 1 root video 81, 65 2007-01-18 16:14 /dev/radio1
>> crw-rw---- 1 root video 81,  0 2007-01-15 22:24 /dev/video0
>> crw-rw---- 1 root video 81,  1 2007-01-18 16:14 /dev/video1
>> crw-rw---- 1 root video 81, 24 2007-01-15 22:24 /dev/video24
>> crw-rw---- 1 root video 81, 32 2007-01-15 22:24 /dev/video32
>>
>> Some more info:
>>
>> Debian "sid" system running kernel 2.6.18-3-686.
>> WinTV USB2: 29032 Rev D158 NTSC/NTSC-J
>> The manual says "QI-PVRUSB2-V2.5-ENG August 26, 2004", but that's
>> probably just the manual version.
>>
>> Thanks,
>>
>> ...RickM...
>>     
>
> I don't know anything about ivtv-radio, so I can't comment on how it 
> magically came up with /dev/video24 :-(
>
> As for the more general question, here's some info about the internals:
>
> The processing of the audio of course is all internal to the hardware.  
> All the driver does is change the mode of the tuner, select a different 
> audio source for the audio processing subsection, and mute the video.  
> I can tell you that the audio pathway from the audio processing 
> subsection all the way out through the driver is definitely stereo - the 
> audio chip (be it an msp3400 or a cx25840) is natively a stereo device.  
> The MP3 data coming from the mpeg encoder is always a stereo stream, 
> which is why the mplayer output you show reports the stream being 2 
> channel.
>
> Strangely enough, the audio chip includes an FM stereo decoder, but the 
> way the device is built, that decoder isn't being used.  There is 
> another part present which is doing the stereo demodulating (a tda9887, 
> perhaps?).  I've presumed that the V4L tuner-core handles this.
>
> There are 2 controls in the driver which might have a bearing on this.  
> One reports the audio format (e.g. stereo vs mono); the other allows you 
> to select the audio format.  These controls aren't really "processed" by 
> the driver, but rather they are passed through to/from the chip-level 
> drivers that deal with the information.  You may want to examine them 
> when in radio mode and see what they report.
>   
I just did a test and I could change the volume with ctl_volume, so things
are working in that respect. I found ctl_audio_mode and ctl_mpeg_audio_mode.
Both cur_vals were Stereo. I can set them to Mono and they report Mono,
but switching them back and forth didn't get me stereo.

I think I'll load the Windows software somewhere and see if I can get Stereo
from the USB2 on a Windows machine. I could also boot this Linux box into
the WinXP MCE that came with it. With two 250 GB drives, I left the 
factory installed
Windows there but haven't ever actually run it. It would be interesting 
to see
if the PVR-150 is indeed mono as I suspect (just because of the specs on 
their website).
> Honestly it hadn't even occurred to me that the FM radio might be 
> mono-only.  That would seem like a silly thing, to cheap-out on the FM 
> tuner while having all that other glorious (and not cheap) hardware 
> present for doing the mpeg encoding.  It's hard for me to test if 
> there's any real effect here because all the FM stations here are stereo 
> - so I can't deliberately tune a mono station and see if the results are 
> measurably different.
>
> The next time I'm digging through the driver (which, given the Oops 
> report earlier today means it won't be long) I'll look at this and see 
> if I can really hear that it is stereo.  Can anyone else here playing 
> with the radio confirm / deny if they are hearing a stereo signal?
>
>   -Mike
>
>
>   



More information about the pvrusb2 mailing list