
Rich.West at wesmo
May 22, 2012, 7:18 AM
Post #4 of 9
(665 views)
Permalink
|
|
Re: wintv-pvr-usb2 audio clipping [solved]
[In reply to]
|
|
Interesting information.. thanks, Mike! Anyone know if there is a V4L2 UI setting within mythbackend? The approval factor went down a bit when the recordings from that device started blasting everyone in the room. I've noticed that I'm seeing a lot of the following in dmesg, which results in the audio being reset back to the screemingly loud and very clipped default. So, I put a very crude hack in to reset the audio back to a more comfortable setting every 3 minutes and after each channel change. However, I admit it is a crappy hack, and it still results in the initial 3 minutes of audio screaming in its clipped way at everyone.. I wasn't able to find any module settings while allowed for passing any defaults for audio.. :( I'm tempted to upgrade the machine, effectively undoing my move from one of my PVR-150's to the USB PVR, to handle all of the hardware (3 PCI PVR-150's, 5 SATA drives), but finding a motherboard with those specs while staying on the cheap hasn't been easy. :-( -Rich [1427795.965090] pvrusb2: ***WARNING*** device's encoder appears to be stuck (status=0x00000003) [1427795.965096] pvrusb2: Encoder command: 0x81 [1427795.965098] pvrusb2: Giving up on command. This is normally recovered via a firmware reload and re-initialization; concern is only warranted if this happens repeatedly and rapidly. [1429596.691258] pvrusb2: ***WARNING*** device's encoder appears to be stuck (status=0x00000003) [1429596.691264] pvrusb2: Encoder command: 0x81 [1429596.691266] pvrusb2: Giving up on command. This is normally recovered via a firmware reload and re-initialization; concern is only warranted if this happens repeatedly and rapidly. [1433197.061706] pvrusb2: ***WARNING*** device's encoder appears to be stuck (status=0x00000003) [1433197.061712] pvrusb2: Encoder command: 0x81 [1433197.061714] pvrusb2: Giving up on command. This is normally recovered via a firmware reload and re-initialization; concern is only warranted if this happens repeatedly and rapidly. [1451249.643019] ivtv0: Encoder has died : ivtv_serialized_open [1451249.643026] ivtv0: Detected in ivtv_serialized_open that firmware had failed - Reloading [1451250.479691] ivtv0: Loaded v4l-cx2341x-enc.fw firmware (376836 bytes) [1451250.683223] ivtv0: Firmware restart okay On 04/24/2012 10:13 AM, Mike Isely wrote: > A few bits of added information here - > > The control that Rich found to fix the problem is not "private" to the > pvrusb2 driver. Yes the interface through sysfs is rather unique but > the actual underlying control being affected there is just the standard > V4L2 audio volume control. So you *should* be able to fix this problem > within mythtv via some kind of V4L2 UI setting as well though with the > current version of mythtv (it's been a while since I last updated) I'm > not sure how that control is expressed through the mythtv interface. > > The reason for the current behavior in the pvrusb2 driver is historic... > > Way back, years ago, when I realized this problem, the solution I wanted > to apply was to have the bridge driver (e.g. pvrusb2 itself) scale the > audio level value to be appropriate for the particular hardware in use. > By "scale" what I mean is to transform the incoming range of 0-65535 to > a "real" range that makes more sense for the specific device. This at > the time would have been relatively easy to accomplish in the bridge > driver with a simple, trivial conversion like hardware_volume = > (input_volume * n) / d + offset, where "n", "d" and "offset" would be > attributes coded in the driver appropriate to the actual practical > limits of the device as-a-whole (24xxx vs 29xxx vs HVR-1900/HVR-1950, > etc) rather than just what the audio chip can be told. > > That way, regardless of the device, when setting 65535 the actual value > set would be the practical maximum for the hardware, while lower values > would be suitably proportional. > > However I was overruled by the V4L2 maintainer. The "policy" in the > V4L2 framework according to the V4L2 maintainer was that the bridge > driver must export the "full range" of all the chips, regardless of what > actually makes sense, and not mess with or translate any of the internal > values. V4L2's "solution" to this problem was that the bridge driver > should instead initialize the default value for the audio level that > represented the practical upper limit. This was supposed to be a hint > to the application and/or user. So that's what the pvrusb2 driver does; > it sets a single solitary "default" that's used for all the devices it > controls. > > Thus we have the current situation. > > Gary is right however in that I have adjusted that default value > downward a few times. It's probably still not really right. And it > probably won't ever be either, because that one value is currently > applied across all pvrusb2-supported hardware. The current default is > probably correct for one type of model and still distorting for another. > > But the best solution for now is to just adjust the V4L2 audio level for > the device (either through sysfs or more likely just through the normal > V4L2 API) downward until there's no more distortion. Any V4L2-using > application should have a "knob" you can manipulate to adjust the audio > gain coming out of the capture hardware, and setting that is what you > really need to do. > > Realize this situation only applies for analog capture, where the > hardware has to process (demodulate, digitize, encode, multiplex) the > audio. In the case of digital capture (e.g. HVR-1950/HVR-1900/OnAir) > the device just blindly grabs and hands off the entire MPEG-TS stream > through DVB, in which case the upstream audio packets just pass through > with the rest of the bits. > > -Mike Isely > > > On Mon, 23 Apr 2012, Gary Buhrmaster wrote: > >> On Mon, Apr 23, 2012 at 19:01, Rich West <Rich.West [at] wesmo> wrote: >> .... >>> If there is more of a "right" way to do this, I'm all ears. :) >> I have this vague recollection that Mike (the author of the driver) >> said that this was fixed in "recent" versions of the driver. You >> might want to send email to the pvrusb2 mail lists, and check. >> It may be that your (in kernel) driver is too old. _______________________________________________ mythtv-users mailing list mythtv-users [at] mythtv http://www.mythtv.org/mailman/listinfo/mythtv-users
|