Mailing List Archive

ivtv mplayer patch
For anyone that is interested, I have created a new ivtv patch for
mplayer. It is an (hopefully) improvement upon Kevin's and Chris' older
mplayer patches that enable mplayer to use the hardware decoder on the
PVR 350 (for video only). It is still a work in progress, but I believe
that the sync problems will be drastically improved. I do still get
desync sometimes here on my extremely slow system. I am not sure if it's
a problem with the patch, the driver or just because the CPU (PII 300)
is buried by mplayer. It would be great if any of you guys would like to
give it a go and provide feedback, suggestions, fixes, etc.

The patch is against MPlayer-1.0pre3. You still have to provide an audio
delay when starting it, or at least I do. Also, it defaults to using
/dev/video16 if you don't specify a device. I use the following script
to run it:

# beginning of script
#!/bin/bash

sudo mount /mnt/cdrom
ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
/usr/local/bin/mplayer -ao oss:/dev/dsp -delay -1.15 -cache 8192 -fs
-zoom -quiet -framedrop -vo ivtv -dvd-device /dev/cdrom dvd://
ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha
sudo umount /mnt/cdrom

# end of script

kr

--
K.R. Foley
kr@cybsft.com
www.cybsft.com
Re: ivtv mplayer patch [ In reply to ]
> ivtvfbctl /dev/fb0 -noglobalalpha -localalpha

What's the difference between global alpha and local alpha?

I will try this patch out tonight, thanks!

Regards,
Andrew


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
Global alpha allows the whole framebuffer to be one value of
transparency, defined by you. Local alpha is where the rgb32
image has that information and can make some parts more transparent
than others.

Chris
On Fri, Mar 05, 2004 at 09:11:25AM -0500, Andrew Kohlsmith wrote:
> > ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
>
> What's the difference between global alpha and local alpha?
>
> I will try this patch out tonight, thanks!
>
> Regards,
> Andrew
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> ivtv-devel mailing list
> ivtv-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel

--
---
Chris Kennedy / ckennedy@kmos.cmsu.edu
Engineer KMOS-TV/KTBG-FM
Broadcasting Services Department
Central Missouri State University


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
Andrew Kohlsmith wrote:
>>ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
>
>
> What's the difference between global alpha and local alpha?
>
> I will try this patch out tonight, thanks!
>
> Regards,
> Andrew
>

Andrew,

Wish I could tell you for sure. What this appears to do is turn off the
framebuffer output (or make it completely transparent or something) to
allow you to put video to the ivtv device without having it mixed with
the framebuffer output. Kevin? Anyone?

kr

--
K.R. Foley
kr@cybsft.com
www.cybsft.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
it may be worth adding in the 'patch' from the thread
I linked to last night (to reduce the cpu load based
on an mplayer 'bug'')

If i have time later (and you don't beat me to it)
i'll release a version with that in it.

-tmk

--- "K.R. Foley" <kr@cybsft.com> wrote:
> For anyone that is interested, I have created a new
> ivtv patch for
> mplayer. It is an (hopefully) improvement upon
> Kevin's and Chris' older
> mplayer patches that enable mplayer to use the
> hardware decoder on the
> PVR 350 (for video only). It is still a work in
> progress, but I believe
> that the sync problems will be drastically improved.
> I do still get
> desync sometimes here on my extremely slow system. I
> am not sure if it's
> a problem with the patch, the driver or just because
> the CPU (PII 300)
> is buried by mplayer. It would be great if any of
> you guys would like to
> give it a go and provide feedback, suggestions,
> fixes, etc.
>
> The patch is against MPlayer-1.0pre3. You still have
> to provide an audio
> delay when starting it, or at least I do. Also, it
> defaults to using
> /dev/video16 if you don't specify a device.


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
kevin thayer wrote:
> it may be worth adding in the 'patch' from the thread
> I linked to last night (to reduce the cpu load based
> on an mplayer 'bug'')
>
> If i have time later (and you don't beat me to it)
> i'll release a version with that in it.
>
> -tmk
>

Done. I added the patch referred to above. It definitely helps keep
mplayer from eating the CPU. It now runs at about 50% idle while playing
a video. It still doesn't help my desync problems, but it no longer eats
the machine. The desync symptoms are this:

95% of seeks don't desync
40% of pauses don't desync

It's worth noting here that the seek code and the pause code in mplayer
for restarting the output are identical at the driver levels, ao and vo.
Basically before restarting after a seek or a pause mplayer just issues
a reset on the driver. In the ao:oss driver it just issues a dsp reset,
closes the device and reopens it. In the vo:ivtv I just stop the
decoder, issue a flush (empties the kernel buffers) and start the
decoder. I even tried closing the ivtv device and reopening to get the
sync more consistent, but that doesn't change anything. The only things
that I can figure are that 1) the flush on the dsp or the ivtv decoder
aren't flushing all of the data or 2) the higher level code in mplayer
is flawed. I am currently looking a little deeper at the mplayer code.

Any ideas are welcome,

kr

--
K.R. Foley
kr@cybsft.com
www.cybsft.com
Re: ivtv mplayer patch [ In reply to ]
I can't get the patch to apply

cat mplayer.patch | patch

patching file ivtv-ext-api.h
can't find file to patch at input line 199
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -BurN MPlayer-1.0pre3/libvo/Makefile
MPlayer-1.0pre3.new/libvo/Makefile
|--- MPlayer-1.0pre3/libvo/Makefile 2003-12-08 03:38:25.000000000
-0600
|+++ MPlayer-1.0pre3.new/libvo/Makefile 2004-01-06 11:53:06.000000000
-0600
--------------------------

Trevor

On Mar 5, 2004, at 5:46 AM, K.R. Foley wrote:

> For anyone that is interested, I have created a new ivtv patch for
> mplayer. It is an (hopefully) improvement upon Kevin's and Chris'
> older mplayer patches that enable mplayer to use the hardware decoder
> on the PVR 350 (for video only). It is still a work in progress, but I
> believe that the sync problems will be drastically improved. I do
> still get desync sometimes here on my extremely slow system. I am not
> sure if it's a problem with the patch, the driver or just because the
> CPU (PII 300) is buried by mplayer. It would be great if any of you
> guys would like to give it a go and provide feedback, suggestions,
> fixes, etc.
>
> The patch is against MPlayer-1.0pre3. You still have to provide an
> audio delay when starting it, or at least I do. Also, it defaults to
> using /dev/video16 if you don't specify a device. I use the following
> script to run it:
>
> # beginning of script
> #!/bin/bash
>
> sudo mount /mnt/cdrom
> ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
> /usr/local/bin/mplayer -ao oss:/dev/dsp -delay -1.15 -cache 8192 -fs
> -zoom -quiet -framedrop -vo ivtv -dvd-device /dev/cdrom dvd://
> ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha
> sudo umount /mnt/cdrom
>
> # end of script
>
> kr
>
> --
> K.R. Foley
> kr@cybsft.com
> www.cybsft.com
> diff -BurN MPlayer-1.0pre3/libvo/ivtv-ext-api.h
> MPlayer-1.0pre3.new/libvo/ivtv-ext-api.h
> --- MPlayer-1.0pre3/libvo/ivtv-ext-api.h 1969-12-31 18:00:00.000000000
> -0600
> +++ MPlayer-1.0pre3.new/libvo/ivtv-ext-api.h 2004-02-21
> 22:18:42.000000000 -0600
> @@ -0,0 +1,191 @@
> +#define IVTV_IOC_FWAPI 0xFFEE7701 /*just some values i
> picked for now*/
> +#define IVTV_IOC_ZCOUNT 0xFFEE7702
> +#define IVTV_IOC_G_CODEC 0xFFEE7703
> +#define IVTV_IOC_S_CODEC 0xFFEE7704
> +
> +#define IVTV_MBOX_MAX_DATA 16
> +
> +/* allow direct access to the saa7115 registers for testing */
> +#define SAA7115_GET_REG 0xFFEE7705
> +#define SAA7115_SET_REG 0xFFEE7706
> +
> +/* to set audio options */
> +#define DECODER_SET_AUDIO 0xFFEE7707
> +#define DECODER_AUDIO_32_KHZ 0
> +#define DECODER_AUDIO_441_KHZ 1
> +#define DECODER_AUDIO_48_KHZ 2
> +
> +#define IVTV_IOC_PLAY 0xFFEE7781
> +#define IVTV_IOC_PAUSE 0xFFEE7782
> +#define IVTV_IOC_FRAMESYNC 0xFFEE7783
> +#define IVTV_IOC_GET_TIMING 0xFFEE7784
> +#define IVTV_IOC_S_SLOW_FAST 0xFFEE7785
> +#define IVTV_IOC_S_START_DECODE 0xFFEE7786
> +#define IVTV_IOC_S_STOP_DECODE 0xFFEE7787
> +#define IVTV_IOC_S_OSD 0xFFEE7788
> +#define IVTV_IOC_GET_FB 0xFFEE7789
> +
> +#define IVTV_IOC_START_DECODE _IOW('@', 29, struct
> ivtv_cfg_start_decode)
> +#define IVTV_IOC_STOP_DECODE _IOW('@', 30, struct
> ivtv_cfg_stop_decode)
> +#define IVTV_IOC_G_SPEED _IOR('@', 31, struct ivtv_speed)
> +#define IVTV_IOC_S_SPEED _IOW('@', 32, struct ivtv_speed)
> +#define IVTV_IOC_DEC_STEP _IOW('@', 33, int)
> +#define IVTV_IOC_DEC_FLUSH _IOW('@', 34, int)
> +
> +
> +/* ioctl for MSP_SET_MATRIX will have to be registered */
> +#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix)
> +
> +
> +/* Custom v4l controls */
> +#ifndef V4L2_CID_PRIVATE_BASE
> +#define V4L2_CID_PRIVATE_BASE 0x08000000
> +#endif
> +
> +#define V4L2_CID_IVTV_FREQ (V4L2_CID_PRIVATE_BASE)
> +#define V4L2_CID_IVTV_ENC (V4L2_CID_PRIVATE_BASE + 1)
> +#define V4L2_CID_IVTV_BITRATE (V4L2_CID_PRIVATE_BASE + 2)
> +#define V4L2_CID_IVTV_MONO (V4L2_CID_PRIVATE_BASE + 3)
> +#define V4L2_CID_IVTV_JOINT (V4L2_CID_PRIVATE_BASE + 4)
> +#define V4L2_CID_IVTV_EMPHASIS (V4L2_CID_PRIVATE_BASE + 5)
> +#define V4L2_CID_IVTV_CRC (V4L2_CID_PRIVATE_BASE + 6)
> +#define V4L2_CID_IVTV_COPYRIGHT (V4L2_CID_PRIVATE_BASE + 7)
> +#define V4L2_CID_IVTV_GEN (V4L2_CID_PRIVATE_BASE + 8)
> +
> +#define IVTV_V4L2_AUDIO_MENUCOUNT 9 /* # of v4l controls */
> +
> +#define IVTV_DEC_PRIVATE_BASE (V4L2_CID_PRIVATE_BASE +
> IVTV_V4L2_AUDIO_MENUCOUNT)
> +
> +#define V4L2_CID_IVTV_DEC_SMOOTH_FF (IVTV_DEC_PRIVATE_BASE + 0)
> +#define V4L2_CID_IVTV_DEC_FR_MASK (IVTV_DEC_PRIVATE_BASE + 1)
> +#define V4L2_CID_IVTV_DEC_SP_MUTE (IVTV_DEC_PRIVATE_BASE + 2)
> +#define V4L2_CID_IVTV_DEC_FR_FIELD (IVTV_DEC_PRIVATE_BASE + 3)
> +#define V4L2_CID_IVTV_DEC_AUD_SKIP (IVTV_DEC_PRIVATE_BASE + 4)
> +#define V4L2_CID_IVTV_DEC_NUM_BUFFERS (IVTV_DEC_PRIVATE_BASE + 5)
> +#define V4L2_CID_IVTV_DEC_PREBUFFER (IVTV_DEC_PRIVATE_BASE + 6)
> +
> +#define IVTV_V4L2_DEC_MENUCOUNT 7
> +
> +struct ivtv_ioctl_fwapi {
> + uint32_t cmd;
> + uint32_t result;
> + int32_t args;
> + uint32_t data[IVTV_MBOX_MAX_DATA];
> +};
> +
> +struct ivtv_ioctl_framesync {
> + uint32_t frame;
> + uint64_t pts;
> + uint64_t scr;
> +};
> +
> +struct ivtv_speed {
> + int scale; /* 1-?? (50 for now) */
> + int smooth; /* Smooth mode when in slow/fast mode */
> + int speed; /* 0 = slow, 1 = fast */
> + int direction; /* 0 = forward, 1 = reverse (not supportd */
> + int fr_mask; /* 0 = I, 1 = I,P, 2 = I,P,B 2 = default!*/
> + int b_per_gop; /* frames per GOP (reverse only) */
> + int aud_mute; /* Mute audio while in slow/fast mode */
> + int fr_field; /* 1 = show every field, 0 = show every frame */
> + int mute; /* # of audio frames to mute on playback resume */
> +};
> +
> +struct ivtv_slow_fast {
> + int speed; /* 0 = slow, 1 = fast */
> + int scale; /* 1-?? (50 for now) */
> +};
> +
> +struct ivtv_cfg_start_decode {
> + uint32_t gop_offset; /*Frames in GOP to skip before starting */
> + uint32_t muted_audio_frames;/* #of audio frames to mute */
> +};
> +
> +struct ivtv_cfg_stop_decode {
> + int hide_last; /* 1 = show black after stop,
> + 0 = show last frame */
> + uint64_t pts_stop; /* PTS to stop at */
> +};
> +
> +
> +/* For use with IVTV_IOC_G_CODEC and IVTV_IOC_S_CODEC */
> +struct ivtv_ioctl_codec {
> + uint32_t aspect;
> + uint32_t audio_bitmask;
> + uint32_t bframes;
> + uint32_t bitrate_mode;
> + uint32_t bitrate;
> + uint32_t bitrate_peak;
> + uint32_t dnr_mode;
> + uint32_t dnr_spatial;
> + uint32_t dnr_temporal;
> + uint32_t dnr_type;
> + uint32_t framerate;
> + uint32_t framespergop;
> + uint32_t gop_closure;
> + uint32_t pulldown;
> + uint32_t stream_type;
> +};
> +
> +
> +struct msp_matrix {
> + int input;
> + int output;
> +};
> +
> +/* Framebuffer external API */
> +/* NOTE: These must *exactly* match the structures and constants in
> driver/ivtv.h */
> +
> +struct ivtvfb_ioctl_state_info {
> + unsigned long status;
> + unsigned long alpha;
> +};
> +
> +struct ivtvfb_ioctl_blt_copy_args {
> + int x, y, width, height, source_offset, source_stride;
> +};
> +
> +struct ivtvfb_ioctl_dma_host_to_ivtv_args {
> + void* source;
> + unsigned long dest_offset;
> + int count;
> +};
> +
> +struct ivtvfb_ioctl_get_frame_buffer {
> + void* mem;
> + int size;
> + int sizex;
> + int sizey;
> +};
> +
> +struct ivtv_osd_coords {
> + unsigned long offset;
> + unsigned long max_offset;
> + int pixel_stride;
> + int lines;
> + int x;
> + int y;
> +};
> +
> +struct rectangle {
> + int x0;
> + int y0;
> + int x1;
> + int y1;
> +};
> +
> +#define IVTVFB_IOCTL_GET_STATE _IOR('@', 1, struct
> ivtvfb_ioctl_state_info)
> +#define IVTVFB_IOCTL_SET_STATE _IOW('@', 2, struct
> ivtvfb_ioctl_state_info)
> +#define IVTVFB_IOCTL_PREP_FRAME _IOW('@', 3, struct
> ivtvfb_ioctl_dma_host_to_ivtv_args)
> +#define IVTVFB_IOCTL_BLT_COPY _IOW('@', 4, struct
> ivtvfb_ioctl_blt_copy_args)
> +#define IVTVFB_IOCTL_GET_ACTIVE_BUFFER _IOR('@', 5, struct
> ivtv_osd_coords)
> +#define IVTVFB_IOCTL_SET_ACTIVE_BUFFER _IOW('@', 6, struct
> ivtv_osd_coords)
> +#define IVTVFB_IOCTL_GET_FRAME_BUFFER _IOR('@', 7, struct
> ivtvfb_ioctl_get_frame_buffer)
> +
> +#define IVTVFB_STATUS_ENABLED (1 << 0)
> +#define IVTVFB_STATUS_GLOBAL_ALPHA (1 << 1)
> +#define IVTVFB_STATUS_LOCAL_ALPHA (1 << 2)
> +#define IVTVFB_STATUS_FLICKER_REDUCTION (1 << 3)
> +
> +#define IVTV_IOCTL_SET_DEBUG_LEVEL _IOWR('@', 98, int *)
> +#define IVTV_IOCTL_GET_DEBUG_LEVEL _IOR('@', 99, int *)
> diff -BurN MPlayer-1.0pre3/libvo/Makefile
> MPlayer-1.0pre3.new/libvo/Makefile
> --- MPlayer-1.0pre3/libvo/Makefile 2003-12-08 03:38:25.000000000 -0600
> +++ MPlayer-1.0pre3.new/libvo/Makefile 2004-01-06 11:53:06.000000000
> -0600
> @@ -3,7 +3,7 @@
>
> LIBNAME = libvo.a
>
> -SRCS=geometry.c aspect.c aclib.c osd.c font_load.c gtf.c spuenc.c
> video_out.c vo_null.c vo_pgm.c vo_md5.c vo_mpegpes.c vo_yuv4mpeg.c
> $(OPTIONAL_SRCS) sub.c font_load_ft.c
> +SRCS=geometry.c aspect.c aclib.c osd.c font_load.c gtf.c spuenc.c
> video_out.c vo_null.c vo_pgm.c vo_md5.c vo_mpegpes.c vo_ivtv.c
> vo_yuv4mpeg.c $(OPTIONAL_SRCS) sub.c font_load_ft.c
> OBJS=$(SRCS:.c=.o)
>
> ifeq ($(VIDIX),yes)
> diff -BurN MPlayer-1.0pre3/libvo/video_out.c
> MPlayer-1.0pre3.new/libvo/video_out.c
> --- MPlayer-1.0pre3/libvo/video_out.c 2003-11-30 10:36:09.000000000
> -0600
> +++ MPlayer-1.0pre3.new/libvo/video_out.c 2004-01-06
> 11:53:06.000000000 -0600
> @@ -82,6 +82,7 @@
> extern vo_functions_t video_out_ggi;
> extern vo_functions_t video_out_aa;
> extern vo_functions_t video_out_mpegpes;
> +extern vo_functions_t video_out_ivtv;
> extern vo_functions_t video_out_yuv4mpeg;
> #ifdef HAVE_DIRECTX
> extern vo_functions_t video_out_directx;
> @@ -204,6 +205,7 @@
> &video_out_pgm,
> &video_out_md5,
> &video_out_mpegpes,
> + &video_out_ivtv,
> &video_out_yuv4mpeg,
> #ifdef HAVE_VESA
> &video_out_vesa,
> diff -BurN MPlayer-1.0pre3/libvo/vo_ivtv.c
> MPlayer-1.0pre3.new/libvo/vo_ivtv.c
> --- MPlayer-1.0pre3/libvo/vo_ivtv.c 1969-12-31 18:00:00.000000000 -0600
> +++ MPlayer-1.0pre3.new/libvo/vo_ivtv.c 2004-03-05 07:10:38.000000000
> -0600
> @@ -0,0 +1,227 @@
> +// Don't change for DVB card, it must be 2048
> +#define PES_MAX_SIZE 2048
> +
> +/*
> + * Based on:
> + *
> + * test_av.c - Test program for new API
> + *
> + * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
> + * & Marcus Metzler <marcus@convergence.de>
> + * for convergence integrated media GmbH
> + *
> + * libav - MPEG-PS multiplexer, part of ffmpeg
> + * Copyright Gerard Lantau (see http://ffmpeg.sf.net)
> + *
> + */
> +
> +#include "config.h"
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <errno.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
> +#include <unistd.h>
> +
> +#include "mp_msg.h"
> +
> +#include "config.h"
> +#include "video_out.h"
> +#include "video_out_internal.h"
> +#include "ivtv-ext-api.h"
> +#include <linux/ioctl.h>
> +
> +int vo_ivtv_fd=-1;
> +//int vo_ivtv_fd2=-1;
> +
> +static vo_info_t info =
> +{
> + "IVTV-Mpeg file",
> + "ivtv",
> + "A'rpi",
> + ""
> +};
> +
> +char ivtvbuf[65536*4];
> +int ivtvlen = 0;
> +char ivtvbuf2[65536*4];
> +int ivtvlen2 = 0;
> +
> +LIBVO_EXTERN (ivtv)
> +
> +static int int_pause;
> +static uint32_t
> +config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t
> height, uint32_t fullscreen, char *title, uint32_t format)
> +{
> +//printf("config\n");
> + return 0;
> +}
> +
> +static uint32_t preinit(const char *arg){
> +//printf("preinit\n");
> + vo_ivtv_fd=open(arg ? arg : "/dev/video16",O_RDWR);
> + if(vo_ivtv_fd<0){
> + perror("vo_ivtv");
> + return -1;
> + }
> + //vo_ivtv_fd2=vo_ivtv_fd;
> + return 0;
> +}
> +
> +
> +static void draw_osd(void)
> +{
> +//printf("draw_osd\n");
> +}
> +
> +#define IVTV_MIN_SIZE 65536
> +static int ivtv_write(void){
> +//printf("ivtv_write\n");
> + int wrote,curlen;
> + if (ivtvlen > 0) {
> + char * ivtvbuf_ptr = &ivtvbuf[0];
> + curlen = ivtvlen;
> +
> +
> + while (curlen > 0) {
> + wrote=write(vo_ivtv_fd,ivtvbuf_ptr,curlen);
> + ivtvbuf_ptr = ivtvbuf_ptr + wrote;
> + curlen -= wrote;
> + }
> + }
> + return 0;
> +}
> +
> +static uint32_t draw_frame(uint8_t * src[])
> +{
> +//printf("draw_frame\n");
> + vo_mpegpes_t *p=(vo_mpegpes_t *)src[0];
> + memcpy(&ivtvbuf[0], p->data, p->size);
> + ivtvlen = p->size;
> + return 0;
> +}
> +
> +static void flip_page (void)
> +{
> +//printf("flip_page\n");
> + ivtv_write();
> +}
> +
> +static uint32_t reset_ivtv (int blank_scrn)
> +{
> +//printf("reset_ivtv\n");
> + struct ivtv_cfg_stop_decode sd;
> + sd.hide_last = blank_scrn;
> + sd.pts_stop = 0;
> + struct ivtv_cfg_start_decode sd1;
> + sd1.gop_offset = 0;
> + sd1.muted_audio_frames = 0;
> +
> + //if (!blank_scrn)
> + // ivtvlen = 0;
> + //if (blank_scrn)
> + //ivtvlen2 = 0;
> +
> + while (ioctl(vo_ivtv_fd,IVTV_IOC_STOP_DECODE, &sd) < 0){
> + if (errno != EBUSY){
> + perror("IVTV_IOC_STOP_DECODE: ");
> + return 1;
> + }
> + }
> + while (ioctl(vo_ivtv_fd,IVTV_IOC_DEC_FLUSH, 0) < 0){
> + if (errno != EBUSY){
> + perror("IVTV_IOC_DEC_FLUSH: ");
> + return 1;
> + }
> + }
> + while (ioctl(vo_ivtv_fd,IVTV_IOC_START_DECODE, &sd1) < 0){
> + if (errno != EBUSY){
> + perror("IVTV_IOC_START_DECODE: ");
> + return 1;
> + }
> + }
> + //uninit();
> + //preinit((const char *) NULL);
> + return 0;
> +
> +}
> +
> +static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w,int
> h,int x0,int y0)
> +{
> +//printf("draw_slice\n");
> + return 0;
> +}
> +
> +
> +static uint32_t
> +query_format(uint32_t format)
> +{
> +//printf("query_format\n");
> + if(format==IMGFMT_MPEGPES) return 3|VFCAP_TIMER;
> + return 0;
> +}
> +
> +static void
> +uninit(void)
> +{
> +//printf("uninit\n");
> + //if(vo_ivtv_fd2>=0 && vo_ivtv_fd2!=vo_ivtv_fd)
> close(vo_ivtv_fd2);
> + //vo_ivtv_fd2=-1;
> + if(vo_ivtv_fd>=0){ close(vo_ivtv_fd);vo_ivtv_fd=-1;}
> +}
> +
> +
> +static void check_events(void)
> +{
> +//printf("check_events\n");
> +}
> +
> +static uint32_t control(uint32_t request, void *data, ...)
> +{
> +//printf("control\n");
> +//printf("request = %d\n",request);
> + switch (request) {
> + case VOCTRL_PAUSE:
> + {
> + //printf("pausing\n");
> + reset_ivtv(0);
> + //while (ioctl(vo_ivtv_fd,IVTV_IOC_PAUSE, 0) < 0){
> + //if (ioctl(vo_ivtv_fd,IVTV_IOC_PAUSE, 0) < 0){
> + // if (errno != EBUSY){
> + // perror("IVTV_IOC_PAUSE: ");
> + // break;
> + //}
> + //}
> + return (int_pause=1);
> + }
> +
> + case VOCTRL_RESUME:
> + {
> + //printf("resuming\n");
> + reset_ivtv(0);
> + //while (ioctl(vo_ivtv_fd,IVTV_IOC_PLAY, 0) < 0){
> + //if (ioctl(vo_ivtv_fd,IVTV_IOC_PLAY, 0) < 0){
> + // if (errno != EBUSY){
> + // perror("IVTV_IOC_PLAY: ");
> + // break;
> + // }
> + //}
> + return (int_pause=0);
> + }
> +
> + case VOCTRL_RESET:
> + return reset_ivtv(1);
> +
> + case VOCTRL_DUPLICATE_FRAME:
> + {
> + flip_page();
> + return VO_TRUE;
> + }
> +
> + case VOCTRL_QUERY_FORMAT:
> + return query_format(*((uint32_t*)data));
> + }
> + return VO_NOTIMPL;
> +}



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
just copy ivtv-ext-api.h from ivtv to the
MPlayer-1.0pre3/libvo/ directory

-tmk

--- Trevor Kramer <tkramer@hampshire.edu> wrote:
> I can't get the patch to apply
>
> cat mplayer.patch | patch
>
> patching file ivtv-ext-api.h
> can't find file to patch at input line 199
> Perhaps you should have used the -p or --strip
> option?
> The text leading up to this was:
> --------------------------
> |diff -BurN MPlayer-1.0pre3/libvo/Makefile
> MPlayer-1.0pre3.new/libvo/Makefile
> |--- MPlayer-1.0pre3/libvo/Makefile 2003-12-08
> 03:38:25.000000000
> -0600
> |+++ MPlayer-1.0pre3.new/libvo/Makefile 2004-01-06
> 11:53:06.000000000
> -0600
> --------------------------
>
> Trevor
>
> On Mar 5, 2004, at 5:46 AM, K.R. Foley wrote:
>
> > For anyone that is interested, I have created a
> new ivtv patch for
> > mplayer. It is an (hopefully) improvement upon
> Kevin's and Chris'
> > older mplayer patches that enable mplayer to use
> the hardware decoder
> > on the PVR 350 (for video only). It is still a
> work in progress, but I
> > believe that the sync problems will be drastically
> improved. I do
> > still get desync sometimes here on my extremely
> slow system. I am not
> > sure if it's a problem with the patch, the driver
> or just because the
> > CPU (PII 300) is buried by mplayer. It would be
> great if any of you
> > guys would like to give it a go and provide
> feedback, suggestions,
> > fixes, etc.
> >
> > The patch is against MPlayer-1.0pre3. You still
> have to provide an
> > audio delay when starting it, or at least I do.
> Also, it defaults to
> > using /dev/video16 if you don't specify a device.
> I use the following
> > script to run it:
> >
> > # beginning of script
> > #!/bin/bash
> >
> > sudo mount /mnt/cdrom
> > ivtvfbctl /dev/fb0 -noglobalalpha -localalpha
> > /usr/local/bin/mplayer -ao oss:/dev/dsp -delay
> -1.15 -cache 8192 -fs
> > -zoom -quiet -framedrop -vo ivtv -dvd-device
> /dev/cdrom dvd://
> > ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha
> > sudo umount /mnt/cdrom
> >
> > # end of script
> >
> > kr
> >
> > --
> > K.R. Foley
> > kr@cybsft.com
> > www.cybsft.com
> > diff -BurN MPlayer-1.0pre3/libvo/ivtv-ext-api.h
> > MPlayer-1.0pre3.new/libvo/ivtv-ext-api.h
> > --- MPlayer-1.0pre3/libvo/ivtv-ext-api.h
> 1969-12-31 18:00:00.000000000
> > -0600
> > +++ MPlayer-1.0pre3.new/libvo/ivtv-ext-api.h
> 2004-02-21
> > 22:18:42.000000000 -0600
> > @@ -0,0 +1,191 @@
> > +#define IVTV_IOC_FWAPI 0xFFEE7701 /*just
> some values i
> > picked for now*/
> > +#define IVTV_IOC_ZCOUNT 0xFFEE7702
> > +#define IVTV_IOC_G_CODEC 0xFFEE7703
> > +#define IVTV_IOC_S_CODEC 0xFFEE7704
> > +
> > +#define IVTV_MBOX_MAX_DATA 16
> > +
> > +/* allow direct access to the saa7115 registers
> for testing */
> > +#define SAA7115_GET_REG 0xFFEE7705
> > +#define SAA7115_SET_REG 0xFFEE7706
> > +
> > +/* to set audio options */
> > +#define DECODER_SET_AUDIO 0xFFEE7707
> > +#define DECODER_AUDIO_32_KHZ 0
> > +#define DECODER_AUDIO_441_KHZ 1
> > +#define DECODER_AUDIO_48_KHZ 2
> > +
> > +#define IVTV_IOC_PLAY 0xFFEE7781
> > +#define IVTV_IOC_PAUSE 0xFFEE7782
> > +#define IVTV_IOC_FRAMESYNC 0xFFEE7783
> > +#define IVTV_IOC_GET_TIMING 0xFFEE7784
> > +#define IVTV_IOC_S_SLOW_FAST 0xFFEE7785
> > +#define IVTV_IOC_S_START_DECODE 0xFFEE7786
> > +#define IVTV_IOC_S_STOP_DECODE 0xFFEE7787
> > +#define IVTV_IOC_S_OSD 0xFFEE7788
> > +#define IVTV_IOC_GET_FB 0xFFEE7789
> > +
> > +#define IVTV_IOC_START_DECODE _IOW('@', 29,
> struct
> > ivtv_cfg_start_decode)
> > +#define IVTV_IOC_STOP_DECODE _IOW('@', 30,
> struct
> > ivtv_cfg_stop_decode)
> > +#define IVTV_IOC_G_SPEED _IOR('@', 31,
> struct ivtv_speed)
> > +#define IVTV_IOC_S_SPEED _IOW('@', 32,
> struct ivtv_speed)
> > +#define IVTV_IOC_DEC_STEP _IOW('@', 33,
> int)
> > +#define IVTV_IOC_DEC_FLUSH _IOW('@', 34,
> int)
> > +
> > +
> > +/* ioctl for MSP_SET_MATRIX will have to be
> registered */
> > +#define MSP_SET_MATRIX _IOW('m',17,struct
> msp_matrix)
> > +
> > +
> > +/* Custom v4l controls */
> > +#ifndef V4L2_CID_PRIVATE_BASE
> > +#define V4L2_CID_PRIVATE_BASE 0x08000000
> > +#endif
> > +
> > +#define V4L2_CID_IVTV_FREQ
> (V4L2_CID_PRIVATE_BASE)
> > +#define V4L2_CID_IVTV_ENC
> (V4L2_CID_PRIVATE_BASE + 1)
> > +#define V4L2_CID_IVTV_BITRATE
> (V4L2_CID_PRIVATE_BASE + 2)
> > +#define V4L2_CID_IVTV_MONO
> (V4L2_CID_PRIVATE_BASE + 3)
> > +#define V4L2_CID_IVTV_JOINT
> (V4L2_CID_PRIVATE_BASE + 4)
> > +#define V4L2_CID_IVTV_EMPHASIS
> (V4L2_CID_PRIVATE_BASE + 5)
> > +#define V4L2_CID_IVTV_CRC
> (V4L2_CID_PRIVATE_BASE + 6)
> > +#define V4L2_CID_IVTV_COPYRIGHT
> (V4L2_CID_PRIVATE_BASE + 7)
> > +#define V4L2_CID_IVTV_GEN
> (V4L2_CID_PRIVATE_BASE + 8)
> > +
> > +#define IVTV_V4L2_AUDIO_MENUCOUNT 9 /* # of v4l
> controls */
> > +
> > +#define IVTV_DEC_PRIVATE_BASE
> (V4L2_CID_PRIVATE_BASE +
> > IVTV_V4L2_AUDIO_MENUCOUNT)
> > +
> > +#define V4L2_CID_IVTV_DEC_SMOOTH_FF
> (IVTV_DEC_PRIVATE_BASE + 0)
> > +#define V4L2_CID_IVTV_DEC_FR_MASK
> (IVTV_DEC_PRIVATE_BASE + 1)
> > +#define V4L2_CID_IVTV_DEC_SP_MUTE
> (IVTV_DEC_PRIVATE_BASE + 2)
> > +#define V4L2_CID_IVTV_DEC_FR_FIELD
> (IVTV_DEC_PRIVATE_BASE + 3)
> > +#define V4L2_CID_IVTV_DEC_AUD_SKIP
> (IVTV_DEC_PRIVATE_BASE + 4)
> > +#define V4L2_CID_IVTV_DEC_NUM_BUFFERS
> (IVTV_DEC_PRIVATE_BASE + 5)
> > +#define V4L2_CID_IVTV_DEC_PREBUFFER
> (IVTV_DEC_PRIVATE_BASE + 6)
> > +
> > +#define IVTV_V4L2_DEC_MENUCOUNT 7
> > +
> > +struct ivtv_ioctl_fwapi {
> > + uint32_t cmd;
> > + uint32_t result;
> > + int32_t args;
> > + uint32_t data[IVTV_MBOX_MAX_DATA];
> > +};
> > +
> > +struct ivtv_ioctl_framesync {
> > + uint32_t frame;
> > + uint64_t pts;
> > + uint64_t scr;
> > +};
> > +
> > +struct ivtv_speed {
> > + int scale; /* 1-?? (50 for now) */
> > + int smooth; /* Smooth mode when in slow/fast
> mode */
> > + int speed; /* 0 = slow, 1 = fast */
> > + int direction; /* 0 = forward, 1 = reverse (not
> supportd */
>
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
kevin thayer wrote:
> just copy ivtv-ext-api.h from ivtv to the
> MPlayer-1.0pre3/libvo/ directory
>
> -tmk

Actually this won't solve all of the problems he is going to have unless
he changes his mplayer source directory to be MPlayer-1.0pre3.new as
mine is called. Trevor the proper way to apply the patch is to:

cd <your mplayersrcdir>
cat mplayer-ivtv-03.patch | patch -p1

the -p1 removes one directory level from the patch paths

kr
>
> --- Trevor Kramer <tkramer@hampshire.edu> wrote:
>
>>I can't get the patch to apply
>>
>>cat mplayer.patch | patch
>>
>>patching file ivtv-ext-api.h
>>can't find file to patch at input line 199
>>Perhaps you should have used the -p or --strip
>>option?
>>The text leading up to this was:
>>--------------------------
>>|diff -BurN MPlayer-1.0pre3/libvo/Makefile
>>MPlayer-1.0pre3.new/libvo/Makefile
>>|--- MPlayer-1.0pre3/libvo/Makefile 2003-12-08
>>03:38:25.000000000
>>-0600
>>|+++ MPlayer-1.0pre3.new/libvo/Makefile 2004-01-06
>>11:53:06.000000000
>>-0600
>>--------------------------
>>
>>Trevor
>>


--
K.R. Foley
kr@cybsft.com
www.cybsft.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
> I can't get the patch to apply
>
> cat mplayer.patch | patch

Use -p1 option from within the top level directory of mplayer's
source. E.g.,:

patch -p1 < mplayer-ivtv-02.patch

$ tar jxf MPlayer-1.0pre3.tar.bz2 &&
cd MPlayer-1.0pre3 &&
patch -p1 < ../mplayer-ivtv-02.patch
patching file libvo/ivtv-ext-api.h <<<<<<<< its output
patching file libvo/Makefile
patching file libvo/video_out.c
patching file libvo/vo_ivtv.c
$


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
It would be great if any of you guys would like to give it a go and
provide feedback, suggestions, fixes, etc.

System: Dell Optiplex GX1, PIII, 450MHz

# Test 1: Input file on NFS was recorded from '350 with stream_type=14
# bitrate_peak=bitrate=16000000, 720x480 NTSC:
/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-zoom -quiet -framedrop -vo ivtv /v/manual/sg1/7/711.Evolution.mpeg

VO: [ivtv] 720x480 => 720x540 Mpeg PES [fs] [zoom]

Seems to work well (audio, video, and sync), except CPU is a problem:

$ vmstat 1 [ignore first line of stats; they're just wrong.]
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 0 15804 1572 1500 52820 3 5 92 33 1352 1379 6 10 81 4
2 0 15804 1460 1500 52932 0 0 0 0 1388 184 36 64 0 0
2 0 15804 1572 1500 52816 0 0 0 0 1375 173 37 63 0 0
2 0 15804 1572 1520 52772 0 0 0 36 1385 191 36 64 0 0
2 0 15804 1432 1520 52912 0 0 0 0 1403 198 38 62 0 0
1 0 15804 1572 1520 52788 0 0 0 0 1445 240 36 64 0 0
$ top
top - 01:18:20 up 4:20, 3 users, load average: 1.81, 1.84, 1.44
Tasks: 80 total, 3 running, 68 sleeping, 3 stopped, 6 zombie
Cpu(s): 36.4% us, 61.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.7% hi, 1.7% si
Mem: 124104k total, 122684k used, 1420k free, 1208k buffers
Swap: 131064k total, 15996k used, 115068k free, 53208k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22077 ulmo 25 0 27624 15m 20m R 97.6 12.5 9:48.21 mplayer
22078 ulmo 15 0 26232 13m 20m S 0.9 11.3 0:05.75 mplayer
341 root 15 0 0 0 0 S 0.6 0.0 0:03.35 rpciod
22166 ulmo 16 0 2080 1016 1868 R 0.6 0.8 0:00.06 top
22139 ulmo 16 0 5996 1888 5572 S 0.3 1.5 0:00.03 sshd
1 root 16 0 1520 480 1368 S 0.0 0.4 0:04.00 init
2 root 34 19 0 0 0 R 0.0 0.0 0:00.00 ksoftirqd/0
3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
4 root 5 -10 0 0 0 S 0.0 0.0 0:00.70 kblockd/0
$ top
top - 01:18:20 up 4:20, 3 users, load average: 1.81, 1.84, 1.44
Tasks: 80 total, 3 running, 68 sleeping, 3 stopped, 6 zombie
Cpu(s): 36.4% us, 61.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.7% hi, 1.7% si
Mem: 124104k total, 122684k used, 1420k free, 1208k buffers
Swap: 131064k total, 15996k used, 115068k free, 53208k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22077 ulmo 25 0 27624 15m 20m R 97.6 12.5 9:48.21 mplayer
22078 ulmo 15 0 26232 13m 20m S 0.9 11.3 0:05.75 mplayer
341 root 15 0 0 0 0 S 0.6 0.0 0:03.35 rpciod
22166 ulmo 16 0 2080 1016 1868 R 0.6 0.8 0:00.06 top
22139 ulmo 16 0 5996 1888 5572 S 0.3 1.5 0:00.03 sshd
1 root 16 0 1520 480 1368 S 0.0 0.4 0:04.00 init
2 root 34 19 0 0 0 R 0.0 0.0 0:00.00 ksoftirqd/0
3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
4 root 5 -10 0 0 0 S 0.0 0.0 0:00.70 kblockd/0
$
kernel messages:
Mar 8 01:16:21 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 01:18:15 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 01:18:45 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 01:23:59 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 01:24:16 O kernel: ivtv: ivtv_dec_timeout: starting...

q made it quit. (Did not try forward & backward.)

-----
# Test 2: Input file on NFS was recorded from pcHDTV HD-2000 SDTV transport
# stream (704x480 NTSC); these never work right when put straight into
# '350.
/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-zoom -quiet -framedrop -vo ivtv /v/manual/sg1/6/616.Metamorphosis.ts

VO: [ivtv] 704x480 => 704x528 Mpeg PES [fs] [zoom]

Black screen & no audio.

$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 15936 2072 2000 51964 3 5 89 32 1351 1334 6 11 79 4
0 0 15936 2072 2000 51964 0 0 0 0 1087 48 0 0 100 0
0 0 15936 2072 2000 51964 0 0 0 0 1089 48 0 0 100 0
0 0 15936 2072 2000 51964 0 0 0 4 1093 54 0 0 100 0
$

q does not make it quit. Had to send INTR signal.

-----
# Test 3. Rerun same as test 1 to see if state of card is OK.
# Did one Forward jump (can't do locally, though).

CPU use still high as above. Output and audio as above in test 1.
q quits OK.

-----
# Test 4. Same as test 2, but without "-zoom" and "-quiet" options.
Problem:

Starting playback...
alsa-space: xrun of at least 585.508 msecs. resetting stream 6.4% 0 0 59%%
alsa-play: xrun of at least 0.083 msecs. resetting stream 6% 6.3% 0 0 46%
alsa-space: xrun of at least 1453.035 msecs. resetting stream 7.1% 0 0 47%
A:30946.6 V:30946.6 A-V: -0.004 ct: -0.053 73/ 73 0% 5% 8.3% 0 0 35%

Then it froze here.

Machine still responds. CPU went to 100% idle. q didn't work; INTR signal
had same reaction as above.

-----
# Test 5. Same as test 4. I forgot to put in "-ao none", so it did =
# to test 4. It found alsa9 and had same response (exactly):

alsa-space: xrun of at least 585.508 msecs. resetting stream 6.4% 0 0 59%%
alsa-play: xrun of at least 0.083 msecs. resetting stream 6% 6.3% 0 0 46%
alsa-space: xrun of at least 1453.035 msecs. resetting stream 7.1% 0 0 47%
A:30946.6 V:30946.6 A-V: -0.004 ct: -0.053 73/ 73 0% 5% 8.3% 0 0 35%

The stream is being interpreted equivilently.

-----
# Test 6: Same as test 4 & 5, but with "-ao none" instead of ALSA output.

Audio: no sound
Starting playback...
V:30946.6 73 0% 5% 0.0% 0 0 48%

So, it's stopping at the same spot. Now with quiet (test 7):

pressing q didn't work, so I'm assuming it had the same response.

-----
# Test 8: DVD: Nova: "Building the Great Pyramid", unknown parameters,
# mounted via NFS:

I'm having trouble NFS mounting the DVD. I did it once months ago,
but now I always get "Permission denied" in the client. Does anybody
know how to do this?

Instead, I copied the DVD to disk.

Audio: no sound
Starting playback...


Exiting... (End of file)

Nothing happened, and it quit fast.


I am really tired. I must go now.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
Brad Allen wrote:
> It would be great if any of you guys would like to give it a go and
> provide feedback, suggestions, fixes, etc.
>
> System: Dell Optiplex GX1, PIII, 450MHz
>
> # Test 1: Input file on NFS was recorded from '350 with stream_type=14
> # bitrate_peak=bitrate=16000000, 720x480 NTSC:
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -zoom -quiet -framedrop -vo ivtv /v/manual/sg1/7/711.Evolution.mpeg
>
> VO: [ivtv] 720x480 => 720x540 Mpeg PES [fs] [zoom]
>
> Seems to work well (audio, video, and sync), except CPU is a problem:

Are you using the 02 patch or the 03 patch I submitted later? If the
former, try the 03 version and that should aleviate the CPU crushing
mentioned here and further down.


>
> $ vmstat 1 [ignore first line of stats; they're just wrong.]
> procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
> r b swpd free buff cache si so bi bo in cs us sy id wa
> 3 0 15804 1572 1500 52820 3 5 92 33 1352 1379 6 10 81 4
> 2 0 15804 1460 1500 52932 0 0 0 0 1388 184 36 64 0 0
> 2 0 15804 1572 1500 52816 0 0 0 0 1375 173 37 63 0 0
> 2 0 15804 1572 1520 52772 0 0 0 36 1385 191 36 64 0 0
> 2 0 15804 1432 1520 52912 0 0 0 0 1403 198 38 62 0 0
> 1 0 15804 1572 1520 52788 0 0 0 0 1445 240 36 64 0 0
> $ top
> top - 01:18:20 up 4:20, 3 users, load average: 1.81, 1.84, 1.44
> Tasks: 80 total, 3 running, 68 sleeping, 3 stopped, 6 zombie
> Cpu(s): 36.4% us, 61.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.7% hi, 1.7% si
> Mem: 124104k total, 122684k used, 1420k free, 1208k buffers
> Swap: 131064k total, 15996k used, 115068k free, 53208k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 22077 ulmo 25 0 27624 15m 20m R 97.6 12.5 9:48.21 mplayer
> 22078 ulmo 15 0 26232 13m 20m S 0.9 11.3 0:05.75 mplayer
> 341 root 15 0 0 0 0 S 0.6 0.0 0:03.35 rpciod
> 22166 ulmo 16 0 2080 1016 1868 R 0.6 0.8 0:00.06 top
> 22139 ulmo 16 0 5996 1888 5572 S 0.3 1.5 0:00.03 sshd
> 1 root 16 0 1520 480 1368 S 0.0 0.4 0:04.00 init
> 2 root 34 19 0 0 0 R 0.0 0.0 0:00.00 ksoftirqd/0
> 3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
> 4 root 5 -10 0 0 0 S 0.0 0.0 0:00.70 kblockd/0
> $ top
> top - 01:18:20 up 4:20, 3 users, load average: 1.81, 1.84, 1.44
> Tasks: 80 total, 3 running, 68 sleeping, 3 stopped, 6 zombie
> Cpu(s): 36.4% us, 61.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.7% hi, 1.7% si
> Mem: 124104k total, 122684k used, 1420k free, 1208k buffers
> Swap: 131064k total, 15996k used, 115068k free, 53208k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 22077 ulmo 25 0 27624 15m 20m R 97.6 12.5 9:48.21 mplayer
> 22078 ulmo 15 0 26232 13m 20m S 0.9 11.3 0:05.75 mplayer
> 341 root 15 0 0 0 0 S 0.6 0.0 0:03.35 rpciod
> 22166 ulmo 16 0 2080 1016 1868 R 0.6 0.8 0:00.06 top
> 22139 ulmo 16 0 5996 1888 5572 S 0.3 1.5 0:00.03 sshd
> 1 root 16 0 1520 480 1368 S 0.0 0.4 0:04.00 init
> 2 root 34 19 0 0 0 R 0.0 0.0 0:00.00 ksoftirqd/0
> 3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
> 4 root 5 -10 0 0 0 S 0.0 0.0 0:00.70 kblockd/0
> $
> kernel messages:
> Mar 8 01:16:21 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 01:18:15 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 01:18:45 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 01:23:59 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 01:24:16 O kernel: ivtv: ivtv_dec_timeout: starting...
>
> q made it quit. (Did not try forward & backward.)

What about pause? Not sure about the decoder timeouts you're getting
above. I searched my logs and I have none of these and I have everything
being logged. :-/

>
> -----
> # Test 2: Input file on NFS was recorded from pcHDTV HD-2000 SDTV transport
> # stream (704x480 NTSC); these never work right when put straight into
> # '350.
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -zoom -quiet -framedrop -vo ivtv /v/manual/sg1/6/616.Metamorphosis.ts
>
> VO: [ivtv] 704x480 => 704x528 Mpeg PES [fs] [zoom]
>
> Black screen & no audio.
>
> $ vmstat 1
> procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
> r b swpd free buff cache si so bi bo in cs us sy id wa
> 0 0 15936 2072 2000 51964 3 5 89 32 1351 1334 6 11 79 4
> 0 0 15936 2072 2000 51964 0 0 0 0 1087 48 0 0 100 0
> 0 0 15936 2072 2000 51964 0 0 0 0 1089 48 0 0 100 0
> 0 0 15936 2072 2000 51964 0 0 0 4 1093 54 0 0 100 0
> $
>
> q does not make it quit. Had to send INTR signal.

Not sure what is going on above. Does mplayer know how to deal with hdtv
streams?

>
> -----
> # Test 3. Rerun same as test 1 to see if state of card is OK.
> # Did one Forward jump (can't do locally, though).

What does this mean "can't do locally, though"?

>
> CPU use still high as above. Output and audio as above in test 1.
> q quits OK.
>
> -----
> # Test 4. Same as test 2, but without "-zoom" and "-quiet" options.
> Problem:
>
> Starting playback...
> alsa-space: xrun of at least 585.508 msecs. resetting stream 6.4% 0 0 59%%
> alsa-play: xrun of at least 0.083 msecs. resetting stream 6% 6.3% 0 0 46%
> alsa-space: xrun of at least 1453.035 msecs. resetting stream 7.1% 0 0 47%
> A:30946.6 V:30946.6 A-V: -0.004 ct: -0.053 73/ 73 0% 5% 8.3% 0 0 35%
>
> Then it froze here.
>
> Machine still responds. CPU went to 100% idle. q didn't work; INTR signal
> had same reaction as above.
>
> -----
> # Test 5. Same as test 4. I forgot to put in "-ao none", so it did =
> # to test 4. It found alsa9 and had same response (exactly):
>
> alsa-space: xrun of at least 585.508 msecs. resetting stream 6.4% 0 0 59%%
> alsa-play: xrun of at least 0.083 msecs. resetting stream 6% 6.3% 0 0 46%
> alsa-space: xrun of at least 1453.035 msecs. resetting stream 7.1% 0 0 47%
> A:30946.6 V:30946.6 A-V: -0.004 ct: -0.053 73/ 73 0% 5% 8.3% 0 0 35%
>
> The stream is being interpreted equivilently.
>
> -----
> # Test 6: Same as test 4 & 5, but with "-ao none" instead of ALSA output.
>
> Audio: no sound
> Starting playback...
> V:30946.6 73 0% 5% 0.0% 0 0 48%
>
> So, it's stopping at the same spot. Now with quiet (test 7):
>
> pressing q didn't work, so I'm assuming it had the same response.
>
> -----
> # Test 8: DVD: Nova: "Building the Great Pyramid", unknown parameters,
> # mounted via NFS:
>
> I'm having trouble NFS mounting the DVD. I did it once months ago,
> but now I always get "Permission denied" in the client. Does anybody
> know how to do this?

Don't know for sure because I haven't tried this. You might try mounting
on the machine you have the dvd in, export it just like another nfs
export, mount if from the remote machine using a -t udf filesystem type???

>
> Instead, I copied the DVD to disk.

Did you transcode it, or just dump the whole disk image? If you dumped
the iso to disk, you should be able to mount it like so: "mount -t udf
-o loop <isoimage> <mountpoint>" and then pass the mountpoint as the dvd
device, I THINK.
>
> Audio: no sound
> Starting playback...
>
>
> Exiting... (End of file)
>
> Nothing happened, and it quit fast.

This sounds like you left the dvd:// in the mplayer command line or
something
>
>
> I am really tired. I must go now.
>


kr

--
K.R. Foley
kr@cybsft.com
www.cybsft.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
From: "K.R. Foley" <kr@cybsft.com>
Subject: Re: [ivtv-devel] ivtv mplayer patch
Date: Mon, 08 Mar 2004 11:19:40 -0600

> Are you using the 02 patch or the 03 patch I submitted later? If the
> former, try the 03 version and that should aleviate the CPU crushing
> mentioned here and further down.

Oops. I didn't see this message. Sorry for the previous tests, then.

> What about pause? Not sure about the decoder timeouts you're getting
> above. I searched my logs and I have none of these and I have everything
> being logged. :-/

See below for some pause tests. Still getting that message in dmesg:
ivtv: ivtv_dec_timeout: starting...
will correlate later with events.

> > # Test 3. Rerun same as test 1 to see if state of card is OK.
> > # Did one Forward jump (can't do locally, though).
>
> What does this mean "can't do locally, though"?

I didn't have LIRC, and my console is at the other end of the house.
The computer is without keyboard, mouse, and TV except for '350, and I
haven't had time to do X recompile and driver patch chase for the
various ways to do better TV out, and won't use stock 0.1.9 fb because
it's too unreliable.

I got LIRC to work today to test this. See below.

> Not sure what is going on above. Does mplayer know how to deal with hdtv
> streams?

See below for another test. You actually meant "TS" streams, but you
probably didn't know you meant that. That's OK. Yes, mplayer does
understand TS, and HDTV streams, together or seperately. This is a TS
stream containint "SDTV" (mpeg2 inside TS, although the details about
that I am not certain).

> Don't know for sure because I haven't tried this. You might try
> mounting on the machine you have the dvd in, export it just like
> another nfs export, mount if from the remote machine using a -t udf
> filesystem type???

That's one of the things I tried that failed the same way. See below
for discussion of that during tests again.

> Did you transcode it, or just dump the whole disk image? If you dumped
> the iso to disk, you should be able to mount it like so: "mount -t udf
> -o loop <isoimage> <mountpoint>" and then pass the mountpoint as the dvd
> device, I THINK.

That's the other thing I tried, but across NFS. I believe it has to
do with NFS, whether NFS served file via loop or anything via an NFS
mountpoint. This is dumb, because it should handle it. What does
work, I mention below, is letting mplayer just access that dump
directly off of NFS (which it prefers anyway), rather than trying to
first loop mount it or anything else; before, I was using the wrong
chapter; sorry for that false alarm on that one that worked (the
simplest NFS) access method.

> This sounds like you left the dvd:// in the mplayer command line or
> something

Yup. So, DVDs work, but with wrong aspect unless they're originally
4:3, as mentioned below. Is there a way to set the MPEG decoder/TV
encoder aspect to be something other than full screen?

Here's the output, which I mentioned below:

Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [ivtv] 720x480 => 854x480 Mpeg PES [fs] [zoom]

What outputs, though, looks like 720x480, '350s preferred resolution,
stretched to the edges of the screen (full screen) on the 4:3 output
device, because '350 doesn't know it's supposed to be anything other
than direct line output, with the caveat that the aspect for that
720x480 stream is supposed to be 16:9, not '350's expected 4:3. I
don't think it's chopped, as that 854x suggests; I think it's just
outputting at 720x480.

Since this would entail rescaling, then are we in trouble (i.e., need
to decode then recode for MPEG for decode again, and then it wouldn't
be as good quality, take more time to prepare, and no line per line
correspondence on output)?

*****

Re-testing new 03 patch with CPU use avoidance:

Test 1: Play something that '350 recorded:

/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-zoom -quiet -framedrop -vo ivtv /v/manual/sg1/7/711.Evolution.mpeg

Much less CPU!

$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 15812 1712 2676 44900 1 2 38 17 157 506 3 5 91 2
0 0 15812 2116 2824 44396 0 0 392 156 1457 1191 11 7 64 19
0 0 15812 1360 2824 45164 0 0 0 0 1346 1056 5 1 94 0
0 0 15812 1528 2892 45004 0 0 0 160 1389 1130 5 5 84 6
0 0 15812 1836 2892 44532 0 0 0 0 1435 1084 10 4 86 0
0 0 15812 1668 2876 44728 0 0 0 0 1421 1116 8 4 88 0
0 0 15812 1668 2792 44836 0 0 0 0 1377 1107 7 6 87 0
0 0 15812 1804 2612 44952 0 0 0 0 1444 1111 8 3 89 0
0 0 15812 1944 2420 45016 0 0 0 0 1423 1108 8 4 88 0
$ top
top - 09:09:07 up 12:11, 4 users, load average: 0.34, 0.20, 0.08
Tasks: 84 total, 1 running, 74 sleeping, 3 stopped, 6 zombie
Cpu(s): 8.3% us, 1.3% sy, 0.0% ni, 88.4% id, 0.0% wa, 0.7% hi, 1.3% si
Mem: 124104k total, 122720k used, 1384k free, 1804k buffers
Swap: 131064k total, 15812k used, 115252k free, 46144k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9720 ulmo 15 0 27732 15m 20m S 7.6 12.5 0:03.15 mplayer
9748 ulmo 17 0 2080 1024 1868 R 1.0 0.8 0:00.09 top
341 root 15 0 0 0 0 S 0.7 0.0 0:06.99 rpciod
9725 ulmo 15 0 26232 13m 20m S 0.7 11.3 0:00.54 mplayer
7 root 15 0 0 0 0 S 0.3 0.0 0:03.73 kswapd0
1 root 16 0 1520 480 1368 S 0.0 0.4 0:04.00 init
2 root 34 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/0
3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0

I quit it (which worked), so I can start my lirc dragon.

-----
Test 2: same as test 1, with LIRC:

God, getting LIRC to work in 2.6 is a pain. I have a hacked version
which will load into but not unload from Linux 2.6.4-rc2+kraxel263-1,
if anybody wants it. I'd be especially interested in someone pointing
me the patches necessary for more proper 2.6 support, but I should
bring that to LIRC mailing lists.

Forward, Rewind: Fine. Does seem to do it abruptly.
Pause: when restarting, video freezes for a while. I found that strange.
It starts again, though, in under 2 seconds.
Video: Decent. Dim; probably because bright day.
Audio: Good. Behind. Will use your option.


-----
Test 3:

Attempt DVD again. Can't mount DVD across NFS, either this way:

server$ mount -t udf /dev/dvd /mnt/dvd
server$ export /mnt/dvd client(ro)
client$ mount server:/mnt/dvd /mnt/dvd
[gives error here]

or this way:

server$ cp /dev/dvd /nfscommon/foo
client$ mount -o loop /nfscommon/foo /mnt/dvd
[gives error here]

They both give the Same mount error message: "Permission denied".
Does anybody know why this happens in linux 2.6 that is easy to fix?

/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-zoom -quiet -framedrop -vo ivtv \
-delay -1.15 \
-dvd-device /v/manual/dvd dvd://1

Found the problem. No program at 1. Had to go to 2. Duh.

/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-zoom -quiet -framedrop -vo ivtv \
-delay -1.15 \
-dvd-device /v/manual/dvd dvd://2

Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [ivtv] 720x480 => 854x480 Mpeg PES [fs] [zoom]

$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 1892 1572 5020 45256 1 1 67 18 1075 244 4 2 90 4
0 0 1892 1352 5020 45456 0 0 0 0 1367 1078 7 3 90 0
0 0 1892 1660 5020 45160 0 0 0 0 1381 1119 7 4 89 0
0 0 1892 1464 4988 45380 0 0 0 0 1364 1103 7 4 89 0
0 0 1892 1408 4848 45588 0 0 0 0 1373 1050 7 4 89 0

Video: Too tall (bad aspect), but otherwise great.
Audio: Because it is NOVA, there is almost no synchronized speech, so I
could not test synchronization easily, however, audio works.
FF, Rew: Good.
Pause: same problem: audio starts immediately, video after.

This DVD is sure dumb. Anyway, I will attempt to try fixing aspect.
As you can see, CPU was quite good.

No time to fix aspect. -fs -zoom in x11 on other non-'350 host is OK.
Not sure how to fix aspect with '350.

-----
Test 4:

Try out that TS SDTV stream again; it's 4:3 aspect (704x480), so
should be better. Taking out "-zoom" to see what happens, and adding
delay.

/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-quiet -framedrop -vo ivtv /v/manual/sg1/6/616.Metamorphosis.ts \
-delay -1.15

Wooooowwowowoa!!!! Results:

Sound: Ok.
Video: Not:

- rainbow random lines
- random cut ins and cut outs
- rare little glimpses of moving video, sometimes taken
from a different time earlier in stream, sometimes at what might
have been right time
- pauses where image would stick with flashing back and forth

These streams are error-prone, but this one isn't that errory.
Furthermore, their aspect is different. Should I be setting some
values in kernel drivers (ivtv) to get it to interpret these streams
better (e.g., stream_type; is that even used for OUT (decode
MPEG-encode TV))?

Pause, FF, and Rew worked, but didn't improve above situation.

-----
test 5

I'll try once more with zoom:

/usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
-quiet -framedrop -vo ivtv /v/manual/sg1/6/616.Metamorphosis.ts \
-delay -1.15 -zoom

Mar 8 15:01:02 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 15:25:17 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 15:29:18 O kernel: ivtv: ivtv_dec_timeout: starting...

Last one was the one for last test; not sure when happened. Same
problems as before (zoom didn't help).

If I reencode stream first:

mencoder -ovc copy -oac copy 616.Metamorphosis.ts -o out
mencoder -ovc copy -vc ffmpeg12mc -oac copy 616.Metamorphosis.ts -o out

neither helps; this time, only a blank screen.

'350 is very picky about what type of stream it outputs.

Now, I can't conduct other tests, because screen is blank, and no
audio, at all, as if mplayer is getting stuck (?). dmesg didn't show
anything different than above. I reloaded saa7127, ivtv, and reran
test_ioctl with same values as before, and now at least working again.

What other video streams should I try?

Perhaps nuvs from MythTV? I don't have any; perhaps I can create
some someday.


-----
test 6

I tried someone's recoded MPEG with same options and -zoom, and it had
sound, but no video, like when it failed above. Got lots of this
(at end): stops when I stopped:

Mar 8 15:50:15 O kernel: ivtv: i_flags=42, 4 s_sflags=4, 5 s_sflags=0, 6 s_sflags=0, 7 s_sflags=8
Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: lost IRQ; resetting...
Mar 8 15:50:16 O kernel: ivtv: DMAP not set
Mar 8 15:50:16 O kernel: ivtv: i_flags=42, 4 s_sflags=4, 5 s_sflags=0, 6 s_sflags=0, 7 s_sflags=8
Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: starting...
Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: lost IRQ; resetting...
Mar 8 15:50:16 O kernel: ivtv: DMAP not set
Mar 8 15:50:16 O kernel: ivtv: i_flags=42, 4 s_sflags=4, 5 s_sflags=0, 6 s_sflags=0, 7 s_sflags=8

I checked; it's a little over once a second (almost like one of those
MPEG heartbeats).

How do we purify MPEG for '350 output, especially without loosing
audio sync quality? I'd rather not recode much, but recoding only
video and not audio would be great, especially if all the sync data is
the same. Then, I could recode for storage, and then later view on
any system. I just need to know how. I'd rather keep the actual
content of the video the same --- perhaps just open the MPEG stream,
figure out how to make it '350 eligible, but not actually recompress
it (therefore no loss).





Well, so far, this is good news: we can now use mplayer to watch '250
streams and 4:3 native resolution (740x480 for my out device) DVDs on
a '350 out, with no CPU degradation. This is a really good thing, and
is the first time this thing is actually usable for normal use for
those purposes.

To my knowledge, it still won't handle a wider range of MPEGs or
aspect ratios, however, which effectively limits its range to its own
realm. For instance, like I mentioned above, most DVDs do not work
(wrong aspect and/or resolution), and TS streams containing 704x480
4:3 aspect do not work, despite working fine within mplayer with other
output devices.

It's starting to get time to submit these patches to mainstream
mplayer. I know we're at pre level; try to make them easy to compile
in, but not default, so it doesn't bug any reliability issues. If
someone gets a promise that this will make it into the current release
of mplayer, I'll code whatever if(option) s they need in order to
support this, but that shouldn't stop you from doing that instead.

Not much time to deal with this now.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
On Fri, Mar 05, 2004 at 03:46:27PM -0600, K.R. Foley wrote:

i get the following compile error when compiling 1.0pre3 with your
mplayer-ivtv-03.patch (wrapped for readability):


gcc -c -O4 -march=pentium4 -mcpu=pentium4 -pipe -ffast-math \
-fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64 -I../loader -o tvi_v4l.o tvi_v4l.c

tvi_v4l.c:413: error: redefinition of `struct v4l2_capability'
make[1]: *** [tvi_v4l.o] Error 1


i am using 2.4.25 with linux-2.4.25-i2c-2.8.4.patch.gz and
patch-2.4.25-rc1-kraxel.gz (v4l2) with gentoo and a pvr350.
any ideas what i set up wrong?


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
> i get the following compile error when compiling 1.0pre3 with your
> mplayer-ivtv-03.patch (wrapped for readability):

<snip>

this is actually completely unrelated to the mplayer-ivtv patch,
i thought i saw mplayer compile fine without it. but i was wrong.

sorry for the noise.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
myth@fsck.ch wrote:
> On Fri, Mar 05, 2004 at 03:46:27PM -0600, K.R. Foley wrote:
>
> i get the following compile error when compiling 1.0pre3 with your
> mplayer-ivtv-03.patch (wrapped for readability):
>
>
> gcc -c -O4 -march=pentium4 -mcpu=pentium4 -pipe -ffast-math \
> -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE \
> -D_FILE_OFFSET_BITS=64 -I../loader -o tvi_v4l.o tvi_v4l.c
>
> tvi_v4l.c:413: error: redefinition of `struct v4l2_capability'
> make[1]: *** [tvi_v4l.o] Error 1
>
>
> i am using 2.4.25 with linux-2.4.25-i2c-2.8.4.patch.gz and
> patch-2.4.25-rc1-kraxel.gz (v4l2) with gentoo and a pvr350.
> any ideas what i set up wrong?
>

It looks like something is screwed up with your include files, probably
v4l2_capability is defined in a file that mplayer doesn't expect
(/usr/include/linux/videodev2.h hence the #ifndef __LINUX_VIDEODEV2_H
right before the declaration that blows up). I have no way of knowing
but does /usr/include/linux/videodev.h perhaps have a v4l2_capability
defined? By the way, this has nothing to do with my patch.

kr

--
K.R. Foley
kr@cybsft.com
www.cybsft.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
>>> This sounds like you left the dvd:// in the mplayer command line or
>>> something
>> Yup. So, DVDs work, but with wrong aspect unless they're originally
>> 4:3, as mentioned below. Is there a way to set the MPEG decoder/TV
>> encoder aspect to be something other than full screen?

-vf expand=720:576

The problem with this command is that mplayer re-encore your stream to mpeg1video and it takes afew more CPU cycles ....
M


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
Brad Allen wrote:
> From: "K.R. Foley" <kr@cybsft.com>
Brad,

First let me say that I am sorry it took so long to reply. I am buried
in something that is extremely complicated for the past few days and I
haven't had any time to look into this stuff.

> Subject: Re: [ivtv-devel] ivtv mplayer patch
> Date: Mon, 08 Mar 2004 11:19:40 -0600
>
>
>>Are you using the 02 patch or the 03 patch I submitted later? If the
>>former, try the 03 version and that should aleviate the CPU crushing
>>mentioned here and further down.
>
>
> Oops. I didn't see this message. Sorry for the previous tests, then.

No problem.

>
>
>>What about pause? Not sure about the decoder timeouts you're getting
>>above. I searched my logs and I have none of these and I have everything
>>being logged. :-/
>
>
> See below for some pause tests. Still getting that message in dmesg:
> ivtv: ivtv_dec_timeout: starting...
> will correlate later with events.

Not sure what is generating this. Like I said I searched my logs and
didn't see a single instance of this. I am currently running ivtv 0.1.9
(stock with the exception of a few minor tweeks that I tried that would
not affect any of this).

>
>
>>># Test 3. Rerun same as test 1 to see if state of card is OK.
>>># Did one Forward jump (can't do locally, though).
>>
>>What does this mean "can't do locally, though"?
>
>
> I didn't have LIRC, and my console is at the other end of the house.
> The computer is without keyboard, mouse, and TV except for '350, and I
> haven't had time to do X recompile and driver patch chase for the
> various ways to do better TV out, and won't use stock 0.1.9 fb because
> it's too unreliable.

Mine works pretty good with the exception of the epg while watching tv.

>
> I got LIRC to work today to test this. See below.
>
>
>>Not sure what is going on above. Does mplayer know how to deal with hdtv
>>streams?
>
>
> See below for another test. You actually meant "TS" streams, but you
> probably didn't know you meant that. That's OK. Yes, mplayer does
> understand TS, and HDTV streams, together or seperately. This is a TS
> stream containint "SDTV" (mpeg2 inside TS, although the details about
> that I am not certain).

k.

>
>>Don't know for sure because I haven't tried this. You might try
>>mounting on the machine you have the dvd in, export it just like
>>another nfs export, mount if from the remote machine using a -t udf
>>filesystem type???
>
>
> That's one of the things I tried that failed the same way. See below
> for discussion of that during tests again.
>
>
>>Did you transcode it, or just dump the whole disk image? If you dumped
>>the iso to disk, you should be able to mount it like so: "mount -t udf
>>-o loop <isoimage> <mountpoint>" and then pass the mountpoint as the dvd
>>device, I THINK.
>
>
> That's the other thing I tried, but across NFS. I believe it has to
> do with NFS, whether NFS served file via loop or anything via an NFS
> mountpoint. This is dumb, because it should handle it. What does
> work, I mention below, is letting mplayer just access that dump
> directly off of NFS (which it prefers anyway), rather than trying to
> first loop mount it or anything else; before, I was using the wrong
> chapter; sorry for that false alarm on that one that worked (the
> simplest NFS) access method.

Have no idea about mounting DVDs over NFS.

>
>
>>This sounds like you left the dvd:// in the mplayer command line or
>>something
>
>
> Yup. So, DVDs work, but with wrong aspect unless they're originally
> 4:3, as mentioned below. Is there a way to set the MPEG decoder/TV
> encoder aspect to be something other than full screen?

I will look into this when I get done with the nightmare I am having at
the moment.

>
> Here's the output, which I mentioned below:
>
> Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
> VO: [ivtv] 720x480 => 854x480 Mpeg PES [fs] [zoom]
>
> What outputs, though, looks like 720x480, '350s preferred resolution,
> stretched to the edges of the screen (full screen) on the 4:3 output
> device, because '350 doesn't know it's supposed to be anything other
> than direct line output, with the caveat that the aspect for that
> 720x480 stream is supposed to be 16:9, not '350's expected 4:3. I
> don't think it's chopped, as that 854x suggests; I think it's just
> outputting at 720x480.
>
> Since this would entail rescaling, then are we in trouble (i.e., need
> to decode then recode for MPEG for decode again, and then it wouldn't
> be as good quality, take more time to prepare, and no line per line
> correspondence on output)?

Short answer: I just don't know. I looked VERY briefly at the ivtv
driver and it would appear that you can change the aspect ratio, but I
am not sure. Again I will look at this further in a day or so.

>
> *****
>
> Re-testing new 03 patch with CPU use avoidance:
>
> Test 1: Play something that '350 recorded:
>
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -zoom -quiet -framedrop -vo ivtv /v/manual/sg1/7/711.Evolution.mpeg
>
> Much less CPU!
>
> $ vmstat 1
> procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
> r b swpd free buff cache si so bi bo in cs us sy id wa
> 1 0 15812 1712 2676 44900 1 2 38 17 157 506 3 5 91 2
> 0 0 15812 2116 2824 44396 0 0 392 156 1457 1191 11 7 64 19
> 0 0 15812 1360 2824 45164 0 0 0 0 1346 1056 5 1 94 0
> 0 0 15812 1528 2892 45004 0 0 0 160 1389 1130 5 5 84 6
> 0 0 15812 1836 2892 44532 0 0 0 0 1435 1084 10 4 86 0
> 0 0 15812 1668 2876 44728 0 0 0 0 1421 1116 8 4 88 0
> 0 0 15812 1668 2792 44836 0 0 0 0 1377 1107 7 6 87 0
> 0 0 15812 1804 2612 44952 0 0 0 0 1444 1111 8 3 89 0
> 0 0 15812 1944 2420 45016 0 0 0 0 1423 1108 8 4 88 0
> $ top
> top - 09:09:07 up 12:11, 4 users, load average: 0.34, 0.20, 0.08
> Tasks: 84 total, 1 running, 74 sleeping, 3 stopped, 6 zombie
> Cpu(s): 8.3% us, 1.3% sy, 0.0% ni, 88.4% id, 0.0% wa, 0.7% hi, 1.3% si
> Mem: 124104k total, 122720k used, 1384k free, 1804k buffers
> Swap: 131064k total, 15812k used, 115252k free, 46144k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 9720 ulmo 15 0 27732 15m 20m S 7.6 12.5 0:03.15 mplayer
> 9748 ulmo 17 0 2080 1024 1868 R 1.0 0.8 0:00.09 top
> 341 root 15 0 0 0 0 S 0.7 0.0 0:06.99 rpciod
> 9725 ulmo 15 0 26232 13m 20m S 0.7 11.3 0:00.54 mplayer
> 7 root 15 0 0 0 0 S 0.3 0.0 0:03.73 kswapd0
> 1 root 16 0 1520 480 1368 S 0.0 0.4 0:04.00 init
> 2 root 34 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/0
> 3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
>
> I quit it (which worked), so I can start my lirc dragon.
>
> -----
> Test 2: same as test 1, with LIRC:
>
> God, getting LIRC to work in 2.6 is a pain. I have a hacked version
> which will load into but not unload from Linux 2.6.4-rc2+kraxel263-1,
> if anybody wants it. I'd be especially interested in someone pointing
> me the patches necessary for more proper 2.6 support, but I should
> bring that to LIRC mailing lists.
>
> Forward, Rewind: Fine. Does seem to do it abruptly.
> Pause: when restarting, video freezes for a while. I found that strange.
> It starts again, though, in under 2 seconds.

Abrupt fwd and rev may be because of the seek in mplayer and then the
(sort of) reset on both the video and sound. The freeze should hopefully
be fixed with the new patch I am attaching. THIS IS UNTESTED, but it
does compile and the change was a one liner.

> Video: Decent. Dim; probably because bright day.
> Audio: Good. Behind. Will use your option.
>
>
> -----
> Test 3:
>
> Attempt DVD again. Can't mount DVD across NFS, either this way:
>
> server$ mount -t udf /dev/dvd /mnt/dvd
> server$ export /mnt/dvd client(ro)
> client$ mount server:/mnt/dvd /mnt/dvd
> [gives error here]
>
> or this way:
>
> server$ cp /dev/dvd /nfscommon/foo
> client$ mount -o loop /nfscommon/foo /mnt/dvd
> [gives error here]
>
> They both give the Same mount error message: "Permission denied".
> Does anybody know why this happens in linux 2.6 that is easy to fix?
>
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -zoom -quiet -framedrop -vo ivtv \
> -delay -1.15 \
> -dvd-device /v/manual/dvd dvd://1
>
> Found the problem. No program at 1. Had to go to 2. Duh.
>
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -zoom -quiet -framedrop -vo ivtv \
> -delay -1.15 \
> -dvd-device /v/manual/dvd dvd://2
>
> Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
> VO: [ivtv] 720x480 => 854x480 Mpeg PES [fs] [zoom]
>
> $ vmstat 1
> procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
> r b swpd free buff cache si so bi bo in cs us sy id wa
> 0 0 1892 1572 5020 45256 1 1 67 18 1075 244 4 2 90 4
> 0 0 1892 1352 5020 45456 0 0 0 0 1367 1078 7 3 90 0
> 0 0 1892 1660 5020 45160 0 0 0 0 1381 1119 7 4 89 0
> 0 0 1892 1464 4988 45380 0 0 0 0 1364 1103 7 4 89 0
> 0 0 1892 1408 4848 45588 0 0 0 0 1373 1050 7 4 89 0
>
> Video: Too tall (bad aspect), but otherwise great.
> Audio: Because it is NOVA, there is almost no synchronized speech, so I
> could not test synchronization easily, however, audio works.
> FF, Rew: Good.
> Pause: same problem: audio starts immediately, video after.
>
> This DVD is sure dumb. Anyway, I will attempt to try fixing aspect.
> As you can see, CPU was quite good.
>
> No time to fix aspect. -fs -zoom in x11 on other non-'350 host is OK.
> Not sure how to fix aspect with '350.
>
> -----
> Test 4:
>
> Try out that TS SDTV stream again; it's 4:3 aspect (704x480), so
> should be better. Taking out "-zoom" to see what happens, and adding
> delay.
>
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -quiet -framedrop -vo ivtv /v/manual/sg1/6/616.Metamorphosis.ts \
> -delay -1.15
>
> Wooooowwowowoa!!!! Results:
>
> Sound: Ok.
> Video: Not:
>
> - rainbow random lines
> - random cut ins and cut outs
> - rare little glimpses of moving video, sometimes taken
> from a different time earlier in stream, sometimes at what might
> have been right time
> - pauses where image would stick with flashing back and forth

I do get this once in a while. No idea yet what causes it YET, but
seeking usually fixes it.

>
> These streams are error-prone, but this one isn't that errory.
> Furthermore, their aspect is different. Should I be setting some
> values in kernel drivers (ivtv) to get it to interpret these streams
> better (e.g., stream_type; is that even used for OUT (decode
> MPEG-encode TV))?
>
> Pause, FF, and Rew worked, but didn't improve above situation.
>
> -----
> test 5
>
> I'll try once more with zoom:
>
> /usr/local/bin/mplayer -ao 'alsa9:hw,0,0' -autosync 30 -cache 8192 -fs \
> -quiet -framedrop -vo ivtv /v/manual/sg1/6/616.Metamorphosis.ts \
> -delay -1.15 -zoom
>
> Mar 8 15:01:02 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 15:25:17 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 15:29:18 O kernel: ivtv: ivtv_dec_timeout: starting...
>
> Last one was the one for last test; not sure when happened. Same
> problems as before (zoom didn't help).
>
> If I reencode stream first:
>
> mencoder -ovc copy -oac copy 616.Metamorphosis.ts -o out
> mencoder -ovc copy -vc ffmpeg12mc -oac copy 616.Metamorphosis.ts -o out
>
> neither helps; this time, only a blank screen.
>
> '350 is very picky about what type of stream it outputs.
>
> Now, I can't conduct other tests, because screen is blank, and no
> audio, at all, as if mplayer is getting stuck (?). dmesg didn't show
> anything different than above. I reloaded saa7127, ivtv, and reran
> test_ioctl with same values as before, and now at least working again.
>
> What other video streams should I try?
>
> Perhaps nuvs from MythTV? I don't have any; perhaps I can create
> some someday.
>
Actually my primary focus right now has been files that don't play with
mythtv player, currently for me this has been DVDs and other VOBs ripped
from DVDs.

>
> -----
> test 6
>
> I tried someone's recoded MPEG with same options and -zoom, and it had
> sound, but no video, like when it failed above. Got lots of this
> (at end): stops when I stopped:
>
> Mar 8 15:50:15 O kernel: ivtv: i_flags=42, 4 s_sflags=4, 5 s_sflags=0, 6 s_sflags=0, 7 s_sflags=8
> Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: lost IRQ; resetting...
> Mar 8 15:50:16 O kernel: ivtv: DMAP not set
> Mar 8 15:50:16 O kernel: ivtv: i_flags=42, 4 s_sflags=4, 5 s_sflags=0, 6 s_sflags=0, 7 s_sflags=8
> Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: starting...
> Mar 8 15:50:16 O kernel: ivtv: ivtv_dec_timeout: lost IRQ; resetting...
> Mar 8 15:50:16 O kernel: ivtv: DMAP not set
> Mar 8 15:50:16 O kernel: ivtv: i_flags=42, 4 s_sflags=4, 5 s_sflags=0, 6 s_sflags=0, 7 s_sflags=8
>
> I checked; it's a little over once a second (almost like one of those
> MPEG heartbeats).
>
> How do we purify MPEG for '350 output, especially without loosing
> audio sync quality? I'd rather not recode much, but recoding only
> video and not audio would be great, especially if all the sync data is
> the same. Then, I could recode for storage, and then later view on
> any system. I just need to know how. I'd rather keep the actual
> content of the video the same --- perhaps just open the MPEG stream,
> figure out how to make it '350 eligible, but not actually recompress
> it (therefore no loss).
>
>
>
>
>
> Well, so far, this is good news: we can now use mplayer to watch '250
> streams and 4:3 native resolution (740x480 for my out device) DVDs on
> a '350 out, with no CPU degradation. This is a really good thing, and
> is the first time this thing is actually usable for normal use for
> those purposes.
>
> To my knowledge, it still won't handle a wider range of MPEGs or
> aspect ratios, however, which effectively limits its range to its own
> realm. For instance, like I mentioned above, most DVDs do not work
> (wrong aspect and/or resolution), and TS streams containing 704x480
> 4:3 aspect do not work, despite working fine within mplayer with other
> output devices.
>
> It's starting to get time to submit these patches to mainstream
> mplayer. I know we're at pre level; try to make them easy to compile
> in, but not default, so it doesn't bug any reliability issues. If
> someone gets a promise that this will make it into the current release
> of mplayer, I'll code whatever if(option) s they need in order to
> support this, but that shouldn't stop you from doing that instead.
>
> Not much time to deal with this now.
>
I know the feeling.
>

kr



--
K.R. Foley
kr@cybsft.com
www.cybsft.com



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
Sorry. When I did go back and include the patch, my message got hung up
waiting on the moderator because it was too large. So here it is again.

kr

--
K.R. Foley
kr@cybsft.com
www.cybsft.com
Re: ivtv mplayer patch [ In reply to ]
All -

the 'correct' solution to this problem (DVD's being
streched to fullscreen) is to change the window size
(and possibly location) that the pvr350 decodes to (it
doesn't have to be fullscreen)

the mpeg decoder on the pvr card with scale the video
down to letterbox for you once this is set

unfortunately, to my knowledge the calls to change the
output window size have never been explicitly
implemented. You'll have to use the fwapi ioctl *or*
write a patch.

-tmk

--- Matthias Badaire <mbadaire20@yahoo.fr> wrote:
> >>> This sounds like you left the dvd:// in the
> mplayer command line or
> >>> something
> >> Yup. So, DVDs work, but with wrong aspect unless
> they're originally
> >> 4:3, as mentioned below. Is there a way to set
> the MPEG decoder/TV
> >> encoder aspect to be something other than full
> screen?
>
> -vf expand=720:576
>
> The problem with this command is that mplayer
> re-encore your stream to mpeg1video and it takes
> afew more CPU cycles ....
> M


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
From: "K.R. Foley" <kr@cybsft.com>
Subject: Re: [ivtv-devel] ivtv mplayer patch
Date: Tue, 09 Mar 2004 19:59:53 -0600

" >> Forward, Rewind: Fine. Does seem to do it abruptly.
" >> Pause: when restarting, video freezes for a while. I found that
" >> strange.
" >> It starts again, though, in under 2 seconds.
" >
" >
" > Abrupt fwd and rev may be because of the seek in mplayer and then
" > the (sort of) reset on both the video and sound. The freeze should
" > hopefully be fixed with the new patch I am attaching. THIS IS
" > UNTESTED, but it does compile and the change was a one liner.

" Sorry forgot to attach the patch.

That took me a while to test. Sorry. Yes! That fixes it. Well, it
still paused a little bit, but it seems more normal now, and doesn't
have jitters, cutting, etc. This seemed to work. I used it today to
watch something (out of three --- first was with old mplayer patches,
which had loads of problems, second was with your 03 patch, and third
your 04 patch). Unfortunately, I've developed a problem in mplayer
with a lot of files (of various types), with or without your patch,
where seeking back will seek all the way back to the beginning, and
this was one of them (recorded on '350 a day earlier). I'm not sure
if that's related in any way, but I thought I'd mention it just in
case.

I just saw kevin thayer <nufan_wfk@yahoo.com>'s message about being
able to change window size & maybe location pvr350 decodes to which
will then scale the video down to letterbox. This sounds so exciting
I am going to glance at the fwapi ioctl myself; a simple search
revealed Chris Kennedy has a fwapi program someplace. I'll go look at
that now.

(P.S., what's a mailbox when CK is referring to it here? I could
probably figure it out if I tried, but someone could probably just
explain it in a simple sentence or two ... or tell me the message-id
of any message where it was already answered. I mean, I can start
guesses like it's a queue for commands being sent to the card's
malleableware or something.)


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
" I just saw kevin thayer <nufan_wfk@yahoo.com>'s message about being
" able to change window size & maybe location pvr350 decodes to which
" will then scale the video down to letterbox. This sounds so exciting
" I am going to glance at the fwapi ioctl myself; a simple search
" revealed Chris Kennedy has a fwapi program someplace. I'll go look at
" that now.

Well, that worked. I used Chris Kennedy's ivtv-0.1.9-osdstream-84.tar.gz's
utils/fwapi:

fwapi -dec -mbox_put 0 -cmd 86 -data1 720 -data2 360 -data3 0 -data4 60

From the API, that's command $56, Param[0...3]={width, height,
top left horizontal offset, top left vertical offset}.

Is that the right mailbox # (should the fwapi command check to see
what mailboxes are available first, and hang around waiting for one)?
Am I right to think my NTSC display device is a 720x480 device? Does
the test_ioctl output size affect this (I don't feel like testing that
right now, but right now it's set to 720x480))? Is a 16:9 aspect
source at 720x480 (typical DVD) supposed to go into a 720x360 window
like I made above?

I'm seeing black above and below a window, and black above and below
that, for a 4:3 stream I have from the '350. For some reason, Lord of
the Rings won't play there. I'll have to try other discs or
something.

This is how I calculated: 480/((16/9)/(4/3)). I am tired, and don't
have as many brain cells ready to do this as when I was younger, but
if I sat down and thought about it for a while, I would be able to
create one equation for any source resolution and aspect to any target
resolution and aspect, and this is a relatively easy problem. (Of
course, vertical position is just half the difference of the target
device height to the target window height
(480-(480/((16/9)/(4/3)))/2), assuming above is correct.) Since I
want to shove this message out, I'm not going to spend time figuring
that out right now. Hmm. Wait ... perhaps it's something like
sticking the ratio of the width in there; perhaps
TwH=TDH/(((SAW/SAH)/SW)/((TAW/TAH)/TDW)), where the letters stand for
"Source", "Target", "Width" (uppercase W), "Height", "Aspect",
"Display", and "window" (lowercase w) (so
360=480/(((16/9)/720)/((4/3)720))) ... but I haven't checked my math
so don't take this as meaning anything much yet. Oh no, that can't be
right --- I still need to stick target window width and source height
in there!

Of course, it's simple for most DVDs since the source & target device
have the same.

Now to see if I can somehow push that dumb DVD mpeg format into IVTV
some more. I don't know why it's freezing. My '350 recorded stuff
works fine (and gets squished according to above, even though the
particular program I tested with didn't need squishing, and now looks
squished!)

Duh. We should just patch mplayer to do this aspect fwapi stuff for
us! That would be totally awesome. A way to restore it to native
aspect would be nice (probably would have to get output, like
"test_ioctl -e", to know what to restore it to; just width=width,
height=height, offset 0,0, probably). Just what does "test_ioctl -e"
mean? If I set it to something else, what am I really telling it? No
time to research it tonight; sorry.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
> Well, that worked. I used Chris Kennedy's
> ivtv-0.1.9-osdstream-84.tar.gz's utils/fwapi:
>
> fwapi -dec -mbox_put 0 -cmd 86 -data1 720 -data2 360 -data3 0 -data4 60

FYI, that doesn't work in a previous version I had of CK's laying
around that I used for a while. Apparently, CK wrote a fwapi ioctl or
something?

I cannot get it to display DVDs for LOTR or SG-1 season 5 (disc 1
episode 1), despite being able to see previous seasons of SG-1, and
that one hokey Pyramid building Nova (I almost want to re-rent it just
to test this again). LOTR won't do anything (never plays a single
screen). SG-1 season 5 disc episode 1 will sometimes go into one
frame every once in a while mode, with very rare motion speed, and a
few partial green screens and junk like that. Is this something
special CK is doing with his driver for normal output mode?

Why do some MPEGs fail to go out '350 without lots of problems, but do
fine in mplayer, xine, avidemux2, mpeg2dec, ogle, etc.? Yes, I'm sure
they're MPEG2, because mplayer tells me so. I see this a lot with
DVDs. Some DVDs worked fine on the '350, and others not.
Time of day? Cache size? What?

All the MPEGs I record with the '350 are fine going back out of it.
Very few other ones do OK.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
The mailboxes are in the firmware and used to send API commands to
the card, there are 3 for the encoder firmware and 2 for the decoder.
So this was correct, and it really just pipes the command to the
mailbox API function which will scan the mailboxes and choose which
one from the number you choose (so if picking mailbox 2, will only
try 2-? (there are actually 20 mailboxes, so you would go into non-functioning
ones past 2 (0-2 is the third), so the tool really has few boundries
and can find if any other mailboxes work any other way). So cool,
everyone should hack at the card some like this and see what they
can get out of it.

Thanks
Chris

On Thu, Mar 11, 2004 at 03:31:52AM -0800, Ulmo-IVTV-Devel@Usenet.Q.Net wrote:
> " I just saw kevin thayer <nufan_wfk@yahoo.com>'s message about being
> " able to change window size & maybe location pvr350 decodes to which
> " will then scale the video down to letterbox. This sounds so exciting
> " I am going to glance at the fwapi ioctl myself; a simple search
> " revealed Chris Kennedy has a fwapi program someplace. I'll go look at
> " that now.
>
> Well, that worked. I used Chris Kennedy's ivtv-0.1.9-osdstream-84.tar.gz's
> utils/fwapi:
>
> fwapi -dec -mbox_put 0 -cmd 86 -data1 720 -data2 360 -data3 0 -data4 60
>
> >From the API, that's command $56, Param[0...3]={width, height,
> top left horizontal offset, top left vertical offset}.
>
> Is that the right mailbox # (should the fwapi command check to see
> what mailboxes are available first, and hang around waiting for one)?
> Am I right to think my NTSC display device is a 720x480 device? Does
> the test_ioctl output size affect this (I don't feel like testing that
> right now, but right now it's set to 720x480))? Is a 16:9 aspect
> source at 720x480 (typical DVD) supposed to go into a 720x360 window
> like I made above?
>
> I'm seeing black above and below a window, and black above and below
> that, for a 4:3 stream I have from the '350. For some reason, Lord of
> the Rings won't play there. I'll have to try other discs or
> something.
>
> This is how I calculated: 480/((16/9)/(4/3)). I am tired, and don't
> have as many brain cells ready to do this as when I was younger, but
> if I sat down and thought about it for a while, I would be able to
> create one equation for any source resolution and aspect to any target
> resolution and aspect, and this is a relatively easy problem. (Of
> course, vertical position is just half the difference of the target
> device height to the target window height
> (480-(480/((16/9)/(4/3)))/2), assuming above is correct.) Since I
> want to shove this message out, I'm not going to spend time figuring
> that out right now. Hmm. Wait ... perhaps it's something like
> sticking the ratio of the width in there; perhaps
> TwH=TDH/(((SAW/SAH)/SW)/((TAW/TAH)/TDW)), where the letters stand for
> "Source", "Target", "Width" (uppercase W), "Height", "Aspect",
> "Display", and "window" (lowercase w) (so
> 360=480/(((16/9)/720)/((4/3)720))) ... but I haven't checked my math
> so don't take this as meaning anything much yet. Oh no, that can't be
> right --- I still need to stick target window width and source height
> in there!
>
> Of course, it's simple for most DVDs since the source & target device
> have the same.
>
> Now to see if I can somehow push that dumb DVD mpeg format into IVTV
> some more. I don't know why it's freezing. My '350 recorded stuff
> works fine (and gets squished according to above, even though the
> particular program I tested with didn't need squishing, and now looks
> squished!)
>
> Duh. We should just patch mplayer to do this aspect fwapi stuff for
> us! That would be totally awesome. A way to restore it to native
> aspect would be nice (probably would have to get output, like
> "test_ioctl -e", to know what to restore it to; just width=width,
> height=height, offset 0,0, probably). Just what does "test_ioctl -e"
> mean? If I set it to something else, what am I really telling it? No
> time to research it tonight; sorry.
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> ivtv-devel mailing list
> ivtv-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel

--
---
Chris Kennedy / ckennedy@kmos.cmsu.edu
Engineer KMOS-TV/KTBG-FM
Broadcasting Services Department
Central Missouri State University


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
Re: ivtv mplayer patch [ In reply to ]
On Thu, Mar 11, 2004 at 04:41:54AM -0800, Ulmo-IVTV-Devel@Usenet.Q.Net wrote:
> > Well, that worked. I used Chris Kennedy's
> > ivtv-0.1.9-osdstream-84.tar.gz's utils/fwapi:
> >
> > fwapi -dec -mbox_put 0 -cmd 86 -data1 720 -data2 360 -data3 0 -data4 60
>
> FYI, that doesn't work in a previous version I had of CK's laying
> around that I used for a while. Apparently, CK wrote a fwapi ioctl or
> something?

Yes, this is best used in version #84, which besides having an odd
X windows display bug which I'm working on :-).

>
> I cannot get it to display DVDs for LOTR or SG-1 season 5 (disc 1
> episode 1), despite being able to see previous seasons of SG-1, and
> that one hokey Pyramid building Nova (I almost want to re-rent it just
> to test this again). LOTR won't do anything (never plays a single
> screen). SG-1 season 5 disc episode 1 will sometimes go into one
> frame every once in a while mode, with very rare motion speed, and a
> few partial green screens and junk like that. Is this something
> special CK is doing with his driver for normal output mode?

Strange, I'm not sure why it is doing that, is this the same in #84,
in 0.1.9, interested if there's any api commands being done to get
it into this state?

>
> Why do some MPEGs fail to go out '350 without lots of problems, but do
> fine in mplayer, xine, avidemux2, mpeg2dec, ogle, etc.? Yes, I'm sure
> they're MPEG2, because mplayer tells me so. I see this a lot with
> DVDs. Some DVDs worked fine on the '350, and others not.
> Time of day? Cache size? What?
>
> All the MPEGs I record with the '350 are fine going back out of it.
> Very few other ones do OK.

There is something with the headers, and never has an end of stream
currently set at the end (maybe need to do that in the driver, actually
should be the apps that use the driver to record which do it probably,
which I have to do in my dvr stuff). I think Hans may know more on
this since he had studied it some with the VBI reinsertion, and saw
our Mpegs are actually not perfect and the headers contain some crud.

Thanks,
Chris
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> ivtv-devel mailing list
> ivtv-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel

--
---
Chris Kennedy / ckennedy@kmos.cmsu.edu
Engineer KMOS-TV/KTBG-FM
Broadcasting Services Department
Central Missouri State University


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

1 2  View All