"Large" files on SD cart

Is anyone else experiencing any problems with "large" (1KB+) files on SD card? I am working on my own LCD+SD shield (160x128 lcd from an epson printer) and I have a problem with reading image from sd card while sending it to lcd. I seem to only get ~400 bytes and then it just stops.
I've hooked everything to logic sniffer and I found out something interesting. Despite my code is designed to read each byte and send it to lcd what ardu actually does is read part of the file when "inFile=SD.open("1.lcd");" is called and does not communicate with SD card on "myFile.read();" calls.
How can I actually read something outside the area that was read on "open()"?

inFile = SD.open("1.lcd");
  
  digitalWrite(CS_LCD, 1);  
  writeLcd(startDraw);
  while(inFile.available()){
    digitalWrite(CS_LCD, 0);
    buffer = inFile.read();
    digitalWrite(CS_LCD, 1);
    SPI.begin();
    SPI.transfer(buffer);
    SPI.end();
  }

SD cards are block devices. When you read the first byte, 512 bytes are read from the file into a block buffer. the next 511 bytes are read from the block buffer.

When you call SPI.end() the SPI controller is disabled. The SD.h library does not expect this so it fails on the next block read.

Put the SPI.begin() in setup() and remove the SPI.end().

You could even omit the SPI.begin() since SD.begin() initializes the SPI bus.

Thanks, that explains a lot. Meantime I've already tried using SdFat library instead (without removing SPI begin and end calls) and It worked, but a bit slower. Now when SPI begin and end calls are removed it works fine and a bit faster then with SdFat.

I've already tried using SdFat library instead (without removing SPI begin and end calls) and It worked, but a bit slower.

Yes, I modified SdFat to cope with SPI.end() calls. SD.h is a wrapper for a very old version of SdFat that does not have that feature.

The call to SPI.begin() is very time consuming and is only required once. It adds about 20 microseconds when you call it for every byte.

SPI.end() only clears the enable bit in the SPI controller so it adds no time to re-enable the SPI controller since I write that controller register anyhow in SdFat.

Thank you for quick and complete answers and great libraries, my lcd + sd module is working now.