From owner-freebsd-multimedia@FreeBSD.ORG Mon Feb 14 10:53:45 2005 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9460C16A506 for ; Mon, 14 Feb 2005 10:53:43 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA35743D2F for ; Mon, 14 Feb 2005 10:53:42 +0000 (GMT) (envelope-from cronopiolopez@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so592578wra for ; Mon, 14 Feb 2005 02:53:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=aTVrN4L2S9Q/aPa7N7VmBUFySS2ZDY69c0LT9YsO/Hy9BxuQqy+tLjGIPELRJf2mHGT+a1u87qZ9jW6/0OopixphRxSq75Icf5KrZjXzHEwgtUgRiEsSD+/jof57k1SEt4+rZXXmqkelQ7mJbwK7/z6yJGMM8wJHrBDw8T2lEzg= Received: by 10.54.32.63 with SMTP id f63mr112425wrf; Mon, 14 Feb 2005 02:53:42 -0800 (PST) Received: by 10.54.32.58 with HTTP; Mon, 14 Feb 2005 02:53:42 -0800 (PST) Message-ID: <8f8eb53e0502140253238cd7f6@mail.gmail.com> Date: Mon, 14 Feb 2005 11:53:42 +0100 From: =?ISO-8859-1?Q?Lluis_L=F3pez?= To: freebsd-multimedia@freebsd.org, Edwin Groothuis , John Wehle In-Reply-To: <8f8eb53e050213185450daa380@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_180_31727944.1108378422061" References: <8f8eb53e050213185450daa380@mail.gmail.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Re: Patch for pvr250/350 (switch between profiles) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: =?ISO-8859-1?Q?Lluis_L=F3pez?= List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2005 10:53:46 -0000 ------=_Part_180_31727944.1108378422061 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I see that in my last mail some long lines in enclosed files are cutted. This produce fails in patching. I attached the same files in this mail. If somebody have any patch problem (and is interesed) i send this files in person. The instructions are de same (see bellow) that the last mail but files aren't enclosed, are attached (patch_cxm_c, patch_modules_cxm_cxm_Makefile, ioctl_meteor_compat.c and pvr250-setprofile.c). NOTE: If make clean fails rm -rf work/ and starts again. Regards, Luis L=F3pez Sol=E9. On Mon, 14 Feb 2005 03:54:51 +0100, Lluis L=F3pez = wrote: > Sorry for duplicate (no subject in last mail). > The application setsize allows switch between 3 profiles (determined > for format size). Next patch allows switch between 8 profiles using > hardware ioctl's. >=20 > NOTE: Values for profiles are select for me, I'm not an expert, if > somebody have more knowledge (or datasheet of chip) change source it's > easy (feeback is always welcome and copy of datasheet too). For > exemple the TS profile don't playback well, some losses in audio and > video (grab work without aparent problem), but i suposse it's very > useful for streaming machines. Other example is MPEG1 profile: don't > playback well, his values are selected for works with dvdauthor (only > accept 48 Khz audio streams), economize time in work encoding process. > Or MPEG2 profile select for best quality without losses with mplayer > playback (with -cache 8192, of course). >=20 > For apply this patch follow next steps: > 1.- > #cd /usr/ports/multimedia/pvr250/ && make clean && make extract > 2.- > Copy the enclosed files (see bellow) pvr250-setprofile, patch_cxm_c > and patch_modules_cxm_cxm_Makefile in work/ and ioctl_meteor_compat.h > in work/dev/cxm/ > 3.- > Apply the patches: > #patch < work/patch_cxm_c && patch 4.- > Compile with: > #make >=20 > copy: > #cp work/modules/cxm/*/*.ko /boot/kernel/ >=20 > and unload modules & load new modules: > # kldunload cxm > # kldunload cxm_iic > # kldload cxm_iic > # kldload cxm > NOTE: Select a channel the application pvr250-setprofile allows change > profile in cold or wih channel running, but don't initialize the > device. > 5.- > compille pvr250-setprofile: > #cc -o /usr/local/bin/pvr250-setprofile work/pvr250-setprofile.c > 6.- > Enjoy. > Regards, Luis L=F3pez Sol=E9. >=20 > LAST NOTE: Only tested in RELEGN_5 (compiled last weekend). ------=_Part_180_31727944.1108378422061 Content-Type: application/octet-stream; name=patch_cxm_c Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_cxm_c" --- work/dev/cxm/cxm.c.ORIGINAL Wed Feb 9 03:37:21 2005 +++ work/dev/cxm/cxm.c Mon Feb 14 00:55:06 2005 @@ -69,6 +69,7 @@ # include #endif + #include #include @@ -81,7 +82,7 @@ #endif #include - +#include /* * Various supported device vendors/types and their names. @@ -292,6 +293,240 @@ 0xe9 }; +static struct cxm_codec_profile mpeg2_ntsc_profile = { + "MPEG-2 NTSC video and MPEG audio", + CXM_FW_STREAM_TYPE_MPEG2_PROGRAM, + 30, + 720, 480, 480, + { 10, 12, 21 }, + 2, + 0, + /* + * 8 Mb/s (size of BLOCKDEVICE)the best quality for realtime playback + * without losses and default cache size for mplayer and xine. + */ + { 0, 8000000, 8192000 }, + { 1, 15, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ + 0xe9 +}; + +static struct cxm_codec_profile mpeg2_pal_profile = { + "MPEG-2 PAL video and MPEG audio", + CXM_FW_STREAM_TYPE_MPEG2_PROGRAM, + 25, + 720, 576, 576, + { 6, 17, 22 }, + 2, + 0, + /* + * 8 Mb/s (size of BLOCKDEVICE)the best quality for realtime playback + * without losses and default cache size for mplayer and xine. + */ + { 0, 8000000, 8192000 }, + { 1, 12, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ + 0xe9 +}; + +static struct cxm_codec_profile mpeg1_ntsc_profile = { + "MPEG-1 NTSC video and MPEG audio", + CXM_FW_STREAM_TYPE_MPEG1, + 30, + 352, 240, 480, + { 10, 12, 21 }, + 12, + 0, + /* For store 6 h in DVD5 and 12 h in DVD9 -Ideal for series-*/ + { 1, 2048000, 0 }, + { 1, 15, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* + * 48 Khz, (with 44.1 Khz dvdauthor reports WARNINGS and sync problems) + * MPEG-1 Layer II, 224 kb/s PROBLEMS: don't works in realtime playback, + * but is the only profile that works for store MPEG1 streams in DVD. + */ + 0xb9 +}; + +static struct cxm_codec_profile mpeg1_pal_profile = { + "MPEG-1 PAL video and MPEG audio", + CXM_FW_STREAM_TYPE_MPEG1, + 25, + 352, 288, 576, + { 6, 17, 22 }, + 8, + 0, + /* For store 6 h in DVD5 and 12 h in DVD9 -Ideal for series-*/ + { 1, 2048000, 0 }, + { 1, 12, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* + * 48 Khz, (with 44.1 Khz dvdauthor reports WARNINGS and sync problems) + * MPEG-1 Layer II, 224 kb/s PROBLEMS: don't works in realtime playback, + * but is the only profile that works for store MPEG1 streams in DVD. + */ + 0xb9 +}; + +static struct cxm_codec_profile dvd_s1_ntsc_profile = { + "MPEG-2 DVD_S1 NTSC video and MPEG audio", + CXM_FW_STREAM_TYPE_DVD_S1, + 30, + 720, 480, 480, + { 10, 12, 21 }, + 2, + 0, + /* 4 Mb/s ~2Gb/h - Ideal for DVD5 -140 min. aprox. -*/ + { 0, 4000000, 4096000 }, + { 1, 15, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ + 0xe9 +}; + +static struct cxm_codec_profile dvd_s1_pal_profile = { + "MPEG-2 DVD PAL video and MPEG audio", + CXM_FW_STREAM_TYPE_DVD_S1, + 25, + 720, 576, 576, + { 6, 17, 22 }, + 2, + 0, + /* 4 Mb/s ~2Gb/h - Ideal for DVD5 -140 min. aprox. -*/ + { 0, 4000000, 4096000 }, + { 1, 12, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ + 0xe9 +}; + +static struct cxm_codec_profile dvd_s2_ntsc_profile = { + "MPEG-2 DVD_S2 NTSC video and MPEG audio", + CXM_FW_STREAM_TYPE_DVD_S2, + 30, + 720, 480, 480, + { 10, 12, 21 }, + 2, + 0, + /* + * 2 Mb/s peak ~1Gb/h For store 6 h in DVD5 and 12 h in DVD9 -Ideal for series- + */ + { 0, 2000000, 2048000 }, + { 1, 15, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 224 kb/s */ + 0xb9 +}; + +static struct cxm_codec_profile dvd_s2_pal_profile = { + "MPEG-2 DVD PAL video and MPEG audio", + CXM_FW_STREAM_TYPE_DVD_S2, + 25, + 720, 576, 576, + { 6, 17, 22 }, + 2, + 0, + /* + * 2 Mb/s peak ~1Gb/h For store 6 h in DVD5 and 12 h in DVD9 -Ideal for series- + */ + { 0, 2000000, 2048000 }, + { 1, 12, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 224 kb/s */ + 0xb9 +}; + +static struct cxm_codec_profile mpeg2_ts_ntsc_profile = { + "MPEG-2 NTSC video and MPEG audio", + CXM_FW_STREAM_TYPE_MPEG2_TS, + 30, + 720, 480, 480, + { 10, 12, 21 }, + 2, + 0, + /* + * Unknow good values. I don't have the datasheet. + * ONLY FOR TEST. + */ + { 0, 6000000, 6144000 }, + { 1, 15, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ + 0xe9 +}; + +static struct cxm_codec_profile mpeg2_ts_pal_profile = { + "MPEG-2 PAL video and MPEG audio", + CXM_FW_STREAM_TYPE_MPEG2_TS, + 25, + 720, 576, 576, + { 6, 17, 22 }, + 2, + 0, + /* + * Unknow good values. I don't have the datasheet. + * ONLY FOR TEST. + */ + { 0, 6000000, 6144000 }, + { 1, 12, 3}, + /* + * Spatial filter = Manual, Temporal filter = Manual + * Median filter = Horizontal / Vertical + * Spatial filter value = 1, Temporal filter value = 4 + */ + { 0, 3, 1, 4 }, + /* 48 Khz, MPEG-1 Layer II, 384 kb/s */ + 0xe9 +}; + static const struct cxm_codec_profile *codec_profiles[] = { &vcd_ntsc_profile, @@ -299,7 +534,17 @@ &svcd_ntsc_profile, &svcd_pal_profile, &dvd_ntsc_profile, - &dvd_pal_profile + &dvd_pal_profile, + &mpeg2_ntsc_profile, + &mpeg2_pal_profile, + &mpeg1_ntsc_profile, + &mpeg1_pal_profile, + &dvd_s1_ntsc_profile, + &dvd_s1_pal_profile, + &dvd_s2_ntsc_profile, + &dvd_s2_pal_profile, + &mpeg2_ts_ntsc_profile, + &mpeg2_ts_pal_profile }; @@ -801,7 +1046,8 @@ for (i = 0; i < NUM_ELEMENTS(codec_profiles); i++) if (codec_profiles[i]->fps == fps - && codec_profiles[i]->width == sc->profile->width) + && codec_profiles[i]->width == sc->profile->width + && codec_profiles[i]->stream_type == sc->profile->stream_type) break; if (i >= NUM_ELEMENTS(codec_profiles)) @@ -2278,6 +2524,7 @@ enum cxm_source source; struct bktr_capture_area *cap; struct bktr_remote *remote; + struct meteor_geomet *my_oformat; intrmask_t s; unit = UNIT( minor(dev) ); @@ -2848,6 +3095,42 @@ remote = (struct bktr_remote *)arg; if (cxm_ir_key(sc, (char *)remote, sizeof(*remote)) < 0) return ENXIO; + break; + + +/* My ioctl's for switch between profiles*/ + case METEORGETGEO: + my_oformat = (struct meteor_geomet *)arg; + memset (my_oformat, 0, sizeof (*my_oformat)); + my_oformat->rows = 0; + my_oformat->columns = 0; + my_oformat->frames = 0; + my_oformat->oformat = sc->profile->stream_type; + break; + + case METEORSETGEO: + if (sc->encoding) + return EBUSY; + + + my_oformat = (struct meteor_geomet *)arg; + if (my_oformat->rows || my_oformat->columns + || my_oformat->frames) + return EINVAL; + + /* + * Setting the stream type has the side effect of + * chosing between the VCD, SVCD, and DVD profiles. + */ + + for (i = 0; i < NUM_ELEMENTS(codec_profiles); i++) + if (codec_profiles[i]->stream_type == my_oformat->oformat) + break; + + if (i >= NUM_ELEMENTS(codec_profiles)) + return EINVAL; + + sc->profile = codec_profiles[i]; break; default: ------=_Part_180_31727944.1108378422061 Content-Type: application/octet-stream; name=patch_modules_cxm_cxm_makefile Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_modules_cxm_cxm_makefile" --- work/modules/cxm/cxm/Makefile.ORIGINAL Sun Feb 6 01:38:54 2005 +++ work/modules/cxm/cxm/Makefile Wed Feb 9 05:17:27 2005 @@ -1,7 +1,7 @@ .PATH: ${.CURDIR}/../../../dev/cxm KMOD = cxm SRCS = cxm.c cxm.h cxm_dec_fw.c cxm_enc_fw.c cxm_audio.c cxm_eeprom.c \ - cxm_ir.c cxm_tuner.c cxm_video.c opt_cxm.h \ + cxm_ir.c cxm_tuner.c cxm_video.c ioctl_meteor_compat.h opt_cxm.h \ bus_if.h device_if.h iicbb_if.h pci_if.h vnode_if.h .include ------=_Part_180_31727944.1108378422061--