Sunday, June 17, 2012

Cubox USB bus limits?


Starting to see some USB bus contention / limits being hit on cubox (ref: http://www.solid-run.com/phpbb/viewtopic.php?f=9&t=635)


I have 2 usb sounds card(s) and 1x usb HDD (will move to eSATA when I get a new housing) running off an unpowered hub on USB bus 2 .. i.e.


root@cubox:~# lsusb
Bus 002 Device 020: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 002 Device 019: ID 0bc2:3300 Seagate RSS LLC 
Bus 002 Device 018: ID 145f:0090 Trust 
Bus 002 Device 017: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The USB HDD is powered .. I've seen other posts recommending using a powered hub and ensuring devices are shared over the 2 ports .. any limits here. I was hoping to run a second USB HDD to pair the existing for back-up. Over-night I found mpd had stopped (possibly during maintenance - still investigating). During 'working' operation MPD is, on occasion, reporting ..



Jun 17 09:20 : output: "Lounge Speakers" [oss] failed to play: Write error on /dev/dsp2: Broken pipe
Jun 17 09:20 : output: "Lounge Speakers" [oss] failed to play: Write error on /dev/dsp2: Broken pipe

I'm also seeing the following in syslog

Jun 17 09:20:34 cubox kernel: [829633.363960] orion-ehci orion-ehci.1: sitd_submit: can't schedule iso stream
Jun 17 09:20:34 cubox kernel: [829633.373964] cannot submit datapipe for urb 0, error -28: not enough bandwidth
Jun 17 09:20:34 cubox kernel: [829633.390285] orion-ehci orion-ehci.1: sitd_submit: can't schedule iso stream
Jun 17 09:20:34 cubox kernel: [829633.397412] cannot submit datapipe for urb 0, error -28: not enough bandwidth


Friday, June 8, 2012

Cubox [Part 4]: usb wifi + kernel build

Ideally a Ralink so I grabbed a cheap D-Link Wireless N 150 USB adapter:


[93379.042492] usb 1-1: new high speed USB device using orion-ehci and address 2
[93379.211469] usb 1-1: New USB device found, idVendor=07d1, idProduct=3c16
[93379.218616] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[93379.226201] usb 1-1: Product: 11n Adapter
[93379.230249] usb 1-1: Manufacturer: Ralink
[93379.234729] usb 1-1: SerialNumber: 1.0
[93379.240455] usb 1-1: configuration #1 chosen from 1 choice
[93861.002520] backlight power down

Debian wiki shows the way forward http://wiki.debian.org/rt2870sta 

Sadly the modules that have been built for the stock kernel .. however in the wonderful world of openness the lovely folk at solid-run.com have the kernel on github   https://github.com/rabeeh/linux-2.6.32.9 so I can simply clone it and build (no huge reason to make a massive jump yet).

Watch this space ...

Cubox [Part 3]: + Asterisk 1.8 .. fully operational

As mentioned I rebuilt the Cubox with Debian 'squeeze' and got mpd running (see previous post). The bigger hurdle for me was to get Asterisk running and complete migration of an old Centos / Trixbox set-up .. Centos was just too awkward for me.


Failing

I began fooling around trying to migrate the config from the Trixbox server to the default Asterisk config files that came installed via apt-get on squeeze. Whilst both were 1.6 I realised the Trixbox ones were quite modified in set-up by use of freepbx gui to configure them. I got to the point where I was coping over the php agi scripts to find they weren't php5 compliant ... OK this isn't going to work cleanly .. back it up.

Thinking about it:
I'm actually pretty happy with freepbx I just don't want the Centos that Trixbox comes with
My Asterisk config is actually pretty simple
  1. 1 x IAX2 trunk 
  2. 1 x SIP trunk 
  3. 1 x out-/in-bound routes 
  4. 1 x Ring Group (ring all extensions .. in NO ANSWER hand over to VM IVR) 
  5. 1 x VM IVR (leave message for whom?) 
  6. 3 x Extensions (2000 - Dect phone, 2001 - Me, 2002 - Mrs and more to follow I'm sure) 
.. so decided to change tack.

Thursday, June 7, 2012

Cubox [Part 2]: mpd, usb HDDs and sound cards

Not much to say .. all just an apt-get install and migrate over from old music server.



I have /etc/fstab with labels set-up for the USB HDDs (only one operational but I will boot two for back-ups).

Also need to monitor power consumption as I plan to have 4-5 USB devices hanging off a usb hub - only the drives are powered.


Sandisk to the rescue

OK so I have a lovely Cubox that boots off a micro SD card and also have Android mobile phones in the house with similarly sized SD cards. But .. I can't find the Micro / SD card thingy that you can put one in side the other to read it ..

Since my mobile needs to be rebooted every time I extract the microSD card it was apparent a decent solution would probably be useful. I can happily recommend the usb adapter that I found at my local DSE store for $20.

http://www.sandisk.com/products/readers-accessories/mobilemate-duo



Also qudos to the DSE sales rep who recommended I check trademe.co.nz as I'd find one for $5 + shipping .. my student days are over .. I wanted one now.

Cubox [Part 1]: the arrival + Debian 'squeeze'

My first (and I say first for a reason) Cubox arrive from Solid-run this week. The reason I got the first one:

  • Cheap as (99 euro)
  • Need a fan-less music and phone system (mpd and asterisk) 




Experience to date


Breaking it

Booted out of the box with an HDMI cable plugged into the TV but without a network cable or adapter handy this was short lived but proved all should play nicely. Booting it directly with a network cable (headless) worked fine - check for host 'cubox' on list of router dhcp leasesfor ip address. ssh'ing in was fine given default 'cubox/cubox' and 'root/cubox' details .. all good.

Next steps were:

  1. leave the default Ubuntu 10.04 on there for a quick set-up of what I need
  2. install music server (sudo apt-get install mpd)
  3. install asterisk (sudo apt-get install asterisk, etc)
  4. update all packages (it said some were needed) ... error .. almost bricked it .. 

Well almost. I simply trashed the boot process as some of the new packages simply didn't work leaving me with a busted install and kernel panic's .. don't do an apt-get upgrade if you want to keep it working.


Fixing it

OK so rather than try and figure out where the base system could be restored from (take a back-up people - dd the whole MMC card would be my future recommendation .. that is if you want to go back to it .. I don't really want to).

Next steps:

  1. get serial access sorted - nicely documented here, no problem - refresh your screen commands - this worked best for me.
  2. choose a distro - I'm picking debian - http://www.solid-run.com/mw/index.php/Debian_on_CuBox
    1. lot's of udev issues with wheezy so I'm going back to squeeze - consider http://www.solid-run.com/phpbb/viewtopic.php?f=11&t=323#p1010
  3. run with basic ssh server only set-up and copy over kernel / boot images.
Some hints I found useful fixing this issue:
  •  If you find yourself booting a usb kernel numerous times to get the MMC card back operational again, cat /proc/partitions to find the name soyou can mount the boot partition
  • As per this post make sure your boot partition contains a /boot directory ;)