Hi,
I encounter some sound levels troubles on my 'PVR powered' freevo
station. In short, the incoming sound level is too high on some TV
programs. So far, I did correct that with v4l2-ctl. But v4l2-ctl is not
delivered 'out of the box' and I believe that others can have sound
level troubles.
Digging in tv/v4l2.py, I saw that everything was available in freevo to
deal with that point (and virtually all settable parts of the PVR cards,
I think). It was just a amtter of delivering that to the user.
You'll find one implementation in the following diffs. I choose to add a
'avol' param in the TV_VIDEO_GROUPS as I find that differents input are
able to have differents sound levels ... and as this was also easier to
debug !
Take this diff as a proof of concept : I did really poor tests, have no
clues of the behaviour with other kind of video cards, and so on...
But in fact, even if this allready helps me, it is not totally good : I
have here (in France) two kind of sound modulations : AM is the oldest
mode (and sound level is very high) and NICAM is the 'modern' sound for
SECAM (and the level is much lower).
So I would like to add a 'Percent sound level' value in the TV_CHANNELS
array.
This Percent level could then by applied 'at best effort' in each tv
driver (I guess only on Analog TV driver as 'recording' a numeric
braodcast is just a matter of copying a stream).
Is that a crasy idea ? If not, witch position is the next free for the
TV_CHANNELS array ?
Any suggestions ?
Thanks,
Pascal
Index: psfreevo/src/config.py
===================================================================
--- psfreevo/src/config.py (révision 11160)
+++ psfreevo/src/config.py (copie de travail)
@@ -147,13 +147,14 @@
input_num=0, tuner_norm=None, tuner_chanlist=None,
tuner_type='internal', tuner_chan=None, irsend_trans=None,
record_group=None, desc='Freevo Default Video Group',
- group_type='normal', cmd=None):
+ group_type='normal', cmd=None, avol=58800):
"""
Initialise an instance of a VideoGroup
@ivar vdev: The video recording device, such as /dev/video0.
@ivar vvbi: The video vbi device, such as /dev/vbi0.
@ivar adev: The audio device, such as: None, /dev/dsp.
+ @ivar avol: Default sound level for this videogroup (v4l2 value,
58800 if not set)
@ivar input_type: tuner, webcam
@ivar input_num: The number of this input according to V4L
@ivar tuner_type: internal (on a v4l device), or external
(cable or sat box)
@@ -184,6 +185,7 @@
self.vdev = vdev
self.vvbi = vvbi
self.adev = adev
+ self.avol = avol
self.input_type = string.lower(input_type)
self.input_num = int(input_num)
self.tuner_type = tuner_type
Index: psfreevo/src/tv/plugins/ivtv_xine_tv.py
===================================================================
--- psfreevo/src/tv/plugins/ivtv_xine_tv.py (révision 11160)
+++ psfreevo/src/tv/plugins/ivtv_xine_tv.py (copie de travail)
@@ -671,6 +671,12 @@
new_vg != self.fc.getVideoGroup(self.curr_channel,
True)
if switch_vg:
+ #seems a good place to set the incoming sound level !
+ try:
+ ivtv_avol = new_vg.avol
+ except AttributeError:
+ ivtv_avol = 58800
+
# switch to a different video group
_debug_('TunerControl: Set VideoGroup: %s' % new_vg, DINFO)
ivtv_dev = ivtv.IVTV(new_vg.vdev)
@@ -679,6 +685,10 @@
# disable embedded vbi data
self.embed = ivtv_dev.getvbiembed()
ivtv_dev.setvbiembed(0)
+ _debug_('SwitchVg: Current PVR Sound level is : %s' %
ivtv_dev.getctrl(0x00980905))
+ _debug_('SwitchVg: Set the PVR Sound Level to : %s' %
ivtv_avol)
+ ivtv_dev.setctrl(0x00980905, ivtv_avol)
+ _debug_('SwitchVg: New PVR Sound level is : %s' %
ivtv_dev.getctrl(0x00980905))
if not self.ivtv_init:
self.ivtv_init = True
Index: psfreevo/src/tv/plugins/ivtv_record.py
===================================================================
--- psfreevo/src/tv/plugins/ivtv_record.py (révision 11160)
+++ psfreevo/src/tv/plugins/ivtv_record.py (copie de travail)
@@ -145,6 +145,16 @@
_debug_('Setting channel to %r' % self.prog.tunerid)
fc.chanSet(str(self.prog.tunerid), False)
+ #seems a good place to set the incoming sound level !
+ try:
+ ivtv_avol = vg.avol
+ except AttributeError:
+ ivtv_avol = 58800
+ _debug_('Current PVR Sound level is : %s' %
v.getctrl(0x00980905))
+ _debug_('Set the PVR Sound Level to : %s' % ivtv_avol)
+ v.setctrl(0x00980905, ivtv_avol)
+ _debug_('New PVR Sound level is : %s' %
v.getctrl(0x00980905))
+
if vg.cmd != None:
_debug_("Running command %r" % vg.cmd)
retcode = os.system(vg.cmd)
Index: psfreevo/freevo_config.py
===================================================================
--- psfreevo/freevo_config.py (révision 11160)
+++ psfreevo/freevo_config.py (copie de travail)
@@ -1969,6 +1969,7 @@
TV_VIDEO_GROUPS = [
VideoGroup(vdev=TV_DEVICE,
adev=AUDIO_DEVICE,
+ avol=58800,
input_type='tuner 1',
input_num=0,
tuner_norm=CONF.tv,
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel