Optimize XBMC on Apple TV for network video streaming
#1
Lightbulb 
Hi everyone,

I just got a new Apple TV, running 2.3, with XBMC 8.10 Atlantis, Nito TV, ATVFiles and all the other cool stuff and I love it.

But after adding shared network folders (SMB and NFS) with my movie / tv libraries to XBMC as sources, I realized that XBMC had difficulties playing my movies, some of them were dropping frames, some just looked jerky and some were fine.

Since I have a lot of videos and all kinds of different containers MKV, AVI, MP4, MPG with lots of different codecs like DivX, H264, MPEG-2 etc., I am hesitant to convert all of them to the same format and add them to my iTunes lib. After all, this is what XBMC was made for, right?

So I did some research, read the forums and realized that XBMC's biggest problem on ATV is that it can't use the GPU to help decoding the videos due to the lack of knowing the nVidia GPU API (please correct me if I'm wrong here).

This lead me to the conclusion that the only way to approach my problems was trying to find the optimized killer settings for XBMC in order to stream H264 720p videos over the network (yes, I know about the bandwith limit and yes, the network speed is fine, I tested it). But reading similar threads here and in other forums, I found many different approaches / settings and so I though it would make sense to have a single thread where we collect all tweaks and tips and settings to find THE ideal solution for optimizing XBMC.

I'll just start with what I have and hope that you guys with a similar setting help me add / modify this so that we'll have some kind of a guide to set up XBMC. I'll try to edit / update this post whenever you guys add / change something.


OPTIMIZED XBMC SETTINGS FOR BEST VIDEO PLAYBACK PERFORMANCE
---------------------------------------------------------------------------------------------------
1. Skin: Use the 'Focus' skin as it needs less memory than the others
(Correction: Recent comparisons between the MediaStream Skin v1.0 and Focus do NOT seem to show any differences)
2. Menu sounds: OFF
3. RSS Feeds: OFF
4. Webserver: OFF
5. uPNP Client / Server: OFF
6. FTP Server: OFF
7. Loglevel: 0
8. Video Settings Deinterlacing: Disabled
9. Vertical Sync Setting: Always Enabled
10. Skiploopfilter setting: 8
Open the file /Library/Application Support/XBMC/userdata/advancedsettings.xml (via SSH / SFTP)
and change the value from 48 to 8:
<advancedsettings><skiploopfilter>8</skiploopfilter></advancedsettings>
11. Cache (Network / Video / Audio):
Increasing the cache sizes might help, I have set them to the max, but I'm not sure it did anything for me.
12. Library function: OFF
(Update: For some reason this really made a difference and improved video playback a lot.)


Best,
Randy.
Reply
#2
Still running 2.2 on AppleTV but I do get the impression that video decoding of 8.10 Atlantis is not as smooth compared to the earlier betas.

I also get very brief sound dropouts via optical maybe every 20 mins or so which i don't with AppleTV itself or other sources.

Good thread though, as I was considering something similar myself to list optimal settings for this platform.
Reply
#3
Interesting, I haven't experienced any sound problems so far, only dropped frames in video and sometimes jerky frames. I have my ATV connected to my Sony LCD via HDMI and Optical Audio Out.

Also, I read a lot about enabling the "Vertical Sync" setting, but it doesn't do anything for me. Can someone explain what it actually does?

Randy.
Reply
#4
randywaterhouse Wrote:Also, I read a lot about enabling the "Vertical Sync" setting, but it doesn't do anything for me. Can someone explain what it actually does?

It will attempt to ensure that the current image frame doesn't change as the TV is displaying that frame which can lead to artefacts/tearing.

It causes the device to wait until the current frame has been updated on the TV before allowing that frame to change in the computer/AppleTv video output RAM.
Reply
#5
SecretSquirrel Wrote:It will attempt to ensure that the current image frame doesn't change as the TV is displaying that frame which can lead to artefacts/tearing.

It causes the device to wait until the current frame has been updated on the TV before allowing that frame to change in the computer/AppleTv video output RAM.

Ok, that makes sense. But then again, shouldn't this lead to more frames being dropped as it needs to wait to update the frame first? It seems like you then have the choice of having either artefacts (which I haven't had yet) or clean but dropped frames. Am I right?
Reply
#6
Do you really need Nito? Nito makes my ATV too slow, even the welcome video when you boot drops frames after installing Nito. I installed Nito in the past only to run the Smart Installer and install the smb/nfs stuff, but now I am using the smb functionality from XBMC itself. Even removing the Nito plugin after running the smart installer does not help, I had to do a clean install to get rid of it.

I have my LAN buffer configured as 8MB, this does not have anything to do with performance, it will only prevent stuttering due to LAN problems, if you have your ATV wired you can use a lower value since wired networds are more steady.

There is a problem in XBMC when you have lots of files in the same directory, it will take really long to start playing. You can check my comments in this thread:

http://forum.xbmc.org/showthread.php?tid=40085

NFS is faster than SMB, but then you got back to the problem that you need Nito or you have to use a uber-hacker way to install nfs manually.
Reply
#7
No, I don't really need Nito, but I used it to mount two NFS shares on startup, so they show up in XBMC. They are the same share I'm using in XBMC via SMB, so I could compare the performance with the same video files over NFS and SMB, but it doesn't seem to make a difference. I'm using a wireless connection, but it's very fast and should definitely suffice for video streaming. I also compared that video performance to playing the same file locally on the ATV, same result.

So that lead me to the conclusion that the network was not the issue, but rather ATV's slow CPU and the fact that XBMC does not involve the GPU in the decoding process. But maybe / hopefully that might change with future releases, though I doubt it because someone from inside Apple would need to leak the nVidea API...then again, who knows... ;-)
Reply
#8
SecretSquirrel Wrote:I also get very brief sound dropouts via optical maybe every 20 mins or so

I have this problem as well. With all my Xvids (I have almost nothing but Xvids). Every 20 minutes sounds about right, but sometimes it's more often.

Sometimes the video skips as well.

All my media is streamed from a ReadyNAS NV+ over SMB on a 100MBit connection.
Reply
#9
hey guys,

sorry, but can we keep this thread clean of problem descriptions?
I would really like this to be about solutions and optimizations, so if you have found something that optimizes audio & video performance, please post and I will add it to my initial post.

thanks,
randy.
Reply
#10
Ok, Let me fill you in on my troubleshooting over the last week I've had my Apple TV with XBMC. First off the only reason I bought the ATV was because XBMC exists and the latest PS3 firmware updates pretty much hosed my setup. I've got a few Terabytes of server space dedicated to downloaded tv shows and copies of my movies in usually .avi form. I stream these avis over 802.11G to my tv via UPNP. The PS3 used to be able to do the movies but now suffers from some sort of buffering issue... So now I use the ATV. But at first I had some issues. Sometimes when watching a show or movie it would unexpectedly stop playing and take me back to the menu without an error or anything. And sometimes I'd get a ways into the file just fine and then I would end up in some sort of strange loopback of the same minute of the show. Nothing I could do would get me out of it except to stop it and start again. So here's what I did to fix it. Once again I use a UPNP server called fuppes which is built into the FreeNAS operating system I use on my servers.

Instead of adding a specific UPNP source I added an auto searching function. So each NAS shows up separately but only when they're turned on. I did this by accident just trying to add one NAS but it works a whole lot better.
I turned on the Vertical Sync setting to clear up some tearing I was seeing. Now it looks fine.
I set the cache settings a little higher than the default for each setting.
I turned off all the UPNP settings inside XBMC as they are not needed if you already have a server running like I do.
I turned off the library function. I access using the file structure via UPNP. This I believe was the final fix for my playback issues. I haven't had a problem since turning this one setting off. And I wasn't using it anyway.
I can't seem to get .mkv files to work over UPNP and my wifi. I know there might be some bandwidth limitations here but I'm not sure. I can't seem to get Samba to work correctly. I tried that when I first installed XBMC but it caused a system crash and now I keep getting an error when I try to have it look for my Samba shares. I'm not to worried about it though. Over all I'm happy now that it's working.
ATV 2.3 with Atlantis and the .08 launcher

Allen
Reply
#11
Hi Allen,

thanks for your input, I added the "turn off Library" and UPNP settings to the list.
I'm also not using the library functionality, as I'm using my own structure for downloaded tv shows and movies, but mine is still set to "on", I'll check if it makes any difference.

I really think that network bandwidth limitations for upnp, smb, nas, nfs or afp shares / servers are not the issue when playing back certain video files. Especially MKV is a container that needs a lot of CPU power to demux the streams, at least that's what I read about it, and ATV has a pretty weak CPU, but a strong GPU. So the key to improving video playback in XBMC would be accessing the GPU, which currently is not an option, but who knows what the future will bring...

Randy.
Reply
#12
Hi Randy,

While I still believe the final thing to help with my problem was turning off the library, I may have spoken too soon. Occasionally I still get stuck in the loopback situation. Not as often though. And over all I'm still happy. I haven't had any of the sudden stops while watching a file. Would still love to see an update that fixes the screen blackout issue though. And the video calibration settings issue. I'll keep checking back for more news. Love the idea of this thread though and I think it should be stickyed....

Allen
Reply
#13
Hi Allen,

yes, disabling the library actually improved video playback performance a lot for me, thanks. And I also hope we get a bugfix release soon, which maybe also hints at coming features or performance improvements :-)

Randy.
Reply
#14
NM.
Reply
#15
Oh man.... I just purchased an Apple TV last week and it should arrive tomorrow. I'm horrified by reading this thread. Have I just throw $200 to the trash? Are you saying I won't be able to play my .mkv files??

I've testing XBMC with a MBP connected to my HDTV and love it. That's the reason I bought an Apple TV. I was sure it'll work.

Now I'm sad.
Reply

Logout Mark Read Team Forum Stats Members Help
Optimize XBMC on Apple TV for network video streaming1