Kodi Community Forum
[LINUX] Apple TV Crystalbuntu (Ubuntu Linux and Crystal HD) Disk Image for Apple TV - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: [LINUX] Apple TV Crystalbuntu (Ubuntu Linux and Crystal HD) Disk Image for Apple TV (/showthread.php?tid=74992)



- iscraigh - 2010-07-01

iscraigh;561638]I have the old hardware and would like to upgrade not sure how to use the svn repository on the appletv running the apple software. If you tell me how I will be glad to. If it makes it easier I have linux and osx desktops. Ran it on OSX desktop got the following errors.

***Never mind I did some searching and it looks like compiling it may be a bit of a job, I will either wait for a compiled release or if I have a rainy day maybe I will follow some readme's and try to set my mac up to compile it***** I was hoping it would be able to handle my 60fps 720p hdpvr recordings.

Thanks

Craig
.cpp:680: error: expected primary-expression before ‘)’ token
libcrystalhd_if.cpp:680: error: ‘_IOWR’ was not declared in this scope
libcrystalhd_if.cpp: In function ‘BC_STATUS DtsStartCaptureImmidiate(void*, uint32_t)’:
libcrystalhd_if.cpp:1282: error: expected primary-expression before ‘)’ token
libcrystalhd_if.cpp:1282: error: ‘_IOWR’ was not declared in this scope
libcrystalhd_if.cpp: In function ‘BC_STATUS DtsStartCapture(void*)’:
libcrystalhd_if.cpp:1326: error: expected primary-expression before ‘)’ token
libcrystalhd_if.cpp:1326: error: ‘_IOWR’ was not declared in this scope
libcrystalhd_if.cpp: In function ‘BC_STATUS DtsFlushRxCapture(void*, BOOL)’:
libcrystalhd_if.cpp:1350: error: expected primary-expression before ‘)’ token
libcrystalhd_if.cpp:1350: error: ‘_IOWR’ was not declared in this scope
make: *** [libcrystalhd_if.o Wrote:
Error



- jodeman - 2010-07-02

I've been having a lot of issues with xbmc quitting out and going to a login screen with sam's image. I enabled debugging in hopes of seeing what's going on. But, I'm not able to locate a crash report log. Where is this located? I've checked under /home/xbmc but it's not there. I've also tried a locate, but it doesn't turn anything up. Is there something else I need to do, or is it hiding somewhere else?


- bigjuggler - 2010-07-02

Noob alert!

Hello all. Thanks for letting me play in your playground.

I have been running Sams image off an external usb hard drive and I really like it....snappy and plays 720p very nicely with the CrystalHD.

I would like to copy this over to the internal drive and commit to it (using pin87a's guide), but I have two questions:

1. Where do I find all the XBMC files (plugins, skins, resources etc)? Right now, I am connecting with SFTP (using Transmit or Cyberduck on a Mac). Sam said they all should be in the .xbmc under the home folder however, when I connect I cannot find the contents/resources stuff (only desktop/documents/pictures/public etc folders are visible). I would like to modify the joystick.appleremote.xml and install the Transparency skin. Is this maybe a permissions issue? Can I access the resources from the terminal somehow?

2. My big question. Is there a way to use this Ubuntu OS and still use an external usb hard drive for media? I love pin87a's instructions to install ubuntu to the internal drive and have dual boot to OSX, but it would seem that if I plugged in my external drive I might mess it up. It will want the usb flash drive to boot to linux. Would a hub work here? (to boot to connect the flash and external media drive at the same time)

Thanks for your any insight. I really LOVE XBMC.

Thanks again to Davilla and Sam.Nazarko.


- Flicker - 2010-07-02

@bigjuggler

1. Try to config Transmit or Cyberduck to show you hidden files and folders as well.
All files and folders that start with a dot are hidden.

2. Don't know Smile


- bigjuggler - 2010-07-02

Thanks Flicker,

That did the trick, invisible files....who knew!. Uploaded the skin fine. As for modding my remote, unfortunately the files structure seems a little different under Ubuntu (vs. OSX) so I can't find the joystick.appleremote.xml (it's in xbmc/system/keymaps under OSX but there is no such location under Ubuntu).

Thanks for the quick reply


- deltazulu - 2010-07-02

I loaded [STRIKE]Sam's[/STRIKE] pin's minimized image last night on an 8GB USB drive and loaded it up.
Here is how I installed the image on the USB driving using Leopard, thanks tuckbodi:
tuckbodi Wrote:1) Download and unrar pin's image from first post
2) In Disk Utility format 4gb USB stick (note: not all 4gb sticks work) as Fat32, and do info on stick to see what disk it is (I would have stick as only USB device for safety)(ie my stick showed up as disk2)
3) Unmount the partition
4) Run the following command from Terminal from where ever you put the image and using your USB stick name (ie disk2 <--make sure this is your USB disk!!)
sudo dd if=atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.img of=/dev/disk2 bs=4096
5) Wait, have a cup of cofee, and another, etc......can take an hour to write image
6) Turn off ATV and plug stick into USB and power up -- if you get XBMC then everything worked!
Issues I've seen:

WORK-AROUND: Component Video
I am using component video, so I had to change the /etc/X11/xorg.conf to use component, which fixed that immediate issue. To edit, I used vi, but you could use nano as well.

Here is the section in my xorg.conf. Note: I'm using 480P on this particular TV:
Code:
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    Option         "UseDisplayDevice" "TV"
    Option         "TVOutFormat" "COMPONENT"
    Option         "TVStandard" "HD480p"
    Option         "TVOverScan" "0.80"
    DefaultDepth    24
    Option         "NoLogo" "True"
    SubSection     "Display"
        Modes      "720x480" "640x480"
        Depth       24
    EndSubSection
EndSection

WORK-AROUND: SMB Shares
Next, I had trouble getting SMB shares to work. Trying to add source -> SMB Share resulted in a crash back to "X" screen, and xbmc restarting. I had to edit the sources.xml file in ~/.xbmc/userdata to get my sources built.

Here is my sources.xml:
Code:
cat /home/xbmc/.xbmc/userdata/sources.xml
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>MediaServer - Media (SMB)</name>
            <path pathversion="1">smb://root:<password>@192.168.1.203/media/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

WORKAROUND Analog (RCA-out) Audio
Another issue I had, since I am using the RCA analog audio outputs, is setup the audio for video playback. General user interface sounds played fine with the settings set by default in the pin78 image, but to get the stereo output during playback I used the following settings in SYSTEM -> System -> Audio Output:

Audio Output: Analog
Speaker Configuration: 2.0
Audio output device: default

Every other option is grayed out/ unchecked.

Resolved Issue #1:
Next, I decided I would try and follow some of the thread comments here and update the xbmc build as well as update the r26 (1.0.3) CrystalHD drivers (am I referencing that right? is 1.0.3 = r26?) to Davilla's recommendation of r114. I'll start with that.... I checked out the r114 (actually I think now I used r115) libraries with svn, did the make, etc.. and worked all the way through using this command flow:
Code:
svn checkout http://crystalhd-for-osx.googlecode.com/svn/trunk crystalhd-r114
cd crystalhd-r114/crystalhd/linux_lib/libcrystalhd
make
sudo make install
cd ../../driver/linux
autoconf
./configure
make
sudo make install
sudo modprobe crystalhd
modified from http://wiki.xbmc.org/index.php?title=HOW-TO_install_a_Miminal_Ubuntu_and_XBMC_with_sound_over_HDMI_on_the_AppleTV

After rebooting, I was no longer able to select CrystalHD as the playback method... that option is gone now, as if the install of the r115 drivers failed, or something. Playback is glitchy on 720p content (due to using all CPU instead of the BCM700012 chip.) This leads me to my next issue: How do I get the new drivers to actually load and work? Did I miss a step?

Resolved: There is some issue with certain broadcom chips (theory) that prevents the newer firmware from loading. During the boot process, the process times out (seen as "T/O" in the dmesg log). Rolled back to r26 1.0.3 and the Crystal HD loads fine again and is selectable in XBMC as playback method.

Resolved Issue #2:
I also would like to know how to update XBMC itself, to a more recent build. I realize this is being done by Sam and pin87a in building new and updated images, but I figured I could handle this myself... well, I used this thread to update, but now I'm left with this: http://forum.xbmc.org/showpost.php?p=562103&postcount=17

Resolved by doing this: http://pastebin.com/hyCUSE3Z


- Philmatic - 2010-07-02

deltazulu Wrote:After rebooting, I was no longer able to select CrystalHD as the playback method... that option is gone now, as if the install of the r115 drivers failed, or something. Playback is glitchy on 720p content (due to using all CPU instead of the BCM700012 chip.) This leads me to my next issue: How do I get the new drivers to actually load and work? Did I miss a step?

Can you SSH into the ATV and:

1. Paste here what you get when you type in 'lspci | grep Broadcom'

2. Paste here the last few lines from the 'dmesg' command? Looking specifically for anything starting from 'Starting BCM70012 Device'

This will help Scott figure out what's going on.


- deltazulu - 2010-07-02

deltazulu Wrote:Open Issue #1:
After rebooting, I was no longer able to select CrystalHD as the playback method... that option is gone now, as if the install of the r115 drivers failed, or something. Playback is glitchy on 720p content (due to using all CPU instead of the BCM700012 chip.) This leads me to my next issue: How do I get the new drivers to actually load and work? Did I miss a step?
1. Paste here what you get when you type in 'lspci | grep Broadcom'

Code:
xbmc@AppleTV:~$ lspci | grep Broadcom
02:00.0 Multimedia controller: Broadcom Corporation Unknown device 1612 (rev 01)
2. Paste here the last few lines from the 'dmesg' command? Looking specifically for anything starting from 'Starting BCM70012 Device'

Code:
xbmc@AppleTV:~$ dmesg | grep crystal
[   46.363668] Loading crystalhd 3.1.0
[   48.833147] crystalhd_hw_open: setting up functions, device = Link
[  129.098124] crystalhd 0000:02:00.0: Entering chd_dec_open
[  129.098138] crystalhd 0000:02:00.0: Opening new user[0] handle
[  129.098151] crystalhd_hw_open: setting up functions, device = Link
[   78.632825] crystalhd 0000:02:00.0: Firmware Downloaded Successfully
[  151.240598] crystalhd 0000:02:00.0: Firmware command T/O
[  151.240609] crystalhd 0000:02:00.0: FwCmd Failed.
[  151.240616] crystalhd 0000:02:00.0: fw cmd 73763001 failed
[  151.358160] crystalhd 0000:02:00.0: Entering chd_dec_close
[  151.358171] crystalhd 0000:02:00.0: Closing user[0] handle

This will help Scott figure out what's going on.


- deltazulu - 2010-07-02

I found this thread that Davilla is working on apparently -- looks like the same issue with the new drivers. i'll try and downgrade to 1.0.3 and see if it resolves this issue.

UPDATE to Issue #1

I've downgraded from r114 to 1.0.3 by doing the following:
Code:
svn checkout http://crystalhd-for-osx.googlecode.com/svn/tags/crystalhd-for-osx-1.0.3 crystalhd-for-osx-1.0.3
cd crystalhd-for-osx-1.0.3/crystalhd/linux_lib/libcrystalhd
make
sudo make install
cd ../../driver/linux
autoconf
./configure
make
sudo make install
sudo modprobe crystalhd

Then rebooted..

Now I see this:
Code:
xbmc@AppleTV:~$ lspci | grep Broadcom
02:00.0 Multimedia controller: Broadcom Corporation Unknown device 1612 (rev 01)


xbmc@AppleTV:~$ dmesg
......bunch of lines here.......
[   46.337321] Loading crystalhd 0.9.27
[   46.927169] nvidia: module license 'NVIDIA' taints kernel.
[   48.160034] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input5
[   48.187534] ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[   48.407542] udev: renamed network interface eth0 to eth1
[   48.799612] PCI_INFO: Vendor:0x14e4 Device:0x1612 s_vendor:0x14e4 s_device: 0x2612
[   48.799651] PCI: Enabling device 0000:02:00.0 (0000 -> 0002)
[   48.799662] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[   48.799759] allocated 18 elem
[   48.799911] Starting BCM70012 Device
[   49.038716] clock is moving to 175 with n 35 with vco_mg 2
[   49.038742] CStopping BCM70012 Device
[   49.262424] PCI: Setting latency timer of device 0000:02:00.0 to 64
[   49.262619] ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[   49.262633] PCI: Setting latency timer of device 0000:01:00.0 to 64
[   49.262799] NVRM: loading NVIDIA UNIX x86 Kernel Module  100.14.19  Wed Sep 12 14:12:24 PDT 2007
[   50.505339] loop: module loaded
[   50.566469] lp: driver loaded but no devices found
[   50.883599] Adding 499992k swap on /dev/sdb4.  Priority:-1 extents:1 across:499992k
[   51.694356] EXT3 FS on sdb3, internal journal
[   52.144825] ip_tables: (C) 2000-2006 Netfilter Core Team
[   53.888542] NET: Registered protocol family 17
[   54.634110] No dock devices found.
[   55.866616] NET: Registered protocol family 10
[   55.867219] lo: Disabled Privacy Extensions
[  101.750870] Marking TSC unstable due to: cpufreq changes.
[  101.757503] Time: hpet clocksource has been installed.
[  102.297325] Clocksource tsc unstable (delta = -200012232 ns)
[   68.001681] eth1: link up, 100Mbps, full-duplex, lpa 0x45E1
[  124.526082] NVRM: Xid (0001:00): 16, Head 00000000 Count 00000001
[  130.975283] eth1: no IPv6 routers present
[  133.866131] NVRM: Xid (0001:00): 16, Head 00000000 Count 00000002
[  143.172217] Opening new user[0] handle
[  143.172229] Starting BCM70012 Device
[  143.410272] clock is moving to 175 with n 35 with vco_mg 2
[  143.410300] CInitializing Dio pool 10 1024 505c cef11ea0
[   87.033059] Firmware Downloaded Successfully

I am working remotely right now (not in front of the box/tv) so I don't know if this resolved the issue or not, but I don't see the failure messages and T/O message anymore, so I think that is a good sign?


- Philmatic - 2010-07-02

It should be...

I must have had a freak occurrence where my card decided to die when I updated the drivers as a coincidence. From what Scott says, it's impossible for a driver update or firmware to brick the card.

For everyone else, dropping back down to 1.0.3 seems to have fixed it, I was the only unlucky one it seems.


- deltazulu - 2010-07-02

Strange. Well, so are we stuck on r26 / 1.0.3 for now then? Or is this related possibly to running an older version of XBMC and a newer version of crystal drivers? I can't tell from the logs whether or not the driver is failing initially, or just after XBMC attempts to do something with them.


- Philmatic - 2010-07-02

XBMC is blameless in this... the card is being detected, but the firmware that allows the driver to load is not being loaded (It's timing out). Being stuck on 1.0.3 isn't as bad as havng a dead card, let me tell you! Smile


- davilla - 2010-07-02

As a test for those having problems with new driver/lib and old layout cards, try the old firmware instead of the new firmware.

The old layout cards from ebay were always suspect as they seem to have been obtained from the Broadcom factory in China without Broadcom's knowledge. In discussions with Broadcom, we suspect that some of these cards have marginal DRAM and the new firmware has a different memory footprint that the older firmware.

I have a few old layout cards working their way to me so I can try and see what is going on and if there is something we can do in the driver to help.

The issue is the firmware is loading but not running and the command that tests that it's running is timing out.


- deltazulu - 2010-07-02

davilla Wrote:As a test for those having problems with new driver/lib and old layout cards, try the old firmware instead of the new firmware.
...
The issue is the firmware is loading but not running and the command that tests that it's running is timing out.

Could you elaborate for me (and possibly others) as to which of these steps I should do to load just the new driver/lib with the old firmware?

Code:
svn checkout http://crystalhd-for-osx.googlecode.com/svn/trunk crystalhd-r114
cd crystalhd-r114/crystalhd/linux_lib/libcrystalhd
make
sudo make install
cd ../../driver/linux
autoconf
./configure
make
sudo make install
sudo modprobe crystalhd

And for the record, I did purchase this particular card from the eBay seller in Hong Kong (not sure the exact seller at the moment), I also have however a card that was purchased from Logic Supply in a second ATV at the house. I could hook up this same USB stickinto that ATV with the new driver / firmware combo and see if the issue persists, to try and rule out anything with the linux/xbmc installation on my USB stick. But now that I'm back downgraded to 1.0.3, I'm a bit nervous to load the new driver and firmware again since at least one user has been unable to resolve the timeout issue even after downgrading..


- tuckbodi - 2010-07-02

Here's a log of some playing around I did yesterday. XBMC 31542 r115 on bcm70012 old layout

Some example mediinfo's of a couple of the movies:
1080 720 DVD

Issues are across the board and can't seem to duplicate. Whereas one movie would play alright one time, then the next it won't. Sometime a reboot would help things and other times it wouldn't. 1080p, 780p, SD DVD, MKV, M4V..it doesn't matter.

Symptoms I would see
- I'd click on a DVD and the Waiting indicator would show for a second, nothing, and I'd wait awhile and then click on another movie. It would error out.
- I clicked on a movie (1080p to a SD) and parts of the screen would start stuttering back & forth (like the Working indicator). Sometimes I can Menu button out of it and other times it's locked up.
- clicked on a movie and can hear the audio playing but it won't display the video

Of note, the 1080 movie played great with 28256 r26.