From: SourceForge.net <no...@so...> - 2009-06-10 19:59:21
|
Bugs item #2801870, was opened at 2009-06-05 19:55 Message generated for change (Comment added) made by duncanwebb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=446895&aid=2801870&group_id=46652 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: tv Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Richard van Paasen (rvpaasen) Assigned to: Nobody/Anonymous (nobody) Summary: ivtv.py & v4l2/ivtv & kernel 2.6.29 Initial Comment: IVTV / v4l2 in kernel 2.6.29 seems to have renamed a control: 'Audio Encoding Layer' is now named 'Audio Encoding'. ivtv.py complains about this and TV will not be tuned correctly. I edited ivtv.py manually and changed the control name; this solves the problem. Here's my output of 'v4l2-ctl --list-ctrls': User Controls brightness (int) : min=0 max=255 step=1 default=128 value=128 flags=slider contrast (int) : min=0 max=127 step=1 default=64 value=64 flags=slider saturation (int) : min=0 max=127 step=1 default=64 value=64 flags=slider hue (int) : min=-128 max=127 step=1 default=0 value=0 flags=slider volume (int) : min=0 max=65535 step=655 default=58880 value=58880 flags=slider balance (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider bass (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider treble (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider mute (bool) : default=0 value=0 loudness (bool) : default=0 value=0 MPEG Encoder Controls stream_type (menu) : min=0 max=5 default=0 value=3 flags=update stream_vbi_format (menu) : min=0 max=1 default=0 value=0 audio_sampling_frequency (menu) : min=0 max=2 default=1 value=0 audio_encoding (menu) : min=1 max=1 default=1 value=1 flags=update audio_layer_ii_bitrate (menu) : min=9 max=13 default=10 value=11 audio_stereo_mode (menu) : min=0 max=3 default=0 value=0 flags=update audio_stereo_mode_extension (menu) : min=0 max=3 default=0 value=0 flags=inactive audio_emphasis (menu) : min=0 max=2 default=0 value=0 audio_crc (menu) : min=0 max=1 default=0 value=0 audio_mute (bool) : default=0 value=0 video_encoding (menu) : min=0 max=1 default=1 value=1 flags=readonly video_aspect (menu) : min=0 max=3 default=1 value=1 video_b_frames (int) : min=0 max=33 step=1 default=2 value=2 flags=update video_gop_size (int) : min=1 max=34 step=1 default=12 value=12 video_gop_closure (bool) : default=1 value=1 video_bitrate_mode (menu) : min=0 max=1 default=0 value=0 flags=update video_bitrate (int) : min=0 max=27000000 step=1 default=6000000 value=6000000 video_peak_bitrate (int) : min=0 max=27000000 step=1 default=8000000 value=9600000 video_temporal_decimation (int) : min=0 max=255 step=1 default=0 value=0 video_mute (bool) : default=0 value=0 video_mute_yuv (int) : min=0 max=16777215 step=1 default=32896 value=32896 spatial_filter_mode (menu) : min=0 max=1 default=0 value=0 flags=update spatial_filter (int) : min=0 max=15 step=1 default=0 value=0 flags=slider spatial_luma_filter_type (menu) : min=0 max=4 default=1 value=1 spatial_chroma_filter_type (menu) : min=0 max=1 default=1 value=1 temporal_filter_mode (menu) : min=0 max=1 default=0 value=0 flags=update temporal_filter (int) : min=0 max=31 step=1 default=8 value=0 flags=slider median_filter_type (menu) : min=0 max=4 default=0 value=0 flags=update median_luma_filter_minimum (int) : min=0 max=255 step=1 default=0 value=0 flags=inactive slider median_luma_filter_maximum (int) : min=0 max=255 step=1 default=255 value=255 flags=inactive slider median_chroma_filter_minimum (int) : min=0 max=255 step=1 default=0 value=0 flags=inactive slider median_chroma_filter_maximum (int) : min=0 max=255 step=1 default=255 value=255 flags=inactive slider insert_navigation_packets (bool) : default=0 value=0 ---------------------------------------------------------------------- >Comment By: Duncan Webb (duncanwebb) Date: 2009-06-10 21:59 Message: Hi Richard, I'm curious what the actual error was, AttributeError, ValueError, etc? Even with one-liners it's still good to be specific (The number of times a SyntaxError is being hidden by the try:/except: is too often) Thanks for the patch it should still work against 1.9.0 as this code hasn't changed for quite a while. Yes this is a good idea to get rid of the audio_bitmask it is really a bit of history where the API of ivtv was changing weekly! Now it is mostly stable this code can be dropped. BTW you still on 1.8.2, need people with lots of Python/Freevo experience to have a test version running from time to time. Cheers, ---------------------------------------------------------------------- Comment By: Richard van Paasen (rvpaasen) Date: 2009-06-10 00:08 Message: I added a patch file for v4l.py and ivtv.py (for freevo 1.8.2). Maybe we should remove the audio_bitmask setting in IVTV_OPTIONS and use seperate values for the audio controls, similar to the video controls. It seems that a bit more has changed in ivtv, see http://ivtvdriver.org/index.php/V4l2-ctl E.g. the range for bitrate values is different, and the audio encoding can only be '1'. ---------------------------------------------------------------------- Comment By: Richard van Paasen (rvpaasen) Date: 2009-06-09 21:20 Message: Hi Duncan, I tested with the try/except clause and that does work. Here is a short diff (note this ivtv.py of the 1.8.2 version of Freevo): Zeus tv # diff -Naur ivtv.py.org ivtv.py --- ivtv.py.org 2009-06-09 21:15:20.000000000 +0200 +++ ivtv.py 2009-06-09 21:13:17.000000000 +0200 @@ -141,7 +141,10 @@ audio_bitmask = 0 audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Sampling Frequency') << 0) audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Layer II Bitrate') << 2) - audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Encoding Layer') << 6) + try: + audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Encoding Layer') << 6) + except: + audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Encoding') << 6) audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Stereo Mode') << 8) audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Stereo Mode Extension') << 10) audio_bitmask |= (tv.v4l2.Videodev.getcontrol(self, 'Audio Emphasis') << 12) @@ -184,7 +187,7 @@ '01' 48Khz '10' 32Khz '11' reserved - 2:3 'Audio Encoding Layer': + 2:3 'Audio Encoding': '01'=Layer I '10'=Layer II 4:7 'Audio Layer II Bitrate': @@ -267,7 +270,10 @@ tv.v4l2.Videodev.updatecontrol(self, 'Video Aspect', codec.aspect-1) tv.v4l2.Videodev.updatecontrol(self, 'Audio Sampling Frequency', (codec.audio_bitmask >> 0) & 0x03) tv.v4l2.Videodev.updatecontrol(self, 'Audio Layer II Bitrate', (codec.audio_bitmask >> 2) & 0x0F) - tv.v4l2.Videodev.updatecontrol(self, 'Audio Encoding Layer', (codec.audio_bitmask >> 6) & 0x01) + try: + tv.v4l2.Videodev.updatecontrol(self, 'Audio Encoding Layer', (codec.audio_bitmask >> 6) & 0x01) + except: + tv.v4l2.Videodev.updatecontrol(self, 'Audio Encoding', (codec.audio_bitmask >> 6) & 0x01) tv.v4l2.Videodev.updatecontrol(self, 'Audio Stereo Mode', (codec.audio_bitmask >> 8) & 0x03) tv.v4l2.Videodev.updatecontrol(self, 'Audio Stereo Mode Extension', (codec.audio_bitmask >> 10) & 0x03) tv.v4l2.Videodev.updatecontrol(self, 'Audio Emphasis', (codec.audio_bitmask >> 12) & 0x03) ---------------------------------------------------------------------- Comment By: Duncan Webb (duncanwebb) Date: 2009-06-09 18:44 Message: Hi Richard, I need a bit more information to fix this problem is a robust way. Will you try adding a try/except block around the old control names with the correct error type, it is only in two places. In the except block will you try setting the same code with the new name. Thanks ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=446895&aid=2801870&group_id=46652 |