Tuesday, October 25, 2011

Fixing Samba failing to find canonical path for autofs mounted share locations

Following on from my previous post I was chatting with a friend and they pointed out that I could also make use of preexec to get my desired behaviour.

So I removed the entries for wide links and unix extensions from my smb.conf, allowing them to go back to being the default. I then changed my mythtv share to contain:

        comment = Myth TV Recordings
        path = /auto/mythtv
        guest ok = Yes
        preexec = ls /auto/mythtv

This then solves the issue of Samba not allowing the share to be opened due to the "canonicalize_connect_path failed for service " error.

Tuesday, September 27, 2011

Sharing an autofs mount point over Samba

Since upgrading to Samba 2:3.5.11~dfsg-1 (or possibly slightly earlier) on my Debian based home server I found that some of the shares were no longer working. I could see them when browsing the network device, it just wouldn't let me access them.

This seemed to only be happening to my Samba shares which were pointing directly at the root of an autofs mount point, which in my case was a mythtvfs mount at /auto/mythtv.

What made this more puzzling was that if I ssh'ed into the machine then I could happily do

ls /auto/mythtv
and see all my files. The final piece of the puzzle fitted into place when I realised that the Samba share would work if the mount was already mounted.

A look at the samba logs indicated the following:
  canonicalize_connect_path failed for service mythtv, path /auto/mythtv

On a hunch I tried the wide links option (which requires disabling unix extensions) by adding the following to the global section of my /etc/samba/smb.conf:

# Need to disable unix extensions and allow wide links to allow /auto to be mounted
unix extensions = no
wide links = yes
And then restarted samba with "/etc/init.d/samba restart". This then fixed the issue, allowing my autofs mount points to be mounted correctly. The big downside of this is that unix extensions which allow symlinks and hard links over samba are then disabled. If I get the time I might look into seeing if I can patch canonicalize_connect_path to work correctly with autofs mount points without exposing any security flaws.

Possibly the most irritating thing about this issue was that searching for the terms "Samba" and "autofs" gives lots of hits for the other side of the situation; using autofs to mount Samba shares automatically.

Friday, June 17, 2011

Tearing screen even with VSyncing on NVIDIA ION

I've got a home media machine which I to watch MythTV and various online video streaming services. It's been annoying me for a while (possibly since I updated to Ubuntu 11.04) that there was tearing on the screen. It looked exactly like it wasn't vsyncing correctly, but I had vsyncing enabled in all the players I was trying.

The machine I'm using is an Acer Revo with NVIDIA ION chipset, so it isn't the most powerful system. Searching the internet for 'tearing' turned up results which were mostly about people not being able to play 720p or 1080p videos. However that certainly wasn't my issue as I'd done all of the following:

  • Giving the graphics card 512MB of RAM (called UMA in the BIOS setting).
  • Enabling VDPAU acceleration.
  • Disabling the compiz window manager (selecting "Ubuntu classic (no effects)" as the session).
  • Setting export __GL_SYNC_TO_VBLANK=1 and ignoring issues with vsync occurring for the wrong display.
  • Checking the refresh rate was correctly setup with nvidia-settings utility.
  • Updating to the latest NVIDIA drivers

But none of this helped. I then realised that all rendering to the screen was suffering from this, not just video playback. I wondered if the ION couldn't handle the memory bandwidth, but turning down the resolution didn't help. I then thought that maybe it was my TV being a bit broken with HDMI, but testing that would require finding a VGA cable or moving a monitor downstairs, so I didn't try that.

I even got to the point of thinking about installing Windows XP to see if it had the same issue and, if it didn't, giving up on Ubuntu. However after one last search I discovered a post on the XBMC forum. It contained the wisdom of adding the following to /etc/X11/xorg.conf:
Section "Extensions"
    Option         "Composite" "Disable"

So I went ahead and did that, restarted X and all tearing was gone. I don't know where the bug is in the system, but I'm just glad of the ability in Linux to control things like this.

Monday, May 16, 2011

MythTV not going fullscreen in Ubuntu 11.04 (Natty Narwhal)

Recently I started upgrading my various MythTV front-end machines to Ubuntu 11.04. I was disappointed to discover that the unity bar at the top of the screen is still there.

In previous version of Ubuntu this would happen if you had the Appearance setting on anything other than basic (I forget exactly what it was called, but it was the first option in the last tab in the Appearance settings application).

However in 11.04 the Appearance settings application no longer has this options (this appears to be due to 11.04 using the Compiz window manage if it's available).

This is apparently a well known issue, but luckily the fix is fairly simple. From here I discovered that it's just a case of installing the advanced appearance settings application (called CCSM) and selecting Utility->Workaround->Legacy Fullscreen Support.

Quite what this workaround breaks and therefore why it isn't on by default isn't mentioned anywhere, but I'm happy for now as I can still watch TV.

Saturday, April 23, 2011

Updated Twitter Fixer

I've updated the twitter fixer user script so that now it doesn't cause some twitter information to be impossible to view. Previously if you clicked on a tweet or a twitter user to get further details then the box which contained the further details would be hidden on the right side of the screen.

This new version fixes that issue by presenting it to you in (almost) full screen, in the middle of your display.

If anyone sees any other issues then please let me know via a comment.

Wednesday, March 16, 2011

Twitter Column Expander

A friend mentioned to me that they were annoyed with the way the new Twitter layout wasted lots of pixels to the left and the right of the timeline. So I knocked together a quick user script for Google Chrome to do this.

I've had this sitting around for a while, but I've finally got around to setting up somewhere where I can put it.

Newspaper Spin Javascript

Looking for any excuse to play around with javascript I've written a newspaper spinning effect file which makes pages spin towards you like in the movies.

You can get it to happen on any site by saving the following link as a bookmark (or dragging it to your bookmark bar) and clicking on it:
Newspaper Spin This!

Turns out it's incredibly easy to do the transformations on the body element in HTML. It's just a case of setting the appropriate style value to the desired rotation amount.

Monday, January 31, 2011

User-scripts in Google Chrome aren't GreaseMonkey scripts

This weekend I was playing around with writing a GreaseMonkey script to force the new Twitter layout to take up the full screen width for the list of tweets.

What I expected to be a 5 minute job turned into an hour and a half. The main issue was that it turns out I wasn't writing a GreaseMonkey script. While the user-scripts in Google Chrome are very similar to GreaseMonkey scripts, they differ in how they handle security (as well as some other more minor differences such as no @require). Eventually I found a helpful page on the Chromiumn wiki explaining the differences.

For me the biggest difference was the absence of unsafeWindow. The easiest way I found to workaround this limitation (which is just a sensible security protect) was to inject the javascript to execute into the document.

The resulting code isn't pretty and is a little harder to debug, but it works and I now don't have large areas of blank screen space when using Twitter.

MythTV and network mounts

After setting up a MythTv 0.24 frontend to use a samba share for files from the backend I discovered that I could no longer watch live TV on it. If I tried to watch live TV there would just be a pause and then a "Error opening jump program file buffer" error message. Looking in the output on stdout wasn't much more helpful, with "Error: Took more than 10 seconds to be allowed to read, aborting" being about the only meaningful message.

It took me ages to track down that the problem is with cached IO on the network share. If the CIFS file system is caching the inode information (which includes the size attributes), then the MythTv frontend thinks that no live TV is being streamed and gives up after a while.

The solution to this is to add the 'directio' option when mounting the network partition (e.g. '-o directio' on the command line). If it's an NFS share then an alternative is to use 'forcedirectio' in the /etc/exports on the server (which is useful if you don't want to change all your MythTv frontends).

Friday, January 28, 2011

Upgrading MythTV 0.23 to 0.24 on Ubuntu

I recently upgraded MythTV 0.23 to 0.24 on both my backend (Debian testing) and the various front ends I use (Ubuntu with Mythbuntu auto-builds/MythTV-Updates).

Everything went smoothly until I tried to watch some TV or recordings from within the frontends. The video would playback at about half speed and with no audio.

After a while I managed to figure out that the problem was caused by using the default audio device. To fix this just update the audio device (in the frontend settings) to point to your actual audio device.

Saturday, January 22, 2011

Getting dual tuner KWorld U399 USB DVB-T working on linux 2.6.37

I recently upgraded the kernel version on my MythTV. One side affect of this was that the second tuner for my DVB-T USB stick (an af9015 based KWorld U399) no longer existed in /dev/dvb. In previous versions of the af9015 module it was just a case of explicitly enabling it with a module parameter of dual_mode=1 and possibly suffering some reception issues when both tuners are enabled.

To get the second tuner working it's necessary to use the very latest firmware for the device. So download the firmware file from here and place it in /lib/firmware. From a quick look at the source code for af9015 it looks like the driver now checks a value in the EEPROM to see if dual mode is safe or not. I assume the clever developer for the af9015 driver has worked out that this is what determines if there will be reception issues with both tuners enabled and that the firmware updates this EEPROM in a suitable way.

You'll need to unplug your USB stick and replug it in to get it to use the new firmware, but you should then get two DVB tuners.

Creative Commons License
The words and photos on this webpage which are created by Toby Gray are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 England & Wales License.