Page 1 of 1

cache handling - immediately start playing from cache

Posted: 11 Apr 2008 14:33
by mezza
i had a problem playing video files over wireless lan and increasing cache solved this problem. now i noticed that vlc does not start playing until the cache is fully loaded.
when i set cache to 10 seconds for example (i now it is much but it's an example to show what i mean) and then click play OR shift time within the same movie i always have to wait until the cache is full – in the example-case this means that i have to wait 10 seconds. it's not really a problem if i just play a file but if i want to search a specific part within the file and skip a few times it becomes very awful!
is it possible to start playback if cache is full enough to play and not to wait until cache is fully loaded (like a flash-webplayer)?!?

there are two more problems with cache-increase...
first problem: when i set the cache to 10 seconds (see example above) the video starts playing after 10 seconds and the timer is then set to 0:00:10 then the played video is at 0:00:01 (starting to play). this means that the timer does not have the same time as the displayed video because of cache-delay.
second problem: by clicking the PAUSE-button the pause-symbol is displayed but the video stops playing (pause) after cache is empty, this means after 10 seconds and if i want to replay i have to wait 10 seconds again.

things i noticed with std-cache of 300ms:
my wlan is not very strong and i sometimes have some short breaks and this causes interrupts in video-playback.
if i pause the playback and replay it after some time (a few minutes) the video does play 300ms (std-cache) and then stops and does not start again until i press STOP and PLAY and skip to the position i was before. i think that the wlan does not respond within these 300ms and then the player thinks that the file is not available anymore.
both problems can be solved with a cache-setting (file) greater then 3 seconds. with less than 3 seconds the problem still exists and with 3 and more seconds i have to live with the awful concequences i wrote earlier in this text!

so i see two problems need to be solved:
1. the cache-problem (play, pause, skip an timer - DELAYS)
2. more tolerance for files that do not immediately respond after pause/wait/play for example on slow wlans or power-save-shutdown hard drives

Re: cache handling - immediately start playing from cache

Posted: 24 Apr 2008 17:51
by DGMurdockIII
thyis could be usefull

Re: cache handling - immediately start playing from cache

Posted: 30 Apr 2008 00:40
by mezza
For the record:
After my post i found out that I could get some vlc-error-feedbacks on the "console" and i tested the wireless-lan - pause/wait/play - problem. the message vlc prints at the console is the following:

[00000505] access_file access error: read failed (Invalid argument)

this line is repeated very frequently and doesn't stop showing (a thousand times and more :o). BUT when i press stop/play and skip forward to the previous pause-position then the playback of the SAME FILE works fine! i think there's a problem with vlc replaying paused files on ressources that don't respond immediately (doesn't matter how ofthen vlc tries to replay them).

Re: cache handling - immediately start playing from cache

Posted: 23 Oct 2008 07:02
by hschulze
It seems to me that the cache should always read ahead as fast as it can until full, for any input module, and not matter if the user presses pause or not. If you do something like rewind, you will have to refresh the cache, or reverse it's direction (read chunks in -ve time).
The player (data eating portion) would be best off resuming when 1..n frames or seconds of playback (settable) are available, typically 2/25ths sec or more (default?).
Otherwise the player should not tell or ask the cache anything else, just ask for the data.
Right now it seems that the UI controls what the cache does, and not the player.

Ultimately, it would be great to time the requests vs replies for data into the cache (good for disk vs slow network detection), and calculate a mean dropout from timeouts rate, and leave time for 2x..3x the response time (first request fails, time for second request to complete before cache is empty). Since 2.4GHz phone calls can interfere with Wiki at any time, but usually (hopefully) for a few minutes only, a sliding stats window of maybe 10-20 requests might be enough to adjust for new network garbage. Also, Wifi speeds do change depending on interference.

As an alternative, I wouldn't mind telling my disk host PC to push the data, but in a way I could "play" at my leisure.
I have had an FTP server set up a while ago and tried it, didn't have much luck at reducing the need for caching, or getting better playback.
Or maybe it isn't the mobility /overhead impact of MSNetworking causing any issue, it's the way the caching works?

Re: cache handling - immediately start playing from cache

Posted: 25 Oct 2008 04:43
by Jean-Baptiste Kempf
It seems to me that the cache should always read ahead as fast as it can until full, for any input module, and not matter if the user presses pause or not. If you do something like rewind, you will have to refresh the cache, or reverse it's direction (read chunks in -ve time).
Why would it should work like that?

I disagree. Why use more bandwidth than what you need?

Re: cache handling - immediately start playing from cache

Posted: 13 Jun 2009 06:27
by DGMurdockIII
yes

Re: cache handling - immediately start playing from cache

Posted: 14 Jun 2009 14:29
by VLC_help
DGMurdockIII:
Please don't wake up old threads if you don't have anything new to add.