You are not logged in.

#1 2008-06-10 23:59:54

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Video playback is hiccupping; needs to stop.

Sometimes when I'm watching video (usually on vlc, but mplayer does the same thing), the video will freeze for a moment. This is not a problem in the file. When this happens, I usually hear the hard drive working up a mighty load, so I'm guessing this is a problem of the system thinking there's something more important at that moment than showing me the video I'm watching. Since my PC is my primary multimedia platform, I'd like to know a way of telling my system that when I'm watching a video, there's [nothing] more important that showing me that video in as close to realtime as possible; if the way to go is nice (even though I understand nice only cares about CPU, and I'm pretty sure this problem is a HD bottleneck issue), please tell me how to nice up vlc and mplayer far enough that even the kernel can go fuck itself. Otherwise, tell me how to do the same thing with all system resoursces. Seriously, if vlc is running, and anything thinks it needs resources that vlc needs, I want it to shut up, sit down, and think about what it did.
On the other hand, if you think this is a completely different problem, please tell me where to start looking, because honestly, I agree with you; my PC is good enough that it should be able to show me a 700MB file of about 2 hours length without hiccuping.

The only meaningful information I can think to post right now is the output of hdparm:

 hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
    Model Number:       SAMSUNG HD501LJ                         
    Serial Number:      S0MUJ1DP621925      
    Firmware Revision:  CR100-10
    Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5
Standards:
    Used: ATA-8-ACS revision 3b 
    Supported: 8 7 6 5 
Configuration:
    Logical        max    current
    cylinders    16383    16383
    heads        16    16
    sectors/track    63    63
    --
    CHS current addressable sectors:   16514064
    LBA    user addressable sectors:  268435455
    LBA48  user addressable sectors:  976773168
    device size with M = 1024*1024:      476940 MBytes
    device size with M = 1000*1000:      500107 MBytes (500 GB)
Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, no device specific minimum
    R/W multiple sector transfer: Max = 16    Current = 16
    Recommended acoustic management value: 254, current value: 0
    DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 udma7 
         Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4 
         Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
    Enabled    Supported:
       *    SMART feature set
            Security Mode feature set
       *    Power Management feature set
       *    Write cache
       *    Look-ahead
       *    Host Protected Area feature set
       *    WRITE_BUFFER command
       *    READ_BUFFER command
       *    NOP cmd
       *    DOWNLOAD_MICROCODE
            SET_MAX security extension
            Automatic Acoustic Management feature set
       *    48-bit Address feature set
       *    Device Configuration Overlay feature set
       *    Mandatory FLUSH_CACHE
       *    FLUSH_CACHE_EXT
       *    SMART error logging
       *    SMART self-test
       *    General Purpose Logging feature set
       *    64-bit World wide name
       *    Segmented DOWNLOAD_MICROCODE
       *    SATA-I signaling speed (1.5Gb/s)
       *    SATA-II signaling speed (3.0Gb/s)
       *    Native Command Queueing (NCQ)
       *    Host-initiated interface power management
       *    Phy event counters
            DMA Setup Auto-Activate optimization
            Device-initiated interface power management
       *    Software settings preservation
       *    SMART Command Transport (SCT) feature set
       *    SCT Long Sector Access (AC1)
       *    SCT LBA Segment Access (AC2)
       *    SCT Error Recovery Control (AC3)
       *    SCT Features Control (AC4)
       *    SCT Data Tables (AC5)
Security: 
    Master password revision code = 65534
        supported
    not    enabled
    not    locked
        frozen
    not    expired: security count
        supported: enhanced erase
    168min for SECURITY ERASE UNIT. 168min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000f001b621925
    NAA        : 5
    IEEE OUI    : f0
    Unique ID    : 01b621925
Checksum: correct

I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#2 2008-06-11 07:03:26

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Video playback is hiccupping; needs to stop.

Check with top and iotop what might be using your resources while it happens, use nice/ionice to start vlc/mplayer with a higher priority, set up bigger cache for local files (mplayer only?).

Offline

#3 2008-06-11 14:27:29

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Re: Video playback is hiccupping; needs to stop.

Wow, learned something new. I didn't know top and nice had I/O brethren. I'll try that. Is there a way of giving vlc a higher priority by default?


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#4 2008-06-11 16:31:39

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Video playback is hiccupping; needs to stop.

It actually seems that processes get started with nice 0 and io priority 0 (highest ones available for non-root users), so the solution would be to lower the priority of the offending process. Setting shell aliases should allow you to start processes with set priority.

Offline

#5 2008-06-11 18:15:36

Zer0
Member
From: Windsor, ON, Canada
Registered: 2006-08-25
Posts: 299

Re: Video playback is hiccupping; needs to stop.

Power management maybe?  Maybe the HDD is spinning down while watching a movie and then when the system decides to do something else.. the HDD spins back up.  Make sure no HDD power crap is enabled in the BIOS etc..

Then again, it's just a very wild guess on my part and you probably don't have it set to enabled.  But ya never know

Offline

#6 2008-06-12 12:10:54

UnbreakableMJ
Member
From: Bahrain
Registered: 2007-05-24
Posts: 29
Website

Re: Video playback is hiccupping; needs to stop.

kamagurka wrote:

... Is there a way of giving vlc a higher priority by default?

Yes. If using vlc 0.8.6, go to preferences -> check to see the advanced options -> choose Advanced from the left and adjust priority as you like.

For vlc 0.9 (nightly or git): tools -> preferences -> show settings: all -> choose Advanced from the left and adjust priority as you like.

Or even better, as lucke's suggestion; add lines like these to ~/.bashrc with changing the numbers as you like:
alias vlc='nice --adjustment=-5 vlc'
alias vlc-nightly='nice --adjustment=-3 vlc-nightly'
etc..

Offline

Board footer

Powered by FluxBB