Son Of Sun Tzu

To content | To menu | To search

Tag - google search fodder

Entries feed - Comments feed

Saturday 1 April 2017

How to run Xbian off a USB display on a Raspberry PI

The short version

Don't.

The long version

( I've not gone into too much detail, I figure the only people who'll stumble across this are either considering the same solution, or troubleshooting their own attempt )

I had a Raspberry Pi 2, it's a "2+" I think, running Xbian. Xbian is a pre-built version of Kodi, the popular media player that used to be called XBMC. No X server is used, Xbian turns your Raspberry Pi into a media player with relatively little effort.

Having acquired a couple of USB screens over the years I thought it would be useful to connect one of these screens to the Pi, just so something like BBC News 24 or the NFL Network could run in the background to the side of my main monitors, or a Twitch channel.

So I connected a Mimo USB UM710 monitor and rebooted the Pi. This came up as a green screen, which means that the udlfb driver has loaded; and from the command line I can see that I have "/dev/fb0" and "/dev/fb1" - meaning that two framebuffers are available.

However I couldn't find any way within the Xbian interface to direct Xbian to use /dev/fb1, nor any kind of option to specify this in any of its configuration files.

I tried using the con2fb tool to redirect a different console to each framebuffer, directing tty1 to the USB monitor, in the hope that Xbian was starting on tty1 ... but still running "kodi start" from the command line brings up Xbian on HDMI.

I looked at somehow disabling the first framebuffer, but to no avail; the relevant bcm2708_fb driver is part of the kernel, and there's no way to stop it being used. Also I don't know if that functionality is required to generate that graphics that are then sent to the USB monitor using the udlfb driver. I expect that a Raspbian kernel can be compiled that doesn't include this functionality, but I decided that for a relatively simple system, which I'm trying to use in an "plug and play" way as possible, compiling my own kernels was a step too far, especially as I had no idea if the solution would work or not.

Also, ideally, I would be able to switch this device from using the USB screen to an HDMI screen with a few commands.

( As a side note, if you're looking at this in general it's worth researching the "chvt" and "xbmc_send.py" commands online )

On further research it turns out this is a common issue for people trying to extend their use of a Raspberry Pi.

That research did lead to a couple of possible solutions, these are framebuffer copiers, or mirrors, that copy of the output from framebuffer to another. While not ideal, this could work.

Firstly I tried fbcp but that just didn't work.

I set the Xbian resolution down to 480p to match what the USB screen was capable of, but this didn't make a difference.

So I moved on to raspi2fb instead.

This worked up to a point, showing the output of the first framebuffer at the right resolution, and at something like 25 frames a second. While slightly jerky this was more than enough to satisfy my requirement to keep an eye on the channel. Kodi's BBC News 24 plugin worked fine, the NFL Network worked fine at a low enough resolution ... but both the Twitch and YouTube plugins would crash the entire system. As far as I can tell it seemed that if I attempted to display anything above the resolution supported by the USB screen the Pi would just crash and need to be manually restarted. Also the system was now a little flaky in general.

I tried both 1.0 amp and 2.0 amp power supplies with the same result.

In the end I gave up, and decided I'd try something else to get Xbian on the USB monitor.

However having disconnected the USB screen, and tried using the Raspberry Pi on an HDMI monitor again, it's crashed after a few minutes. I'll be seeing if there's some kind of software diagnostics I can run to spot any obvious problems - it feels like something the community will have written already.

So in the end I have a Pi that appears to be broken in some way, possibly a result of how many USB devices I plugged into it at once - suggestions for easy ways of running hardware diagnostics are welcome in the comments below.

Monday 13 February 2017

The "Targus Wireless Bluetooth Presenter Remote Control & Mouse Cursor", model BEU0564C

In an earlier blog here I stated I was going to use a Targus device that combined the functionality of being a wireless mouse, and a wireless remote control for presenting; rare functionality that is exactly what I was after.

As stated... it does work with Linux, but only for short periods of time. Sometimes it can only last for a couple of minutes before it just kind of forgets that it was talking to something else. This makes it completely unusable for presentations, and essentially completely worthless. Reading through the Amazon reviews more thoroughly, it looks like I'm not the only one with this problem.

I realise the device was on the "cheap and cheerful" side but I expected basic functionality, rather than no functionality.

Avoid.

Suggestions for equivalent but reliable devices would be appreciated in the comments.

Tuesday 13 December 2016

xmonad issue with drop down menus - workaround

If you have a problem with drop down menus for certain programs ( in my case kdenlive and virtualbox ) not displaying their drop down menus in xmonad it might be this issue:

https://github.com/xmonad/xmonad-contrib/issues/73

The workaround proposed by geekosaur in that bug report appears to work for me, after about ten minutes of testing.

However if you've followed the usual introductions to xmonad you'll need to change "workspacen" for "myWorkspaces", as looking at this online paste that appears to be what geekosaur calls their workspaces variable. ( It might be a "variable", I don't know Haskell ).

So copy and paste this text into the appropriate place in your xmonad.hs file, and restart xmonad:

-- @@@@@@@@ HAAAAAAAAAACK
setWorkArea :: X ()
setWorkArea = withDisplay $ \dpy -> do
    a <- getAtom "_NET_WORKAREA"
    c <- getAtom "CARDINAL"
    r <- asks theRoot
    io $ changeProperty32 dpy r a c propModeReplace (concat $ replicate (length myWorkspaces) [0, 26, 3840, 1028])

Friday 9 December 2016

How to remove all notifications of FaceBook user status changes in Weechat when it's talking to Bitlbee

If you're using Weechat to talk to Bitlbee to talk to FaceBook ( or other instant messaging services ), your private message window for each user will be full of notifications that the user has joined or quit.

You can get rid of most of the notifications using this filter line:

/filter add joinquitbitlbee irc.bitlbee.* irc_join,irc_part,irc_quit *

Which is specified here,

However if you do this you'll see get the "is back on server" messages; to remove those as well you want to use this line:

/filter add joinquitbitlbee irc.bitlbee.* irc_join,irc_part,irc_quit,irc_nick_back *

If you want to see those messages temporarily, for example to see if someone is online or not, enable them in Weechat with ALT and "=". Use the same key combination to remove them.

Saturday 9 April 2016

Do the Seahawks need a good offensive line?

There's been a lot of consternation over the apparent lack of talent on the Seahawks Offensive Line. For example this article states it "may just be the worst position group in the entire NFL".

But, as squeaky as their playoff games were, the Seattle Seahawks were one score away from taking their Divisional playoff game into overtime, and did go 10-6 for the season; whereas the offensive lines I hear the most compliments about are the Browns and the Cowboys, who went 3-13 and 4-12 respectively.

So, do offensive lines matter? It's interesting to compare the 32 NFL team's successes against the quality of their offensive line and see if there's a match. I'm taking the quality of the offensive lines in the 2015 season from Pro Football Focus's rankings at the end of the season here: https://www.profootballfocus.com/blog/2016/01/20/pro-ranking-all-32-offensive-lines-this-season/ ; and my analysis... well, my quick look at some stats... is inspired by Shell Kapadia's article on ESPN: http://espn.go.com/blog/seattle-seahawks/post/_/id/18978/making-sense-of-the-seahawks-offensive-line-philosophy .

So, comparing offensive line rank to the most important statistic first, did the team make the playoffs or not?

Rank Team Playoffs?
1 Dallas Cowboys yes
2 Carolina Panthers yes
3 New Orleans Saints yes
4 Atlanta Falcons yes
5 Cleveland Browns yes
6 Oakland Raiders yes
7 Green Bay Packers yes
8 Cincinnati Bengals yes
9 Buffalo Bills yes
10 Pittsburgh Steelers yes
11 Washington Redskins yes
12 Philadelphia Eagles yes
13 Baltimore Ravens yes
14 Minnesota Vikings yes
15 Indianapolis Colts yes
16 Chicago Bears yes
17 Arizona Cardinals yes
18 Houston Texans yes
19 Jacksonville Jaguars yes
20 New York Giants yes
20 Denver Broncos yes
22 Kansas City Chiefs yes
23 Tampa Bay Buccaneers yes
24 Detroit Lions yes
25 New England Patriots yes
26 New York Jets yes
27 San Francisco 49ers yes
28 St Louis Rams yes
29 Tennessee Titans yes
30 Seattle Seahawks yes
31 Miami Dolphins yes
32 San Diego Chargers yes

So, apart from showing that tables are hard.... there is a pretty even spread of playoff teams across all levels of offensive line play quality.

How about teams versus wins? The X axis below is decreasing in offensive line rank from left to right, so you'd expect a general trend of wins to go down from left to right...

20160409085927.png

Same again, I see no trend by wins.

But how about a more realistic rating of how good a team is than wins, FootballOutsiders' offensive DVOA ranking? Lower numbers are a higher rank.

20160409093213.png

Again, all over the place.

Originally I planned some kind of scatter graph with team or helmet logos, but that's not something I can put together in a reasonable amount of time. So while it's something I've thrown together using online resources, and arguably some of the the axis should have been the other way around... I think the complete lack of any trend shows something. Especially as the offensive line is about half of one side of the team, and key to every play, I think the results are a little surprising; maybe of all the positions for the offensive line their team play is more important that a collection of individual statistics?

And maybe, in relation to the Seahawks, it shows that a philosophy of having an Offensive Line that is just good enough, rather than exemplary, especially considering the apparent lack of talent at the position, is the way to go?

Monday 21 March 2016

Prototype 2

You've somehow stumbled across this blog post because you want to know if Prototype 2 is worth playing. I played it on the Xbox360 and really enjoyed it.

This summary of the game pretty much tells you what you'll be doing:

"Tear your way through the quarantined streets of Manhattan, crushing tanks and ripping apart horrific mutants, with awesome super-mutant powers of your own. You are Sgt James Heller, a soldier and grieving husband, taking down everyone responsible for the murder of your family, and have your revenge!"

If you're wondering whether to spend the £16 or so on Xbox Live to download it, or pick up a second hand copy from somewhere like CEX for £4 the game will suit you if you want:

  • An offline game, no connectivity is required, there's no multi-player options. I think some of the "RADNet" functionality will have gone away if you're offline or buying this game so late that it's been removed from Xbox Live servers, but all you'll be missing are some side quests that mainly involve running across rooftops or throwing barrels into incinerators.
  • A game where you don't have to think that hard... as you can see from the summary above, contrary to my last game, Remember Me, in this case you're definitely in the "I'm a gruff male, and I need to avenge the loss of someone or something by killing everything in range" zone.
  • Hilariously over the top and indiscriminate combat - it would have been interesting to have a penalty for injuring or killing the citizens you're apparently there to protect, but due to the auto-aiming combat system and area effect of the weapons you'll obtain you'll find yourself shredding anything that gets in-between you and your target... whether you want to or not. At the start of the game those civilians will be bystanders you try to avoid, by one hour in they're just wandering health packs.
  • A game that isn't that difficult. I think I'm of about average ability for a video game player, and this game was only slightly challenging on Normal level.

In order to play it you will need:

  • At least 20 hours of time according to gamelengths.com, I'm sure I took longer, maybe 30 or 40.
  • No squick about blood or tendrils, there is a lot of cutting people apart in this game, or literally pulling them to pieces; and you obtain information from adversaries by literally consuming and absorbing them.
  • An acceptance of "game logic", you can evade helicopters chasing you by running around a corner and switching to a different identity, you gain powers by collecting things because that's what happens in video games, there are boss fights because there are always boss fights.
  • No extra cash, the DLC is all essentially optional as far as I could tell.

Saturday 12 March 2016

Does the Samsung EDD-S20HWE mobile phone dock work with a Samsung Galaxy Mega's MHL output over cables that claim to carry MHL, even the decent cables from StarTech that have 11 pins rather than 5?

No.