7

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?

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).

| improve this answer | |
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
| improve this answer | |
  • I can only access the config file on my windows 7 machine. When I boot the RPi XBMC automatically starts up and I cant get to the config file – Rick Hoving Jul 24 '12 at 14:29
  • @RickHoving I believe you can access the file by using SSH to access your Pi. If that doesn't work, you may want to look at notepad++ which has an option to maintain Linux line endings. – Steve Robillard Jul 24 '12 at 15:50
  • @SteveRobillard - Or just use a PC version of Vim. – Mark Booth Jul 25 '12 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.