8

I've been trying to get XBMC (Raspbmc to be exact) working om my Raspberry Pi. After hours of work and a lot of stupid mistakes (who knew FAT32 wasn't made for Linux), I made it work.

But now I'm troubling with the screen being to big for my tv. So I googled some more and found out I had to change the config.txt file on the SD card. The original contents where like this:

arm_freq=800disable_overscan=1

I learned that I could set the different overscan values (left, right, top, bottom) to solve this problem. So I changed the config.txt file to this:

arm_freq=800
overscan_left=64
overscan_right=64
overscan_top=64
overscan_bottom=64

But now the Raspberry Pi doesn't recognize the SD card anymore. And when I change it back to a single line it works, but it doesn't do anything with the overscan values. So my idea is that it has to be something with the line breaks in the file. I'm using Windows 7 and Notepad to change the config.txt file.

How can I fix this problem?

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
Rick Hoving
  • 657
  • 1
  • 8
  • 7

2 Answers2

6

This is a classic line-endings problem.

Text files created on DOS/Windows machines have different line endings than files created on Unix/Linux. DOS uses carriage return and line feed ("\r\n") as a line ending, which Unix uses just line feed ("\n"). You need to be careful about transferring files between Windows machines and Unix machines to make sure the line endings are translated properly. (Source)

Either you can access the Raspberry Pi via ssh and as root type:

awk '{ sub("\r$", ""); print }' /boot/config.txt > /boot/config.txt

This will convert the line endings from Windows to Unix by removing the carriage return \r.

Or if you are in Windows you can use the application dos2unix, which can be downloaded here.

Or apparently Notepad++ will arrange things for you (credit to Steve Robillard).

Jivings
  • 22,656
  • 11
  • 94
  • 140
2

OK, it looks like a line-ending issue. You have to change the line endings, and the easiest way to do this is with Vim:

vim config.txt

:set ff=unix

:wq
Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
okertanov
  • 609
  • 4
  • 2