TOPIC: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #21

Just a thought. I was on R9823 when I started this whole thread, so I will be covering old ground by installing it again.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #22

Ok, I have installed R9823, and if anything it's worse than ever. Here's the XBMC.log

paste2.org/p/1904195

Strange thing is, that this XBMC.log seems to suggest that the CrystalHD card was being used. But Avatar pretty much failed to start playing at all, then crashed back to the file menu.

I'm trying another file now, (a 720p film about 5gb) and it's playing fine. Perhaps it was a network issue........

Lots of these in the log again.
WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available

Something else that leads me to believe it might be a network issue is the fact that I am having trouble login in with Putty and WinSCP.
Last Edit: 1 year 3 months ago by Tyler Durden.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #23

Here's another log, continuing from the last one, that might show what's happening, and why trying to play the big Avatar file is crashing back to the file browser.

paste2.org/p/1904214
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #24

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
Just to make a point clear.. I only run nvidia builds, never nouveau, so you are testing something different and thus your experiences will be different. I have consistently had problems with the nouveau builds; hence the nvidia builds exist in the first place. It's no great surprise to me that your experience with nouveau isn't positive.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #25

I am now running r9823. All the issues I mentioned and the log files in my last post are with r9823 installed.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #26

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
facts and thoughts:

a) There is definitely a problem with crystalhd introduced in the master branch since last Sunday. I can easily reproduce what you've seen with "failed codec" messages and high CPU. I also have issues logging in over SSH so I suspect the graphics problem is also locking up the kernel and disrupting other modules. This is going to take some time to figure out as I will need to build, test, rebuild, test, rebuild, test, rebuild until I find the problem commit. I tried some obvious candidates last night but nothing made a difference; it's something more obscure.

b) The last two logs you posted using the nvidia 9823 image show crystalhd working normally ..so I'll refer you back to my original post about bandwidth on the onboard NIC not being enough for bigger 720p and 1080p rips. If you want to stream large files you *will* need a USB Gigabit NIC. If you time a linear transfer from NAS to ATV you'll be able to copy a 20GB file within the runtime of the movie, but that's not how XBMC reads the file, it's a buffer/use/buffer/use profile and the buffer is draining faster than it can be refilled. What's playback like when you run from the internal drive?
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #27

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
for myself.. the largest file I have is Apollo13 at 16GB. This plays at 24p with 45-50% CPU and no dropped frames on the 9823 image. It's only on the builds I made since last Sunday that have an issue.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #28

I will try playing from the hard drive again, to make sure it's the network issue which is causing the problems I'm experiencing.

Think I'll try the "killa.sample.x264" just to make sure :-D
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #29

  • Bossanova808
  • Bossanova808's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 354
  • Thank you received: 10
  • Karma: 6
Sorry to butt in again but I just can't see how the NIC can be at fault here unless there's a dodgy driver involved - 10/100 is ample for even really huge bluray rips, double the sizes you are talking here and I've never met a 10/100 NIC properly configured that can't handle it.

Is there something unusually crap about the Apple TV NIC? I would have thought since it was built for streaming, it would be pretty good...

Also, you don't see Crystalbuntu threads complaining about slow NIC - www.stmlabs.com/tag/crystalbuntu/

I'd try that distribution as well to see if the issue is more directly Openelec.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #30

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
I use an Apple TimeCapsule as a NAS; not the fastest but it handles large transfers from my MacBook over 5GHz WLAN at 12-22MB/sec with wired transfer over 1000-BaseT Ethernet considerably faster so it's not all bad. If I copy files over my WLAN to the ATV box (which has an 8GB SSD for an internal drive) I consistently see 4.4MB/sec using the onboard 10/100 NIC, 8MB/sec using an 802.11n 5GHz card with a strong connection to the router, and 11MB/sec over the ASIX chipset USB Gigabit NIC that is now my primary connection.

4.4MB/sec = 35.2 Mbits/sec, 8.0MB/sec = 64Mbits/sec, 11MB/sec = 88Mbits/sec. In theory all of them should be enough for a typical blu-ray rip, but with most 720p and any 1080p content over the onboard NIC I see major stuttering and "buffering" on screen. If I use an 802.11n USB NIC in the 2.4GHz band it's much the same. If shift to 5GHz channels 720p content plays okay with only occasional fast panning shots looking jerky, but 1080p is still unwatchable. If I use the USB Gigabit NIC, all the media I have plays without issue. I agree that 100 Base-T should be fast enough, and on other systems it may be, but if the CPU + CHD board handles 1080p content with the Gigabit NIC but not with the onboard LAN I conclude that network performance is the variable on AppleTV that chokes playback.

There have been a number of people who've commented on slow SMB transfers over time on a variety of hardwares so I suspect OE isn't the speediest distro for network performance, but I also think the ATV having only 256MB RAM and a 600MHz (1GHz underclocked) mobile CPU is a factor. Apple designed this in 2005-6 to run SD and highly optimised 720p content at best. The crystalhd board extends the lifespan and capabilities by a mile but it'll never compare with the raw performance of a recent ION or Fusion box.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #31

  • live4ever
  • live4ever's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 1
  • Karma: 0
In the first image you posted take note of the "dc: ff-264" this mean the CPU (using ffmpeg) is doing the decoding (you want it to show chd:).

Right beside it the "vq: 99%" means your network is fast enough (this dropping to zero with cause buffering).

The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #32

OK, I have ruled out the network by placing this file on my internal hard drive.
General
Unique ID                                : 128304964562525348885947803333437387943 (0x6086A327D3883A015FB66D29F9AB74A7)
Complete name                            : \\192.168.0.10\Videos\killa.sampla.x264.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 96.1 MiB
Duration                                 : 23s 46ms
Overall bit rate                         : 35.0 Mbps
Movie name                               : Avidemux
Writing application                      : Lavf51.12.1
Writing library                          : Lavf51.12.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 16 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 23s 65ms
Bit rate                                 : 33.8 Mbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.680
Stream size                              : 93.0 MiB (97%)
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Codec ID                                 : A_AC3
Duration                                 : 23s 46ms
Bit rate mode                            : Constant
Bit rate                                 : 448 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -83ms
Stream size                              : 1.23 MiB (1%)
Default                                  : Yes
Forced                                   : No

This file wouldn't play, I could hear it playing, but the sound was stuttering, and I never even saw an image before it crashed back to the browser menu. I'm about to give up the ghost with this, and try Crystalbuntu again!

Here's the xbmc.log file showing what's going on while trying and failing to play this file from the HDD.

paste2.org/p/1906393
Last Edit: 1 year 3 months ago by Tyler Durden.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #33

For the record. I have tried playing the Avatar file over the network using Crystalbuntu from a USB drive, and it plays flawlessly!!!

My only issue with Crystalbuntu is that it only want to output 60hz. The only option in the video settings menu is 60hz, and it doesn't change the refresh rate when playing back any file, even with the setting set.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #34

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
can you share that sample file.. I'd like to try it.

the solution to the 60Hz issue is a custom xorg.conf file; set static modelines
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #35

  • live4ever
  • live4ever's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 1
  • Karma: 0
killa.sampla.x264.mkv is not a good file to test the CrystalHD with, I believe it can only decode 10 reference frames (not 16 in killa).

You're much better off using untouched BD video (h.264 or VC-1).
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #36

chewitt wrote:
can you share that sample file.. I'd like to try it.

the solution to the 60Hz issue is a custom xorg.conf file; set static modelines

I've been here before and couldn't get it sorted.

stmlabs.com/forum/topic/everything-plays-at-1080p60hz

This is why I tried Openelec (which I also haven't been able to sort, but for a different reason)
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #37

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130


The Samsung LCD I own outputs EDID that the nvidia driver doesn't like (it's the nvidia driver, nouveau reads the same EDID fine). To get working output I need to disable everything to do with EDID and set static modelines.

Here's my xorg: pastebin.com/DALrJknM

Xorg configuration is always a little TV-specific, but you should be able to crib a few more things from that file.

I've identified the commit that causes the crystalhd card (and other things) to not-work, but to keep in-step with the rest of the project it will need to be accommodated somehow; that's something for sraue to look into.

Have you tested from the hard drive with something other than the killa.sampla file?
Last Edit: 1 year 3 months ago by chewitt.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #38

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
can you also add "processor.max_cstate=2" into the kernel boot params, e.g.

kexec -l /boot/KERNEL --command-line="boot=/dev/sda3 disk=/dev/sda4 quiet processor.max_cstate=2"

it appears to improve network performance on my box, though it's not perfect and with my Gigabit NIC I see no errors
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #39

I have tried your xorg.conf file, but my TV reported no signal.

I am going to need to do my own, specific to my TV. I have searched and searched for the process on how to do this but haven't found one. Please can you help me out with a step by step for doing this?

Thanks again.
The administrator has disabled public write access.

Re: [Apple TV] Terrible HD playback with BCM970015 - Dev Build 9823 1 year 3 months ago #40

  • chewitt
  • chewitt's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2689
  • Thank you received: 418
  • Karma: 130
Unless you also have a Samsung LA46A850 that would never work. Start again with a clean custom xorg.conf:
cp /etc/X11/xorg-nvidia.conf /storage/.config/xorg.conf
Add the following line to the "Device" section:
Option "ModeDebug" "True"
Reboot, SSH in and paste the content of /var/log/Xorg.0.0.log. Then overwrite /storage/.config/xorg.conf with my file and you're ready to start editing. Now you need to work you way through the Xorg.0.0.log data to find *your* Horizontal and Vertical refresh information and create "Modeline" entries for each mode you want Xorg to make available to XBMC.

e.g. you'll find horizontal / vertical info on lines like these:
[4078643.719] (--) NVIDIA(0): Valid HSync Range            : 26.0 kHz - 68.0 kHz
[4078643.719] (--) NVIDIA(0): Valid VRefresh Range         : 23 Hz - 60 Hz
Which become:
HorizSync       26-68
VertRefresh     23-60
Then you can look for the modepool information. This will look like:

[
4078643.858] (II) NVIDIA(0): --- Modes in ModePool for SAMSUNG (DFP-1) ---
[4078643.858] (II) NVIDIA(0): "nvidia-auto-select" : 1280 x  720 @  60.0 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080"          : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_60"       : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_50"       : 1920 x 1080 @ 50 Hz (CEA-861B Format 31) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_30"       : 1920 x 1080 @ 29.97/30 Hz (CEA-861B Format 34) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_25"       : 1920 x 1080 @ 25 Hz (CEA-861B Format 33) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_24"       : 1920 x 1080 @ 23.97/24 Hz (CEA-861B Format 32) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_60i"      : 1920 x 1080 @  60.1 Hz Interlace  (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_60i_0"    : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_50i"      : 1920 x 1080 @  50.0 Hz Interlace  (from: EDID)
[4078643.858] (II) NVIDIA(0): "1280x720"           : 1280 x  720 @  60.0 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "1280x720_60"        : 1280 x  720 @  60.0 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "1280x720_60_0"      : 1280 x  720 @ 59.94/60 Hz (CEA-861B Format 4) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1280x720_50"        : 1280 x  720 @  50.0 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "720x576"            :  720 x  576 @  50.0 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "720x576_50"         :  720 x  576 @  50.0 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "720x480"            :  720 x  480 @  59.9 Hz  (from: EDID)
[4078643.858] (II) NVIDIA(0): "720x480_60"         :  720 x  480 @  59.9 Hz  (from: EDID)
[4078643.859] (II) NVIDIA(0): "640x480"            :  640 x  480 @  60.0 Hz  (from: EDID)
[4078643.859] (II) NVIDIA(0): "640x480_60"         :  640 x  480 @  60.0 Hz  (from: EDID)
[4078643.859] (II) NVIDIA(0): --- End of ModePool for SAMSUNG (DFP-1): ---
This tells you what modes are supported. the ones you're interested in are the 1920x1080 resolutions, typically 60/50/302/25/24 Hz. e.g.
[4078643.858] (II) NVIDIA(0): "1920x1080_60"       : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_50"       : 1920 x 1080 @ 50 Hz (CEA-861B Format 31) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_30"       : 1920 x 1080 @ 29.97/30 Hz (CEA-861B Format 34) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_25"       : 1920 x 1080 @ 25 Hz (CEA-861B Format 33) (from: EDID)
[4078643.858] (II) NVIDIA(0): "1920x1080_24"       : 1920 x 1080 @ 23.97/24 Hz (CEA-861B Format 32) (from: EDID)
Now you have the long and boring task to finding those modes within the file and rearranging the data to create your modelines. As an example, the 60Hz mode will look something like this:
[4078643.720] (--) NVIDIA(0):   1920 x 1080 @ 60 Hz
[4078643.720] (--) NVIDIA(0):     Pixel Clock      : 74.25 MHz
[4078643.720] (--) NVIDIA(0):     HRes, HSyncStart : 1920, 2008
[4078643.720] (--) NVIDIA(0):     HSyncEnd, HTotal : 2052, 2200
[4078643.720] (--) NVIDIA(0):     VRes, VSyncStart : 1080, 1084
[4078643.720] (--) NVIDIA(0):     VSyncEnd, VTotal : 1094, 1124
[4078643.720] (--) NVIDIA(0):     H/V Polarity     : +/+
Which you flatten into a single line that looks like this:
Modeline    "1920x1080_60" 74.25 1920 2008 2052 2200 1080 1084 1094 1124 +HSync +Vsync
Rinse and repeat for each mode, then edit my "Modes" line in the screen section so it looks like:
Modes    "1920x1080_60" "1920x1080_50" "1920x1080_30" "1920x1080_25" "1920x1080_24"
Once you're done, reboot and in theory you should be all configured with static modelines. You may not get it all correct the first time as the log un-helpfully contains way too much data. Work on adding a single 60Hz mode first, then add 50, etc. until you're done. The process is never quick and there are no shortcuts.
Last Edit: 1 year 3 months ago by chewitt. Reason: typos and layout
The administrator has disabled public write access.

Our Sponsors & Partners

arctic_logo