LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Jerky video playback (https://www.linuxquestions.org/questions/linux-general-1/jerky-video-playback-145964/)

hand of fate 02-14-2004 08:22 AM

Jerky video playback
 
I am using a dual boot system win WinXP home and SuSE 9 pro.

When I play DVD videos under Linux, using either Mplayer or Ogle, the video always seems a bit jerky, and sometime slightly out of sync with the sound. I have no such problem under Windows. Also some websits with Flash Player animations seem jerky.

Is this a problem I can solve, or is it that Linux is not as good for multimedia playback a Windows?

LinuxLala 02-14-2004 08:26 AM

Maybe it has to do with ur RAM, 'caue I think Linux needs more RAM than windoze. I think I saw a discussion on this here.

hand of fate 02-14-2004 04:04 PM

I've got 192 MB of RAM, whick I would have thought would be enough for most purposes, considering that many Linux distributions claim to be able to run on much older systems.

Chris H 02-14-2004 04:27 PM

As root type

hdparm -d1 /dev/hd*

where hd* whatever your dvd drive is set up as.

adz 02-14-2004 11:08 PM

Did you install mplayer from source? It run incredibly well when compiled from source and supports everything. Also, which version are you using?

As an aside I had a similar problem once. All was well until my power supply fried. It seemed to affect linux more than windows. I didn't get anything as bad as you are but it was jerky and the sound would periodically cut out. I never solved it since I didn't know about hdparm then and now I use a different box where I have the same (if not better) video playback under linux.

One other thing is what audio drivers are you using?

LinuxLala 02-15-2004 12:48 AM

192 MB RAM should be enough. Follow Chris H's advice. Let's see what turns up. :)

exodist 02-15-2004 01:26 AM

jerky video is usually ide problems, however it can also happen when cpu/mem is overused, or if you are using say XShm when XV is available, etc, try -vo help and switch choices see if any go faster

hand of fate 02-19-2004 05:07 PM

I tries hdparm as Chris H suggested, and I got the message "/dev/sr0 not supported by hdparm
". I'm no Linux expert, so I don't really know what this means.

I can't remenber which version of Mplayer I used, but I've since removed it from my PC, and only use Ogle for DVDs. I do remember that it was installed using three rpm files simultaneously.

The Flash player problem doesn't seem so bad now, so maybe that was unrelated.

adz 02-19-2004 07:24 PM

Is your drive pure SCSI or justr SCSI-emulated? If emulated then you have to point hdparm to the IDE name of your drive (ie hda, hdb, hdc, etc).

hand of fate 02-22-2004 03:22 PM

Sorry I don't know, adz. As I don't really know hat much about computers, can you tell me how to find out, please?

megaspaz 02-22-2004 05:27 PM

you could just do:

/sbin/hdparm -I /dev/hdb
/sbin/hdparm -I /dev/hdc
...
...
...

until you find the output that matches your dvd manufacturer. not very elegant but pretty easy.

adz 02-22-2004 07:38 PM

Well pure SCSI means it has a different kind of cable (slightly wider). If it's emulated then it's a regular IDE drive just being made to look like a SCSI through software. If you type /bin/lsmod and see a line saying "ide-scsi" then there's a good chance it's emulated. Basically, do what megaspaz said.

hand of fate 02-23-2004 12:02 PM

Thanks, it turns out that my CD/DVD drive is in fact /dev/hdc. When I do /sbin/hdparm -I /dev/hdc, I get:

/dev/hdc:

ATAPI CD-ROM, with removable media
Model Number: COMBI RW16x10/DVD
Serial Number: 5VO2235DR00837
Firmware Revision: N1.1
Standards:
Likely used CD-ROM ATAPI-1
Configuration:
DRQ response: 50us.
Packet size: 12 bytes
Capabilities:
LBA, IORDY(cannot be disabled)
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 *udma4
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
HW reset results:
CBLID- above Vih
Device num = 0



Does anything in that show what might be making DVD palyback jerky?

adz 02-23-2004 07:34 PM

Try an hdparm -tT /dev/hdc. This does a (not very very indicative of real world situations) test. It can be helpful, though. Then look at the options -a, -b, -c, -d and -m. See if changing any of these parameters either incereases your test score or your DVD playback quality. Look especially at "-d".

megaspaz 02-23-2004 07:46 PM

basically do as root:
/sbin/hdparm -v /dev/hdc

look at the output line starting with using_dma = X

where X is either 0 or 1. if it's 0, use this command:

/sbin/hdparm -d1 /dev/hdc

hopefully dma will be set in the output and not set then unset due to an error of some kind. if dma won't enable, post back and we'll handle that situation.

hand of fate 02-27-2004 06:00 AM

Thanks megaspaz, it's much better since I enabled dma.

aes canis 05-09-2005 10:12 AM

I read through this (and a few other related topics) because of jerky DVD video playback.
I tried several of megaspaz's tips, and things are a bit better - the picture is clearer (no horizontal lines) but it still freezes every second or so.

I tried -a1 -c1 /dev/dvd, and got:
Code:

/dev/dvd:
 setting fs readahead to 1
 setting 32-bit IO_support flag to 1
 IO_support  =  1 (32-bit)
 readahead    =  0 (off)
:~ # hdparm -a1 /dev/dvd

then hdparm -a1 /dev/dvd, but still get:
Code:

/dev/dvd:
 setting fs readahead to 1
 readahead    =  0 (off)
:~ # hdparm -a1 /dev/dvd

Does this mean that 'readahead' is not being enabled?

The overall system specs are:
AMD K6-2 450MHz o/ced to 500MHz
512MB RAM
ATi Radeon 7500 with 3D Acc enabled
Toshiba DVD-ROM SD-M1202 with DMA enabled.

I know it's nothing close to modern, but it played DVDs OK when running Windows 98, had an 8MB graphics card and was at 450MHz.

adz 05-09-2005 07:38 PM

Did you enable DMA with the "-d" option?

aes canis 05-10-2005 11:32 PM

Yes, but DMA is already enabled (through YaST) from boot up on all drives.

I now get readahead enabled, and the picture quality is better, that is, no ghosting, but it is still jerky.

before running Xine, in a terminal I type:
hdparm -a1 -b1 -c1 -d1 /dev/dvd

This ensures that readahead, 32 bit IO support, DMA and something else (not sure what the "bus state" is...)

One other question, how do I set readahead to be enabled by default at boot up?
What file do I need to edit?

fragos 05-15-2005 08:48 PM

Can't set DMA on either
 
I've been following this thread because I can't set DMA for my new DVD ROM /dev/hdc. I also have an /dev/hdd which is a CDRW and am running SuSE 9.3. Command line konsole outputs for the commands outlined in the thread follow:

fragos@linux:~> su
Password:
linux:/home/fragos # hdparm -d1 /dev/hdc

/dev/hdc:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)
linux:/home/fragos # hdparm -d1 /dev/hdd

/dev/hdd:
setting using_dma to 1 (on)
using_dma = 1 (on)
linux:/home/fragos #

linux:/home/fragos # hdparm -I /dev/hdc

/dev/hdc:

ATAPI CD-ROM, with removable media
Model Number: LITE-ON DVD SOHD-16P9S
Serial Number:
Firmware Revision: FS07
Standards:
Used: ATAPI for CD-ROMs, SFF-8020i, r2.5
Supported: CD-ROM ATAPI-2
Configuration:
DRQ response: 50us.
Packet size: 12 bytes
Capabilities:
LBA, IORDY(cannot be disabled)
DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=227ns IORDY flow control=120ns
linux:/home/fragos #

linux:/home/fragos # hdparm -tT /dev/hdc

/dev/hdc:
Timing cached reads: 704 MB in 2.00 seconds = 351.53 MB/sec
Timing buffered disk reads: 4 MB in 3.70 seconds = 1.08 MB/sec
linux:/home/fragos #

linux:/home/fragos # hdparm -v /dev/hdc

/dev/hdc:
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
HDIO_GETGEO failed: Invalid argument
linux:/home/fragos #

adz 05-16-2005 09:45 AM

Well I'm out of ideas. I did have jerky playback once after I fried my power supply. Never solved it but I didn't know about hdparm back then... So I guess I just don't know.

Jongi 06-05-2005 03:52 AM

One the command below is run, is it set forever as such or is there a file I will need to edit to make the change permanent

Code:

/sbin/hdparm -d1 /dev/hdb

exodist 06-05-2005 10:23 AM

you need to add it to a script, reboot will reset the change

fragos 06-05-2005 07:01 PM

If you use YaST to turn DMA on it will be a permanent change. For me, I find command line great for diagnosis but since I often have to ask where to make things permanent -- I use YaST for most configuration tasks. By the way, my problem turned out to be two fold. First the replacement drive I bought had a hardware problem. The second was a configuration issue which I solved by using mplayer and kmplayer. Kmplayer sets up xine and mplayer with an easy to use GUI. I'm back to my older DVD-ROM and all works well. :)

Jongi 06-06-2005 09:28 AM

Oh yeah I figured that YaST would solve all


All times are GMT -5. The time now is 06:40 AM.