[SOLVED]xstart works exclusively as root

I had this happen multiple times, on different installs.
When using startx, it only works as root.
There doesn't seem to be any problems in the xorg log, either.
Last edited by democracy (2009-08-20 04:24:44)

have you configured your .xinitrc?
edit - i don't know what i was thinking when i asked the question that way... did you configure the one in /home/yourusername/.xinitrc
Last edited by AdrenalineJunky (2009-08-20 03:59:55)

Similar Messages

  • [SOLVED] startx works only as root

    Hi to all,
    I just installed arch on a vaio SVS13A with EFI and dual graphics, both HD4000 and nvidia. I am having troubles running X, startx works and shows the minimal environment only if I'm running it as root, if I'm running it as a normal user only a black screen appears and nothing happens, but there are no errors in Xorg.log. What's happening?
    A thing I noticed is that if I try to run
    Xorg -configure
    it is not able to do it because it says there are two screens and only one device or something like that (I'm sorry I can't remember well but I'll check next time). Maybe Xorg is not able to find the correct screen (?) when I'm running it as normal user?
    On the laptop there's a switch between "stamina" and "speed" to enable the discrete graphics card, I'm doing everything with the graphics disabled but the nvidia card seems to be recognized corretly anyway, maybe it's only a sw thing?
    Thank you in advance!
    p.s. I searched trough the forum and google but wasn't able to find a solution to my problem.
    Last edited by Mocco (2012-07-24 13:24:23)

    I added the configuration file for the two graphic cards but startx for the normal user is still terribly slow to start and I'm not able to use gdm.
    I don't want to use both graphic cards or use nvidia optimus or something like that for now, I just want to access gnome and use X. I'm using the intel integrated graphics since it seems the other is not working (if I configure xorg to use it it's not able to run). From xorg.log it seems intel i915 module is able to recognize the card but for some reason gdm is still not working and whowing me only black screen with the clock instead of mouse cursor. To me it seems HD4000 is recognized but for some reason gdm is not working.
    The situation is: two graphic cards (intel HD4000 and nvidia) and one monitor (my laptop monitor). I'm using nouveau and intel. No Ati and no dual screen.
    Where can I find some logs in order to find the problem? daemons.log says there's a problem with dbus: no such file or directory but it seems dbus is up and running.
    Last edited by Mocco (2012-07-24 11:32:59)

  • Does any of you do your FCS work (exclusively) on a Mac Book Pro?...

    This question does not relate, strictly speaking, to FCS itself but rather to those users who require the kind of computing power FCS requires to run.... so I hope it's ok to post here. Please excuse me if not....
    I'm just wondering... *does any of you work exclusively - or almost exclusively - on a (17") macbook pro?* I mean, really do your work/carry out your job on one of these computers?
    My erstwhile state-of-the-art desktop G5, the last of the non-intel macs (purchased about 4 years ago?), is starting to drive me nuts. It has served me well but the time has come for me to upgrade my machine....
    I use Creative Suite apps daily for my work (publishing a quarterly printed magazine) and also do some work in Final Cut Studio. I expect that, over the next year or so, I'll be using FCS more and more, to create short videos (< 10 mins) related to my work. These will almost certainly be for web delivery only.
    I have been on the verge of buying a new mac pro, 8-core, but am wavering given that I may soon be going abroad for 9 months, continuing my work while abroad. If that happens, I'll need to take whatever computer I buy - either the mbp or the mac pro (which I would be plugging in in the apartment I'll be renting).
    *Is the mbp a machine that any of you works on daily... and that you use to run the apps mentioned above?...* Thanks in advance for your thoughts.
    I know this question is a bit like saying 'What car should I buy?' so be gentle, please ;o)
    Hugh
    p.s. incidentally, before I got my desktop G5, I used to do all my work on a 17" Powerbook G4. No video back then tho'. Those were the days!...

    Well, I may be unsuited to answering your question as I rarely do any of MY work on a MBP, but I am aware of their capabilities.
    Based on what you've stated, I see no reason why you CAN'T work with a MBP. They tend to handle CS applications well. Especially AI and PS (I'm assuming since you work for print that you're not using AE much). I've also used it for FCS.
    Your limitations are sort of what you might expect. You can't install a video capture card, so you're kind of limited to what you can injest via FW. (Unless the injest is done for you, and then you can just hook up a drive).
    The amount of RAM you can put in there is limited, but these days there tends to be plenty to run those apps.
    Frankly, my biggest issue is screen size, and keyboard size. I can't stand staring at a 17" screen for Photoshop work, and I'm used to standard keyboards so I don't like typing on those smallish laptop keyboards. I hate the track pad as well, but at least you can connect a mouse if you want.
    So, if none of those things bother you, a MBP is much easier to lug around than a Mac Pro.
    Andy

  • [SOLVED] LXDE menu blank unless root?

    I'm new to Arch Linux and have been setting it up for my netbook and have run into a problem. I have installed LXDE but when i run it as a non-root user the menu is blank showing only "Run" and "Logout", as root everything is there. When i logout there are a few errors in the terminal (cannot load netstat plugin, unable to find a valid menu file and some dbus stuff) but these same messages come up regardless of whether im root or the normal user so they dont explain why the menu isnt working. The openbox menu.xml file is the same for both root and my user account. I haven't had any luck looking for a solution on the forums, wiki or google.
    Last edited by brent012 (2012-04-21 00:58:24)

    headkase wrote:
    Did you do this:
    mkdir -p ~/.config/openbox
    cp /etc/xdg/openbox/menu.xml /etc/xdg/openbox/rc.xml /etc/xdg/openbox/autostart ~/.config/openbox
    What is in your "~/.config/openbox" folder?  Perhaps you are using a system-wide configuration instead of a user-configuration if you didn't copy those skeleton files?
    I'll try to help but I don't have much experience with LXDE, I'll take a moment to do a shameless plug for Xfce4 which I'm competent enough with that it's not broken... Yet...
    Yeah i did do that. In root i only have lxde-rc.xml, but as my user it has autostart, environment, lxde-rc.xml, menu.xml, rx.cml. Autostart, environment and menu.xml are green too?
    swanson wrote:Your own app/system menu in lxpanel, thats the one, not openbox menu ? If that's the case then the menu config should be in /home/"user"/.config/lxpanel. You might have to rebuild the menu cache for lxpanel menu; rm all in .cache/menus - restart lxpanel.
    That would make sense, i dont have any config files there a root or user though - so once again i can't understand why it's working normally as root. I've already removed the menu caches stuff once before and it didn't change anything when i ran lxde again.

  • Working exclusively from External Drive

    I want to get Lightroom 5 off of my HD and get it on an external drive to free up space. I want to work exclusively on the external drive.  After working on my pics for a couple months, I will be traveling to another home which has a mac so I need to import what I have been working on to the external drive at that home.  Please advise how I need to do this.

    You could  select the master folder and "Export as a Catalog" to create a catalog copy, including image files, on the external drive.
    OR copy your Image folders to the external, keeping the exact same folder structure, and copy the Lightroom Catalog folders also. Restart LR by opening the .LRCAT file in its new location on the external drive.
    Great info at this link-
    Running Out of Space? How to Move Photos to Another Hard Drive | Laura Shoe's Lightroom Training, Tutorials and Tips
    The Lightroom program however must reside on an internal Drive, so will need to be installed on the remote computer. You are allowed to have two installations (using only one at any time). You will need the Install file and the Serial Key.
    (If your Serial Key is for an 'Update'  version, you will also need the Serial Key for any previous 'Full' version purchased.

  • [SOLVED] After Arch install, non-root wont boot into Gnome

    First off I searched for around an hour but couldn't find an answer to this so somewhat gave up.
    Coming from Ubuntu and very dissatisfied with performance I am very excited for Arch.
    I followed the newb guide to a T, everything went smooth as butter.
    after the guide was finished I installed Gnome3
    pacman -S gnome gnome-shell gnome-extra
    Went perfect.  I try and login to the user I created while going thru the guide and instantly boot into the basic X environment?
    So I thought perhaps I should try adduser after I installed Gnome3 and now when logging into that new user, the screen goes black for 2sec then
    greets me with this message (still in command):
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Aug 12 22:46:05 2011
    (==) Using config directory: "/etc/X11/xorg.conf.d"
    (EE) Failed to load module "vesa" (module does not exist, 0)
    (EE) Failed to load module "fbdev" (module does not exist, 0)
    (II) [KMS] Kernel modesetting enabled.
    (EE) Logitech Logitech Illuminated Keyboard: failed to initialize for relative axes.
    (EE) Logitech G500: failed to initialize for relative axes.
    xinit: connection to X server lost
    Any ideas as to what's going on?
    Last edited by PumpkinJack (2011-08-13 20:59:07)

    Durden wrote:Did you install GDM? How are you launching X? What groups is the user in?
    Thanks for the reply.
    Yeah I installed GDM after gnome, everything works great for root.
    im using startx to launch X
    Just using the default group per newbie guide instructions which I believe is users

  • [SOLVED] systemd problem: scanimage works only as root

    Hello,
    I can list the scanner with lsusb, and it works with no error messages when I run scanimage. But the image file I get is corrupted. However if I do it as root, then the file is OK.
    I've just changed to systemd and I wonder if that might have something to do with it.
    Any help with this problem would be greatly appreciated. Thank you.
    Last edited by troncoso (2012-09-05 20:05:03)

    troncoso wrote: I added my private group to those listed in the 'SystemGroup' directive in cupsd.conf, and that fixed it.
    Thank you for your comment.  My line nuber 13 of cupsd.conf looks now like this and sort of fixed the issue.
    SystemGroup sys root users
    Scanimage -L works without complain, but it takes much longer time then before. There is huge delay fore the scanning starts.
    If I stop cups by issuing /etc/rc.d/cupsd stop  The problem starts again, however there is no delay.
    The corrupted scan image file has got the "Failed cupsGetDevices" at the very beginning of it added.  That is why it is corrupted.
    If I do scanning using xsane, there is no delay nor corrupted file. It just works fine without cupsd running.
    Is there any way I can fix this issue and don't let cups to delay the scanning nor add the "Failed cupsGetDevices" at the beginning of the file ?
    Is there a way to say scanimage not to use cups  at all?
    Last edited by xsouku04 (2012-09-30 21:40:37)

  • [Solved] kernel 2.6.27 - Root device not found (2.6.28 too)

    since the last kernel update, my ArchLinux won't boot anymore, as it seems to be unable to find the root partition "/dev/sda5". The exact output is:
    :: Loading root filesystem module...
    Attempting to create root device '/dev/sda5'
    ERROR: Failed to parse block device name for '/dev/sda5'
    unknown
    ERROR: root fs cannot be detected. Try using the rootfstype= kernel parameter.
    Waiting for devices to settle...done.
    Root device '/dev/sda5' doesn't exist, attempting to create it
    ERROR: Failed to parse block device name for '/dev/sda5'
    ERROR: Unable to create/detect root device '/dev/sda5'
    Dropping to a recovery shell... type 'exit' to reboot
    NOTE: klibc contains no 'ls' binary, use 'echo *' instead
    If the device '/dev/sda5' gets created while you are here,
    try adding 'rootdelay=8' or higher to the kernel command-line
    ramfs$
    What I have tried:
    1.- I have booted with an old Ubuntu LiveCD, and /dev/sda5 seems to be working and healthy, as it mounted flawlessly while in Ubuntu.
    2.- I have also found that not even /dev/sda is created from the fallback recovery shell so, obviously, there is no root device to create.
    3.- None of the suggested kernel command-line parameters worked: 'rootfstype=ext3' and/or 'rootdelay=8'(I mean, using them separately or both in the same kernel GRUB line) didn't give any positive result, or any behavior change.
    And now, two questions:
    1.- How can I fix this?
    2.- If it's not possible, how can I downgrade the kernel from a LiveCD? I suppose this is possible by booting an ArchLinux LiveCD, chrooting my '/dev/sda5' finding a 2.26.X kernel pacman package and installing, but I'm almost iliterate in kernel issues, and some help would be nice.
    Thank you all in advance!
    EDIT: Oh, I have also waited for some time to see if the hard disk gets ready after the failed booting proccess but it seems it doesn't, so 'rootdelay=8' wouldn't help anyway, just to give some more details about the problem.
    Last edited by 4s|m3tr|ko0 (2009-01-21 10:14:32)

    4s|m3tr|ko0 wrote:
    ballon wrote:It seems like my problems can be the same, however I haven't managed to solve it myself so if you can be more detailed that would be nice.
    Of course I can, it's quite easy.
    First of all, you have to boot from an Archlinux install CD, to have an usable environment. Once you have booted, I will assume a couple of things to make the examples, which are:
    "/dev/sda2" is the root partition where the system is currently installed but not booting.
    "/dev/sda1" is the boot partition (not needed if you don't have a separated boot partition, obviously).
    "/mnt/myarch" is the directory where sda1 will be mounted on the live session.
    The kernel version on sda2 is "2.6.27-ARCH", you can find which kernel versions are installed on sda2 by checking the directory names under "/lib/modules/"
    Next you have to mount your root partition on any directory and mount the "boot" partition if you have one too:
    mkdir /mnt/myarch #Creates the mount directory on the live session, you can use /mnt/ so this command is not neccesary
    mount -t auto /dev/sda2 /mnt/myarch #Mount the root partition on the live session
    mount -t auto /dev/sda1 /mnt/myarch/boot #Mount the boot partition, if you have to
    Now, you'll have to bind three system directories to their true locations on the root partition:
    mount -t proc proc /mnt/myarch/proc
    mount -t sysfs sys /mnt/myarch/sys
    mount -o bind /dev /mnt/myarch/dev
    Next step is to use the command "chroot <target> <consolebin>" to "move" the system root to the <target> directory, using the <consolebin> command interpreter:
    chroot /mnt/myarch/ /bin/bash
    Now, you will be using your system just like if you had actually booted from your hard disk, but running the kernel from the liveCD, so the only remaining step is to generate the initcpio image.
    In the example for this step, I will run the mkinitcpio twice, the first one to check that it's correctly generated, and the second to install it, using the parameter "-g". Another thing to keep in mind is that even before chrooting, the liveCD kernel is still running, so you will have tu use the "-k <kernelversion>" parameter to manually specify the kernel to use. Otherwise, mkinitcpio won't be able to find the correct modules to use:
    mkinitcpio -k 2.6.27-ARCH #This will simulate the generation, if it runs fine, run the next command
    mkinitcpio -g /boot/kernel26.img -k 2.6.27-ARCH #This will actually generate the image
    And that's all, this should regenerate a default image. More info about mkinitcpio: http://wiki.archlinux.org/index.php/Mkinitcpio
    Hope this heps
    PS: Sweden, nice country .
    I follow this guide and I saved my Arch installation. I don't know why the HOOKS array in my mkinitcpio.conf just contains "base" :-?
    So, just before regenerate the ramdisk image I edit my /etc/mkinitcpio.conf and add all the neccessary hooks and generate. I can bring my Arch box back to life

  • [Solved]Boot from USB HDD - Root device doesn't exist. Major/minor

    My problem is that the kernel seems (or starts) to load, but then I get an error:
    Root device 'UUID=1234 . . .' doesn't exist.
    Attempting to create it.
    ERROR: Unable to determine major/minor number of root device "UUID=1234 . . .'
    You are being dropped into recovery shell
    I found a few links on the web and in the forums, but nothing that really solved it for me. The solved ones usually downgraded the kernel.  I haven't done that yet.  I thought I'd try here first.
    I have a 320GB USB HDD that I have been using to experiment with different linux distros.  I have a few working successfully (OpenSUSE,Mint,Ubuntu,Debian,Fedora,etc).  I'm very new at this but have been reading a lot and putting a lot of time into it.  I have legacy grub loaded on the MBR and use the menu.lst on my openSUSE partition to boot everything.  Because the partitions for some of the distros are so far into the disk I needed to create directories on openSUSE's /boot directory to contain the kernel and initrramfs files (like /boot/fedora).  This seems to work for the other distros.  I did the same thing for Arch.
    So when I installed Arch I haven't used the bootloader section of the installation.
    I'm using the 2011.08.09-netinstall-i686.iso Live CD.
    I tried a few things including:
    1.    changing the HOOKS in /etc/mkinitcpio.conf
        a.    adding usb to the "HOOKS"
        b.    removing and adding autodetect
        c.    adding and removing "sata_sil" (although I'm not even sure if my device uses it)
    2.    changing the kernel line:
        a.    from using "UUID=" to (hd0,1) to sdb1.
        b.    added rootdelay=8
    3.    repartition all of my arch partitions using cfdisk from my Live CD and reinstall. I used gparted on OpenSUSE to do it the first time.
    This may be connected. When I fdisk -l from the Arch Live CD I get extra data and an error for each of my arch partitions (and only my arch partitions):
    Disk does't contain a valid partition table
    When I fdisk -l from OpenSUSE I don't get the data paragraphs or errors about the arch partitions?
    Here is my /etc/fstab:
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    tmpfs /tmp tmpfs nodev,nosuid 0 0
    UUID=0e7556ef-b832-43e9-a8ba-c68dd2cd6143 /var reiserfs defaults 0 1
    UUID=510bb601-13c1-46ec-87c0-a800dd2efb8b / ext4 defaults 0 1
    UUID=cd78ab04-742d-4ba5-9727-90727de2dd14 swap swap defaults 0 0
    UUID=dc5685e3-35b0-46d4-b259-61f2530ff36a /home ext3 defaults 0 1
    And my HOOKS:
    HOOKS="base udev autodetect pata scsi sata usb filesystems usbinput"
    And my menu.lst:
    1
    default 0
    timeout 32
    gfxmenu (hd0,1)/boot/message
    ###openSUSE on sda2 - legacy grub
    title openSUSE 11.4 - Celadon - gnome
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.37.6-0.7-default root=/dev/disk/by-id/usb-Seagate_FreeAgent_GoFlex_NA0E702X-0:0-part2 resume=/dev/disk/by-id/usb-Seagate_FreeAgent_GoFlex_NA0E702X-0:0-part1 splash=silent quiet showopts nomodeset vga=0x314
    initrd /boot/initrd-2.6.37.6-0.7-default
    ###openSUSE failsafe on sda2 - legacy grub
    title Failsafe -- openSUSE 11.4 - 2.6.37.6-0.7
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.37.6-0.7-default root=/dev/disk/by-id/usb-Seagate_FreeAgent_GoFlex_NA0E702X-0:0-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
    initrd /boot/initrd-2.6.37.6-0.7-default
    ###floppy###
    #title Floppy
    # rootnoverify (fd0)
    # chainloader +1
    ###Fedora on sda5 - legacy grub
    title Fedora 15-Lovelock gnome
    root (hd0,4)
    configfile /boot/grub/grub.conf
    ###Mint on sda6 - grub2
    title Mint 9 Lucid Lynx gnome
    root (hd0,5)
    kernel /boot/grub/core.img
    savedefault
    boot
    ###PCLinux on sda7 - legacy grub
    title PCLinuxOS 2011.6 KDE
    root (hd0,6)
    chainloader +1
    ###Ubuntu on sda8 - grub2
    title Ubuntu 10.04.2 gnome
    root (hd0,7)
    kernel /boot/grub/core.img
    savedefault
    boot
    ####arch on sda10 - legacy grub
    title ARCH
    root (hd0,1)
    #root UUID=XXXXXXXXXX44c5a3cd-dcb5-4cf1-933e-7a8ebac2a992
    kernel /boot/arch/vmlinuz-linux root=UUID=510bb601-13c1-46ec-87c0-a800dd2efb8b ro rootdelay=8
    #kernel /boot/arch/vmlinuz-linux root=(hd0,9)
    #kernel /boot/arch/vmlinuz-linux root=/dev/sda10
    initrd /boot/arch/initramfs-linux.img
    savedefault
    boot
    ###Debian on sda11 - grub2
    title Debian 6.0.2.1 squeeze gnome
    root (hd0,1)
    kernel /boot/debian/vmlinuz-2.6.32-5-686 root=UUID=2b6052e2-ecdf-4796-81c8-b9e9142ca159 ro
    initrd /boot/debian/initrd.img-2.6.32-5-686
    savedefault
    boot
    ###Mandriva on sda12 - legacy grub
    title Mandriva 2011 KDE
    root (hd0,1)
    kernel /boot/mandriva/vmlinuz-2.6.38.7-desktop-1mnb2 root=UUID=5033f7fb-cac7-4db5-920c-c8bd2b51365f ro
    initrd /boot/mandriva/initramfs-2.6.38.7-desktop-1mnb2.img
    savedefault
    boot
    Here is my fdisk -l from OpenSUSE.  I'm not quite swift enough to mount the hard drive and use the script utility from the Live CD yet, at least not tonight:
    Disk /dev/sda: 320.1 GB, 320072932864 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142447 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000c3bbb
    Device Boot Start End Blocks Id System
    /dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
    /dev/sda2 4208640 46153727 20972544 83 Linux
    /dev/sda3 46153728 87113727 20480000 83 Linux
    /dev/sda4 87115770 614031755 263457993 5 Extended
    /dev/sda5 87115776 128075775 20480000 83 Linux
    /dev/sda6 128077824 169037823 20480000 83 Linux
    /dev/sda7 169039872 209999871 20480000 83 Linux
    /dev/sda8 210001920 250961919 20480000 83 Linux
    /dev/sda9 250963968 291923967 20480000 83 Linux
    /dev/sda10 291924031 332886015 20480992+ 83 Linux
    /dev/sda11 332888064 373848063 20480000 83 Linux
    /dev/sda12 373848678 414992383 20571853 83 Linux
    /dev/sda13 414994432 435474431 10240000 83 Linux
    /dev/sda14 435474495 455956829 10241167+ 83 Linux
    /dev/sda15 455958528 578881535 61461504 b W95 FAT32
    /dev/sda16 578881599 614031755 17575078+ 83 Linux
    Disk /dev/sdb: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x95aa95aa
    Device Boot Start End Blocks Id System
    /dev/sdb1 * 63 294889139 147444538+ 7 HPFS/NTFS/exFAT
    /dev/sdb2 294889140 312576704 8843782+ 7 HPFS/NTFS/exFAT
    That's it for now.
    Last edited by newbie55 (2011-09-23 22:19:58)

    I'm IN!  Thanks everyone for your suggestions!
    The arch system didn't like the identifier I was using for the root partition. By looking at the /dev/disk/by-id while the arch system was running, I could see what the system wanted me to call the partition.  So after the system error'd-out and I was in the recovery shell at the [ramfs /] prompt:
    # ls -lF /dev/disk/by-id > by-id.txt
    # vi by-id.txt
    I could have used any of the identifiers listed in the by-id (there were 3), by-uuid(1), by-label(1) or by path(1). I tried them all. I had to write these down by hand because it is a ram filesystem.
    The article that finally got me there is:
    https://wiki.archlinux.org/index.php/Pe … ice_naming
    Anyway my openSUSE grub menu.lst ended up like this:
    ####arch on sda10 - legacy grub
    title ARCH
    root (hd0,1)
    kernel /boot/arch/vmlinuz-linux root=/dev/disk/by-uuid/510bb601-13c1-46ec-87c0-a800dd2efb8b ro rootdelay=8 rootfstype=ext4
    initrd /boot/arch/initramfs-linux.img
    savedefault
    boot
    It's easy once you: 1. beat your head against the wall
                        2. read further
                3. repeat 1 and 2
    Back to the "Beginner's Guide",4 Post-Installation.  Yikes!

  • [SOLVED] fbsplash working but have a created future problems?

    I'm new to arch but have managed to successfully install fbcondecor and fbsplash and manipulate them to at least a reasonable degree to get the desired effect.  However my tech-speak is poor so please bear with me. 
    The problem is that my splash screen seems to look fine, initially.  Then, however, when Vesa hands off to inteldrm the graphics get distorted. I believe it is whenever the screen resolution change occurs during the boot (which is why i believe it occurs during the handoff).  I have listed my grub configuration files as well as my daemons and Hooks below in hopes one of you guys may recognize an error.  I have read and attempted to resolve the issue but it is clear I cannot solve it without some assistance from someone with a deeper knowledge.
    This is what my screen looks like https://bbs.archlinux.org/viewtopic.php?id=136819 so I'm guessing it relates to the KMS but I configured the file in accordance with the wiki so...
    Edit:  Another possibly pertinent note is that the splash works perfectly on shutdown.
    /etc/default/grub
    GRUB_GFXPAYLOAD_LINUX=keep
    GRUB_DISABLE_RECOVERY=true
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="Arch Linux"
    GRUB_DEFAULT=saved
    GRUB_GFXMODE=1024x768x32
    GRUB_CMDLINE_LINUX_DEFAULT='quiet loglevel=3 logo.nologo console=tty1 splash=silent,fadein,fadeout,theme:arch-elegant'
    GRUB_PRELOAD_MODULES="part_gpt part_msdos"
    GRUB_TERMINAL_INPUT=console
    GRUB_THEME=/boot/grub/themes/starfield/theme.txt
    GRUB_CMDLINE_LINUX=splash
    GRUB_HIDDEN_TIMEOUT=3
    Hooks   
    HOOKS="base udev uswsusp fbsplash autodetect pata scsi sata filesystems usbinput uresume fsck"
    Daemons 
    DAEMONS=(hwclock dbus !network fbcondecor sshd @netfs @crond acpid @networkmanager laptop-mode !net-profiles syslog-ng !net-auto-wireless @cupsd)
    What should I be looking for to solve this problem?  What occurs that changes the screen from the basic resolution it starts with to the enhanced resolution in the next portion of boot?  Should I post dmesg output?
    Last edited by jallenusn (2012-06-19 20:41:53)

    The question here is, why does it get loaded in the first place, usually it's loaded by the vga= statement. I'm guessing the monstrosity that is grub2 has something to do with it, remove all the GFX stuff from it's config.
    Thanks for your input.  You are correct in your assumption about my screen resolution being 1366x768.  I am having trouble understanding what you mean by "remove all the GFX stuff".  Do you mean for me to change my /etc/default/grub file and leave blank all of the categories that include "GFX" and then mkconfig?  Or are you proposing that I manually modify something in the grub.cfg to disable the graphics mode in grub2? 
    One other quick note.  It seems that before Vesa hands off to inteldrm the splash looks as intended.  It is after this hand off takes place that the splash becomes distorted (4 different occurences of the splash across the screen, all of them appearing shredded and smeared across the screen).
    Edit:  Another possibly pertinent note is that the splash works perfectly on shutdown.
    Also, for further reference I have posted both my /etc/default/grub & /boot/grub/grub.cfg below. 
    GRUB_GFXPAYLOAD_LINUX=keep
    GRUB_DISABLE_RECOVERY=true
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="Arch Linux"
    GRUB_DEFAULT=saved
    GRUB_GFXMODE=1366x768x32
    GRUB_CMDLINE_LINUX_DEFAULT='quiet loglevel=3 logo.nologo console=tty1 splash=silent,fadein,fadeout,theme:arch-elegant'
    GRUB_PRELOAD_MODULES="part_gpt part_msdos"
    GRUB_TERMINAL_INPUT=console
    GRUB_THEME=/boot/grub/themes/starfield/theme.txt
    GRUB_CMDLINE_LINUX=splash
    GRUB_HIDDEN_TIMEOUT=3
    # DO NOT EDIT THIS FILE
    # It is automatically generated by grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    ### BEGIN /etc/grub.d/00_header ###
    insmod part_gpt
    insmod part_msdos
    if [ -s $prefix/grubenv ]; then
    load_env
    fi
    set default="${saved_entry}"
    if [ x"${feature_menuentry_id}" = xy ]; then
    menuentry_id_option="--id"
    else
    menuentry_id_option=""
    fi
    export menuentry_id_option
    if [ "${prev_saved_entry}" ]; then
    set saved_entry="${prev_saved_entry}"
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi
    function savedefault {
    if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
    fi
    function load_video {
    if [ x$feature_all_video_module = xy ]; then
    insmod all_video
    else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
    fi
    if [ x$feature_default_font_path = xy ] ; then
    font=unicode
    else
    insmod part_msdos
    insmod btrfs
    set root='hd0,msdos3'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 719a75c8-81fa-4f8d-b06a-b2ab3ba18770
    else
    search --no-floppy --fs-uuid --set=root 719a75c8-81fa-4f8d-b06a-b2ab3ba18770
    fi
    font="/usr/share/grub/unicode.pf2"
    fi
    if loadfont $font ; then
    set gfxmode=1366x768x32
    load_video
    insmod gfxterm
    set locale_dir=$prefix/locale
    set lang=en_US
    insmod gettext
    fi
    terminal_input console
    terminal_output gfxterm
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 54d38b5e-db10-4162-bfcd-1226ada0d561
    else
    search --no-floppy --fs-uuid --set=root 54d38b5e-db10-4162-bfcd-1226ada0d561
    fi
    insmod gfxmenu
    loadfont ($root)/grub/themes/starfield/dejavu.pf2
    insmod png
    set theme=($root)/grub/themes/starfield/theme.txt
    export theme
    if sleep --verbose --interruptible 3 ; then
    set timeout=5
    fi
    ### END /etc/grub.d/00_header ###
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Arch Linux GNU/Linux, with Linux fbcondecor kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-fbcondecor kernel-true-719a75c8-81fa-4f8d-b06a-b2ab3ba18770' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 54d38b5e-db10-4162-bfcd-1226ada0d561
    else
    search --no-floppy --fs-uuid --set=root 54d38b5e-db10-4162-bfcd-1226ada0d561
    fi
    echo 'Loading Linux fbcondecor kernel ...'
    linux /vmlinuz-linux-fbcondecor root=UUID=719a75c8-81fa-4f8d-b06a-b2ab3ba18770 ro splash quiet loglevel=3 logo.nologo console=tty1 splash=silent,fadein,fadeout,theme:arch-elegant
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux-fbcondecor.img
    menuentry 'Arch Linux GNU/Linux, with Linux fbcondecor kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-fbcondecor kernel-fallback-719a75c8-81fa-4f8d-b06a-b2ab3ba18770' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 54d38b5e-db10-4162-bfcd-1226ada0d561
    else
    search --no-floppy --fs-uuid --set=root 54d38b5e-db10-4162-bfcd-1226ada0d561
    fi
    echo 'Loading Linux fbcondecor kernel ...'
    linux /vmlinuz-linux-fbcondecor root=UUID=719a75c8-81fa-4f8d-b06a-b2ab3ba18770 ro splash quiet loglevel=3 logo.nologo console=tty1 splash=silent,fadein,fadeout,theme:arch-elegant
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux-fbcondecor-fallback.img
    menuentry 'Arch Linux GNU/Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-719a75c8-81fa-4f8d-b06a-b2ab3ba18770' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 54d38b5e-db10-4162-bfcd-1226ada0d561
    else
    search --no-floppy --fs-uuid --set=root 54d38b5e-db10-4162-bfcd-1226ada0d561
    fi
    echo 'Loading Linux core repo kernel ...'
    linux /vmlinuz-linux root=UUID=719a75c8-81fa-4f8d-b06a-b2ab3ba18770 ro splash quiet loglevel=3 logo.nologo console=tty1 splash=silent,fadein,fadeout,theme:arch-elegant
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux.img
    menuentry 'Arch Linux GNU/Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-719a75c8-81fa-4f8d-b06a-b2ab3ba18770' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 54d38b5e-db10-4162-bfcd-1226ada0d561
    else
    search --no-floppy --fs-uuid --set=root 54d38b5e-db10-4162-bfcd-1226ada0d561
    fi
    echo 'Loading Linux core repo kernel ...'
    linux /vmlinuz-linux root=UUID=719a75c8-81fa-4f8d-b06a-b2ab3ba18770 ro splash quiet loglevel=3 logo.nologo console=tty1 splash=silent,fadein,fadeout,theme:arch-elegant
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux-fallback.img
    if [ "x$default" = 'Arch Linux GNU/Linux, with Linux core repo kernel' ]; then default='Advanced options for Arch Linux GNU/Linux>Arch Linux GNU/Linux, with Linux core repo kernel'; fi;
    ### END /etc/grub.d/10_linux ###
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    ### END /etc/grub.d/20_memtest86+ ###
    ### BEGIN /etc/grub.d/30_os-prober ###
    ### END /etc/grub.d/30_os-prober ###
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    Last edited by jallenusn (2012-06-17 17:57:32)

  • [solved] No ide_disk module = no root device

    Does anyone know what CONFIG_BLK_DEV_IDEDISK was replaced by? As of 2.6.27 it's obsolete, but w/o it my system can't boot (no root disk devices created).
    Edit- NVM, my dumbass didn't have all the hooks needed, although on a slightly related note, is loading all the modules I need as easy as specifying them specifically, and having no hooks.
    Last edited by omgwtfbyobbq (2009-04-18 05:31:05)

    AlexanderHolmgaard,
    you don't NEED pulseaudio to have a working sound system (i'm running pure alsa since i started using linux on all my systems and those i help maintain).
    Your problem was likely caused by incorrect settings in /etc/asound.conf or ~/.asoundrc .
    Pulseaudio changes those files in order to ensure pulse and alsa work together as intended.
    In short, you didn't solve your problem but just got lucky pulseaudio works OOTB on your system.
    (troubleshooting pulseaudio tends to be much harder then troubleshooting alsa)

  • [SOLVED] load VirtualBox modules without root pw

    Hi,
    i want to write a wrapper script for virtualbox to load the modules when virtualbox starts and unload them when it exits.
    is there a way to load those specific modules without root password? i could teach sudo to allow modprobe without password but that would be a security problem.
    Last edited by jnhieber (2013-07-13 16:42:19)

    I'm experiencing some problems with suspend to ram on my x230t. since kernel 3.10 i often get a kernel panic when i suspend.
    i use an up to date system (no testing) with linux-ck-ivybridge and intel graphics. i wrote systemd scripts to unload third party modules before suspend (like vboxdrv).
    that actually doesn't solve the problem but i thought it might be a good idea if only loading such modules when they are really needed, i don't use virtualbox often.
    thanks for the reply, i think this can work. the script can only be changed by root so this would be no security problem.
    so this is solved, i'm thinking about a new topic regarding my kernel panics, do you know where to get the kernel logs of the panic?
    when i go to suspend the sleep led blinks fast and the screen is blank, so i have to rely on log files.

  • [SOLVED] tv_grab_nl_py works with python 2.6.5, fails on 3.1.2

    Hi All,
    I have updated my mediacenter. Now tv_grab_nl_py does not work anymore:
    [cedric@tv ~]$ tv_grab_nl_py --output ~/listings.xml --fast
    File "/usr/bin/tv_grab_nl_py", line 341
    print 'tv_grab_nl_py: A grabber that grabs tvguide data from tvgids.nl\n'
    ^
    SyntaxError: invalid syntax
    [cedric@tv ~]$
    the version of python on the mediacenter (running arch linux):
    [cedric@tv ~]$ python
    Python 3.1.2 (r312:79147, Oct 4 2010, 12:35:40)
    [GCC 4.5.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    I have copied the file to my laptop, there it looks like it's working:
    ./tv_grab_nl_py --output ~/listings.xml --fast
    Config file /home/cedric/.xmltv/tv_grab_nl_py.conf not found.
    Re-run me with the --configure flag.
    cedric@laptop:~$
    the version of python on my laptop (running arch linux):
    cedric@laptop:~$ python
    Python 2.6.5 (r265:79063, Apr 1 2010, 05:22:20)
    [GCC 4.4.3 20100316 (prerelease)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    the script I'm trying to run:
    [cedric@tv ~]$ cat tv_grab_nl_py
    #!/usr/bin/env python
    # $LastChangedDate: 2009-11-14 10:06:41 +0100 (Sat, 14 Nov 2009) $
    # $Rev: 104 $
    # $Author: pauldebruin $
    SYNOPSIS
    tv_grab_nl_py is a python script that trawls tvgids.nl for TV
    programming information and outputs it in XMLTV-formatted output (see
    http://membled.com/work/apps/xmltv). Users of MythTV
    (http://www.mythtv.org) will appreciate the output generated by this
    grabber, because it fills the category fields, i.e. colors in the EPG,
    and has logos for most channels automagically available. Check the
    website below for screenshots. The newest version of this script can be
    found here:
    http://code.google.com/p/tvgrabnlpy/
    USAGE
    Check the web site above and/or run script with --help and start from there
    HISTORY
    tv_grab_nl_py used to be called tv_grab_nl_pdb, first released on
    2003/07/09. The name change was necessary because more and more people
    are actively contributing to this script and I always disliked using my
    initials (I was just too lazy to change it). At the same time I switched
    from using CVS to SVN and as a result the version numbering scheme has
    changed. The lastest official release of tv_grab_nl_pdb is 0.48. The
    first official release of tv_grab_nl_py is 6.
    QUESTIONS
    Questions (and patches) are welcome at: paul at pwdebruin dot net.
    IMPORTANT NOTES
    If you were using tv_grab_nl from the XMLTV bundle then enable the
    compat flag or use the --compat command-line option. Otherwise, the
    xmltvid's are wrong and you will not see any new data in MythTV.
    CONTRIBUTORS
    Main author: Paul de Bruin (paul at pwdebruin dot net)
    Michel van der Laan made available his extensive collection of
    high-quality logos that is used by this script.
    Michael Heus has taken the effort to further enhance this script so that
    it now also includes:
    - Credit info: directors, actors, presenters and writers
    - removal of programs that are actually just groupings/broadcasters
    (e.g. "KETNET", "Wild Friday", "Z@pp")
    - Star-rating for programs tipped by tvgids.nl
    - Black&White, Stereo and URL info
    - Better detection of Movies
    - and much, much more...
    Several other people have provided feedback and patches (these are the
    people I could find in my email archive, if you are missing from this
    list let me know):
    Huub Bouma, Roy van der Kuil, Remco Rotteveel, Mark Wormgoor, Dennis van
    Onselen, Hugo van der Kooij, Han Holl, Ian Mcdonald, Udo van den Heuvel.
    # Modules we need
    import re, urllib2, getopt, sys
    import time, random
    import htmlentitydefs, os, os.path, pickle
    from string import replace, split, strip
    from threading import Thread
    from xml.sax import saxutils
    # Extra check for the datetime module
    try:
    import datetime
    except:
    sys.stderr.write('This script needs the datetime module that was introduced in Python version 2.3.\n')
    sys.stderr.write('You are running:\n')
    sys.stderr.write('%s\n' % sys.version)
    sys.exit(1)
    # XXX: fix to prevent crashes in Snow Leopard [Robert Klep]
    if sys.platform == 'darwin' and sys.version_info[:3] == (2, 6, 1):
    try:
    urllib2.urlopen('http://localhost.localdomain')
    except:
    pass
    # do extra debug stuff
    debug = 1
    try:
    import redirect
    except:
    debug = 0
    pass
    # globals
    # compile only one time
    r_entity = re.compile(r'&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z]+);')
    tvgids = 'http://www.tvgids.nl/'
    uitgebreid_zoeken = tvgids + 'zoeken/'
    # how many seconds to wait before we timeout on a
    # url fetch, 10 seconds seems reasonable
    global_timeout = 10
    # Wait a random number of seconds between each page fetch.
    # We want to be nice and not hammer tvgids.nl (these are the
    # friendly people that provide our data...).
    # Also, it appears tvgids.nl throttles its output.
    # So there, there is not point in lowering these numbers, if you
    # are in a hurry, use the (default) fast mode.
    nice_time = [1, 2]
    # Maximum length in minutes of gaps/overlaps between programs to correct
    max_overlap = 10
    # Strategy to use for correcting overlapping prgramming:
    # 'average' = use average of stop and start of next program
    # 'stop' = keep stop time of current program and adjust start time of next program accordingly
    # 'start' = keep start time of next program and adjust stop of current program accordingly
    # 'none' = do not use any strategy and see what happens
    overlap_strategy = 'average'
    # Experimental strategy for clumping overlapping programming, all programs that overlap more
    # than max_overlap minutes, but less than the length of the shortest program are clumped
    # together. Highly experimental and disabled for now.
    do_clump = False
    # Create a category translation dictionary
    # Look in mythtv/themes/blue/ui.xml for all category names
    # The keys are the categories used by tvgids.nl (lowercase please)
    cattrans = { 'amusement' : 'Talk',
    'animatie' : 'Animated',
    'comedy' : 'Comedy',
    'documentaire' : 'Documentary',
    'educatief' : 'Educational',
    'erotiek' : 'Adult',
    'film' : 'Film',
    'muziek' : 'Art/Music',
    'informatief' : 'Educational',
    'jeugd' : 'Children',
    'kunst/cultuur' : 'Arts/Culture',
    'misdaad' : 'Crime/Mystery',
    'muziek' : 'Music',
    'natuur' : 'Science/Nature',
    'nieuws/actualiteiten' : 'News',
    'overige' : 'Unknown',
    'religieus' : 'Religion',
    'serie/soap' : 'Drama',
    'sport' : 'Sports',
    'theater' : 'Arts/Culture',
    'wetenschap' : 'Science/Nature'}
    # Create a role translation dictionary for the xmltv credits part
    # The keys are the roles used by tvgids.nl (lowercase please)
    roletrans = {'regie' : 'director',
    'acteurs' : 'actor',
    'presentatie' : 'presenter',
    'scenario' : 'writer'}
    # We have two sources of logos, the first provides the nice ones, but is not
    # complete. We use the tvgids logos to fill the missing bits.
    logo_provider = [ 'http://visualisation.tudelft.nl/~paul/logos/gif/64x64/',
    'http://static.tvgids.nl/gfx/zenders/' ]
    logo_names = {
    1 : [0, 'ned1'],
    2 : [0, 'ned2'],
    3 : [0, 'ned3'],
    4 : [0, 'rtl4'],
    5 : [0, 'een'],
    6 : [0, 'canvas_color'],
    7 : [0, 'bbc1'],
    8 : [0, 'bbc2'],
    9 : [0,'ard'],
    10 : [0,'zdf'],
    11 : [1, 'rtl'],
    12 : [0, 'wdr'],
    13 : [1, 'ndr'],
    14 : [1, 'srsudwest'],
    15 : [1, 'rtbf1'],
    16 : [1, 'rtbf2'],
    17 : [0, 'tv5'],
    18 : [0, 'ngc'],
    19 : [1, 'eurosport'],
    20 : [1, 'tcm'],
    21 : [1, 'cartoonnetwork'],
    24 : [0, 'canal+red'],
    25 : [0, 'mtv-color'],
    26 : [0, 'cnn'],
    27 : [0, 'rai'],
    28 : [1, 'sat1'],
    29 : [0, 'discover-spacey'],
    31 : [0, 'rtl5'],
    32 : [1, 'trt'],
    34 : [0, 'veronica'],
    35 : [0, 'tmf'],
    36 : [0, 'sbs6'],
    37 : [0, 'net5'],
    38 : [1, 'arte'],
    39 : [0, 'canal+blue'],
    40 : [0, 'at5'],
    46 : [0, 'rtl7'],
    49 : [1, 'vtm'],
    50 : [1, '3sat'],
    58 : [1, 'pro7'],
    59 : [1, 'kanaal2'],
    60 : [1, 'vt4'],
    65 : [0, 'animal-planet'],
    73 : [1, 'mezzo'],
    86 : [0, 'bbc-world'],
    87 : [1, 'tve'],
    89 : [1, 'nick'],
    90 : [1, 'bvn'],
    91 : [0, 'comedy_central'],
    92 : [0, 'rtl8'],
    99 : [1, 'sport1_1'],
    100 : [0, 'rtvu'],
    101 : [0, 'tvwest'],
    102 : [0, 'tvrijnmond'],
    103 : [1, 'tvnoordholland'],
    104 : [1, 'bbcprime'],
    105 : [1, 'spiceplatinum'],
    107 : [0, 'canal+yellow'],
    108 : [0, 'tvnoord'],
    109 : [0, 'omropfryslan'],
    114 : [0, 'omroepbrabant']}
    # A selection of user agents we will impersonate, in an attempt to be less
    # conspicuous to the tvgids.nl police.
    user_agents = [ 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9',
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)',
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7',
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)',
    'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071105 Firefox/2.0.0.9',
    'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9',
    'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071022 Ubuntu/7.10 (gutsy) Firefox/2.0.0.8'
    # Work in progress, the idea is to cache program categories and
    # descriptions to eliminate a lot of page fetches from tvgids.nl
    # for programs that do not have interesting/changing descriptions
    class ProgramCache:
    A cache to hold program name and category info.
    TVgids stores the detail for each program on a separate URL with an
    (apparently unique) ID. This cache stores the fetched info with the ID.
    New fetches will use the cached info instead of doing an (expensive)
    page fetch.
    def __init__(self, filename=None):
    Create a new ProgramCache object, optionally from file
    # where we store our info
    self.filename = filename
    if filename == None:
    self.pdict = {}
    else:
    if os.path.isfile(filename):
    self.load(filename)
    else:
    self.pdict = {}
    def load(self, filename):
    Loads a pickled cache dict from file
    try:
    self.pdict = pickle.load(open(filename,'r'))
    except:
    sys.stderr.write('Error loading cache file: %s (possibly corrupt)' % filename)
    sys.exit(2)
    def dump(self, filename):
    Dumps a pickled cache, and makes sure it is valid
    if os.access(filename, os.F_OK):
    try:
    os.remove(filename)
    except:
    sys.stderr.write('Cannot remove %s, check permissions' % filename)
    pickle.dump(self.pdict, open(filename+'.tmp', 'w'))
    os.rename(filename+'.tmp', filename)
    def query(self, program_id):
    Updates/gets/whatever.
    try:
    return self.pdict[program_id]
    except:
    return None
    def add(self, program):
    Adds a program
    self.pdict[program['ID']] = program
    def clear(self):
    Clears the cache (i.e. empties it)
    self.pdict = {}
    def clean(self):
    Removes all cached programming before today.
    Also removes erroneously cached programming.
    now = time.localtime()
    dnow = datetime.datetime(now[0],now[1],now[2])
    for key in self.pdict.keys():
    try:
    if self.pdict[key]['stop-time'] < dnow or self.pdict[key]['name'].lower() == 'onbekend':
    del self.pdict[key]
    except:
    pass
    def usage():
    print 'tv_grab_nl_py: A grabber that grabs tvguide data from tvgids.nl\n'
    print 'and stores it in XMLTV-combatible format.\n'
    print 'Usage:'
    print '--help, -h = print this info'
    print '--configure = create configfile (overwrites existing file)'
    print '--config-file = name of the configuration file (default = ~/.xmltv/tv_grab_py.conf'
    print '--capabilities = xmltv required option'
    print '--desc-length = maximum allowed length of programme descriptions in bytes.'
    print '--description = prints a short description of the grabber'
    print '--output = file where to put the output'
    print '--days = # number of days to grab'
    print '--preferredmethod = returns the preferred method to be called'
    print '--fast = do not grab descriptions of programming'
    print '--slow = grab descriptions of programming'
    print '--quiet = suppress all output'
    print '--compat = append tvgids.nl to the xmltv id (use this if you were using tv_grab_nl)'
    print '--logos 0/1 = insert urls to channel icons (mythfilldatabase will then use these)'
    print '--nocattrans = do not translate the grabbed genres into MythTV-genres'
    print '--cache = cache descriptions and use the file to store'
    print '--clean_cache = clean the cache file before fetching'
    print '--clear_cache = empties the cache file before fetching data'
    print '--slowdays = grab slowdays initial days and the rest in fast mode'
    print '--max_overlap = maximum length of overlap between programming to correct [minutes]'
    print '--overlap_strategy = what strategy to use to correct overlaps (check top of source code)'
    def filter_line_identity(m, defs=htmlentitydefs.entitydefs):
    # callback: translate one entity to its ISO Latin value
    k = m.group(1)
    if k.startswith("#") and k[1:] in xrange(256):
    return chr(int(k[1:]))
    try:
    return defs[k]
    except KeyError:
    return m.group(0) # use as is
    def filter_line(s):
    Removes unwanted stuff in strings (adapted from tv_grab_be)
    # do the latin1 stuff
    s = r_entity.sub(filter_line_identity, s)
    s = replace(s,'&nbsp;',' ')
    # Ik vermoed dat de volgende drie regels overbodig zijn, maar ze doen
    # niet veel kwaad -- Han Holl
    s = replace(s,'\r',' ')
    x = re.compile('(<.*?>)') # Udo
    s = x.sub('', s) #Udo
    s = replace(s, '~Q', "'")
    s = replace(s, '~R', "'")
    # Hmm, not sure if I understand this. Without it, mythfilldatabase barfs
    # on program names like "Steinbrecher &..."
    # We most create valid XML -- Han Holl
    s = saxutils.escape(s)
    return s
    def calc_timezone(t):
    Takes a time from tvgids.nl and formats it with all the required
    timezone conversions.
    in: '20050429075000'
    out:'20050429075000 (CET|CEST)'
    Until I have figured out how to correctly do timezoning in python this method
    will bork if you are not in a zone that has the same DST rules as 'Europe/Amsterdam'.
    year = int(t[0:4])
    month = int(t[4:6])
    day = int(t[6:8])
    hour = int(t[8:10])
    minute = int(t[10:12])
    #td = {'CET': '+0100', 'CEST': '+0200'}
    #td = {'CET': '+0100', 'CEST': '+0200', 'W. Europe Standard Time' : '+0100', 'West-Europa (standaardtijd)' : '+0100'}
    td = {0 : '+0100', 1 : '+0200'}
    pt = time.mktime((year,month,day,hour,minute,0,0,0,-1))
    timezone=''
    try:
    #timezone = time.tzname[(time.localtime(pt))[-1]]
    timezone = (time.localtime(pt))[-1]
    except:
    sys.stderr.write('Cannot convert time to timezone')
    return t+' %s' % td[timezone]
    def format_timezone(td):
    Given a datetime object, returns a string in XMLTV format
    tstr = td.strftime('%Y%m%d%H%M00')
    return calc_timezone(tstr)
    def get_page_internal(url, quiet=0):
    Retrieves the url and returns a string with the contents.
    Optionally, returns None if processing takes longer than
    the specified number of timeout seconds.
    txtdata = None
    txtheaders = {'Keep-Alive' : '300',
    'User-Agent' : user_agents[random.randint(0, len(user_agents)-1)] }
    try:
    #fp = urllib2.urlopen(url)
    rurl = urllib2.Request(url, txtdata, txtheaders)
    fp = urllib2.urlopen(rurl)
    lines = fp.readlines()
    page = "".join(lines)
    return page
    except:
    if not quiet:
    sys.stderr.write('Cannot open url: %s\n' % url)
    return None
    class FetchURL(Thread):
    A simple thread to fetch a url with a timeout
    def __init__ (self, url, quiet=0):
    Thread.__init__(self)
    self.quiet = quiet
    self.url = url
    self.result = None
    def run(self):
    self.result = get_page_internal(self.url, self.quiet)
    def get_page(url, quiet=0):
    Wrapper around get_page_internal to catch the
    timeout exception
    try:
    fu = FetchURL(url, quiet)
    fu.start()
    fu.join(global_timeout)
    return fu.result
    except:
    if not quiet:
    sys.stderr.write('get_page timed out on (>%s s): %s\n' % (global_timeout, url))
    return None
    def get_channels(file, quiet=0):
    Get a list of all available channels and store these
    in a file.
    # store channels in a dict
    channels = {}
    # tvgids stores several instances of channels, we want to
    # find all the possibile channels
    channel_get = re.compile('<optgroup label=.*?>(.*?)</optgroup>', re.DOTALL)
    # this is how we will find a (number, channel) instance
    channel_re = re.compile('<option value="([0-9]+)" >(.*?)</option>', re.DOTALL)
    # this is where we will try to find our channel list
    total = get_page(uitgebreid_zoeken, quiet)
    if total == None:
    return
    # get a list of match objects of all the <select blah station>
    stations = channel_get.finditer(total)
    # and create a dict of number, channel_name pairs
    # we do this this way because several instances of the
    # channel list are stored in the url and not all of the
    # instances have all the channels, this way we get them all.
    for station in stations:
    m = channel_re.finditer(station.group(0))
    for p in m:
    try:
    a = int(p.group(1))
    b = filter_line(p.group(2))
    channels[a] = b
    except:
    sys.stderr.write('Oops, [%s,%s] does not look like a valid channel, skipping it...\n' % (p.group(1),p.group(2)))
    # sort on channel number (arbitrary but who cares)
    keys = channels.keys()
    keys.sort()
    # and create a file with the channels
    f = open(file,'w')
    for k in keys:
    f.write("%s %s\n" % (k, channels[k]))
    f.close()
    def get_channel_all_days(channel, days, quiet=0):
    Get all available days of programming for channel number
    The output is a list of programming in order where each row
    contains a dictionary with program information.
    now = datetime.datetime.now()
    programs = []
    # Tvgids shows programs per channel per day, so we loop over the number of days
    # we are required to grab
    for offset in range(0, days):
    channel_url = 'http://www.tvgids.nl/zoeken/?d=%i&z=%s' % (offset, channel)
    # For historic purposes, the old style url that gave us a full week in advance:
    # channel_url = 'http://www.tvgids.nl/zoeken/?trefwoord=Titel+of+trefwoord&interval=0&timeslot='+\
    # '&station=%s&periode=%i&genre=&order=0' % (channel,days-1)
    # Sniff, we miss you...
    if offset > 0:
    time.sleep(random.randint(nice_time[0], nice_time[1]))
    # get the raw programming for the day
    total = get_page(channel_url, quiet)
    if total == None:
    return programs
    # Setup a number of regexps
    # checktitle will match the title row in H2 tags of the daily overview page, e.g.
    # <h2>zondag 19 oktober 2008</h2>
    checktitle = re.compile('<h2>(.*?)</h2>',re.DOTALL)
    # getrow will locate each row with program details
    getrow = re.compile('<a href="/programma/(.*?)</a>',re.DOTALL)
    # parserow matches the required program info, with groups:
    # 1 = program ID
    # 2 = broadcast times
    # 3 = program name
    parserow = re.compile('(.*?)/.*<span class="time">(.*?)</span>.*<span class="title">(.*?)</span>', re.DOTALL)
    # normal begin and end times
    times = re.compile('([0-9]+:[0-9]+) - ([0-9]+:[0-9]+)?')
    # Get the day of month listed on the page as well as the expected date we are grabbing and compare these.
    # If these do not match, we skip parsing the programs on the page and issue a warning.
    #dayno = int(checkday.search(total).group(1))
    title = checktitle.search(total)
    if title:
    title = title.group(1)
    dayno = title.split()[1]
    else:
    sys.stderr.write('\nOops, there was a problem with page %s. Skipping it...\n' % (channel_url))
    continue
    expected = now + datetime.timedelta(days=offset)
    if (not dayno.isdigit() or int(dayno) != expected.day):
    sys.stderr.write('\nOops, did not expect page %s to list programs for "%s", skipping it...\n' % (channel_url,title))
    continue
    # and find relevant programming info
    allrows = getrow.finditer(total)
    for r in allrows:
    detail = parserow.search(r.group(1))
    if detail != None:
    # default times
    start_time = None
    stop_time = None
    # parse for begin and end times
    t = times.search(detail.group(2))
    if t != None:
    start_time = t.group(1)
    stop_time = t.group(2)
    program_url = 'http://www.tvgids.nl/programma/' + detail.group(1) + '/'
    program_name = detail.group(3)
    # store time, name and detail url in a dictionary
    tdict = {}
    tdict['start'] = start_time
    tdict['stop'] = stop_time
    tdict['name'] = program_name
    if tdict['name'] == '':
    tdict['name'] = 'onbekend'
    tdict['url'] = program_url
    tdict['ID'] = detail.group(1)
    tdict['offset'] = offset
    #Add star rating if tipped by tvgids.nl
    tdict['star-rating'] = '';
    if r.group(1).find('Tip') != -1:
    tdict['star-rating'] = '4/5'
    # and append the program to the list of programs
    programs.append(tdict)
    # done
    return programs
    def make_daytime(time_string, offset=0, cutoff='00:00', stoptime=False):
    Given a string '11:35' and an offset from today,
    return a datetime object. The cuttoff specifies the point where the
    new day starts.
    Examples:
    In [2]:make_daytime('11:34',0)
    Out[2]:datetime.datetime(2006, 8, 3, 11, 34)
    In [3]:make_daytime('11:34',1)
    Out[3]:datetime.datetime(2006, 8, 4, 11, 34)
    In [7]:make_daytime('11:34',0,'12:00')
    Out[7]:datetime.datetime(2006, 8, 4, 11, 34)
    In [4]:make_daytime('11:34',0,'11:34',False)
    Out[4]:datetime.datetime(2006, 8, 3, 11, 34)
    In [5]:make_daytime('11:34',0,'11:34',True)
    Out[5]:datetime.datetime(2006, 8, 4, 11, 34)
    h,m = [int(x) for x in time_string.split(':')];
    hm = int(time_string.replace(':',''))
    chm = int(cutoff.replace(':',''))
    # check for the cutoff, if the time is before the cutoff then
    # add a day
    extra_day = 0
    if (hm < chm) or (stoptime==True and hm == chm):
    extra_day = 1
    # and create a datetime object, DST is handled at a later point
    pt = time.localtime()
    dt = datetime.datetime(pt[0],pt[1],pt[2],h,m)
    dt = dt + datetime.timedelta(offset+extra_day)
    return dt
    def correct_times(programs, quiet=0):
    Parse a list of programs as generated by get_channel_all_days() and
    convert begin and end times to xmltv compatible times in datetime objects.
    if programs == []:
    return programs
    # the start time of programming for this day, times *before* this time are
    # assumed to be on the next day
    day_start_time = '06:00'
    # initialise using the start time of the first program on this day
    if programs[0]['start'] != None:
    day_start_time = programs[0]['start']
    for program in programs:
    if program['start'] == program['stop']:
    program['stop'] = None
    # convert the times
    if program['start'] != None:
    program['start-time'] = make_daytime(program['start'], program['offset'], day_start_time)
    else:
    program['start-time'] = None
    if program['stop'] != None:
    program['stop-time'] = make_daytime(program['stop'], program['offset'], day_start_time, stoptime=True)
    # extra correction, needed because the stop time of a program may be on the next day, after the
    # day cutoff. For example:
    # 06:00 - 23:40 Long Program
    # 23:40 - 00:10 Lala
    # 00:10 - 08:00 Wawa
    # This puts the end date of Wawa on the current, instead of the next day. There is no way to detect
    # this with a single cutoff in make_daytime. Therefore, check if there is a day difference between
    # start and stop dates and correct if necessary.
    if program['start-time'] != None:
    # make two dates
    start = program['start-time']
    stop = program['stop-time']
    single_day = datetime.timedelta(1)
    startdate = datetime.datetime(start.year,start.month,start.day)
    stopdate = datetime.datetime(stop.year,stop.month,stop.day)
    if startdate - stopdate == single_day:
    program['stop-time'] = program['stop-time'] + single_day
    else:
    program['stop-time'] = None
    def parse_programs(programs, offset=0, quiet=0):
    Parse a list of programs as generated by get_channel_all_days() and
    convert begin and end times to xmltv compatible times.
    # good programs
    good_programs = []
    # calculate absolute start and stop times
    correct_times(programs, quiet)
    # next, correct for missing end time and copy over all good programming to the
    # good_programs list
    for i in range(len(programs)):
    # Try to correct missing end time by taking start time from next program on schedule
    if (programs[i]['stop-time'] == None and i < len(programs)-1):
    if not quiet:
    sys.stderr.write('Oops, "%s" has no end time. Trying to fix...\n' % programs[i]['name'])
    programs[i]['stop-time'] = programs[i+1]['start-time']
    # The common case: start and end times are present and are not
    # equal to each other (yes, this can happen)
    if programs[i]['start-time'] != None and \
    programs[i]['stop-time'] != None and \
    programs[i]['start-time'] != programs[i]['stop-time']:
    good_programs.append(programs[i])
    # Han Holl: try to exclude programs that stop before they begin
    for i in range(len(good_programs)-1,-1,-1):
    if good_programs[i]['stop-time'] <= good_programs[i]['start-time']:
    if not quiet:
    sys.stderr.write('Deleting invalid stop/start time: %s\n' % good_programs[i]['name'])
    del good_programs[i]
    # Try to exclude programs that only identify a group or broadcaster and have overlapping start/end times with
    # the actual programs
    for i in range(len(good_programs)-2,-1,-1):
    if good_programs[i]['start-time'] <= good_programs[i+1]['start-time'] and \
    good_programs[i]['stop-time'] >= good_programs[i+1]['stop-time']:
    if not quiet:
    sys.stderr.write('Deleting grouping/broadcaster: %s\n' % good_programs[i]['name'])
    del good_programs[i]
    for i in range(len(good_programs)-1):
    # PdB: Fix tvgids start-before-end x minute interval overlap. An overlap (positive or
    # negative) is halved and each half is assigned to the adjacent programmes. The maximum
    # overlap length between programming is set by the global variable 'max_overlap' and is
    # default 10 minutes. Examples:
    # Positive overlap (= overlap in programming):
    # 10:55 - 12:00 Lala
    # 11:55 - 12:20 Wawa
    # is transformed in:
    # 10:55 - 11.57 Lala
    # 11:57 - 12:20 Wawa
    # Negative overlap (= gap in programming):
    # 10:55 - 11:50 Lala
    # 12:00 - 12:20 Wawa
    # is transformed in:
    # 10:55 - 11.55 Lala
    # 11:55 - 12:20 Wawa
    stop = good_programs[i]['stop-time']
    start = good_programs[i+1]['start-time']
    dt = stop-start
    avg = start + dt / 2
    overlap = 24*60*60*dt.days + dt.seconds
    # check for the size of the overlap
    if 0 < abs(overlap) <= max_overlap*60:
    if not quiet:
    if overlap > 0:
    sys.stderr.write('"%s" and "%s" overlap %s minutes. Adjusting times.\n' % \
    (good_programs[i]['name'],good_programs[i+1]['name'],overlap / 60))
    else:
    sys.stderr.write('"%s" and "%s" have gap of %s minutes. Adjusting times.\n' % \
    (good_programs[i]['name'],good_programs[i+1]['name'],abs(overlap) / 60))
    # stop-time of previous program wins
    if overlap_strategy == 'stop':
    good_programs[i+1]['start-time'] = good_programs[i]['stop-time']
    # start-time of next program wins
    elif overlap_strategy == 'start':
    good_programs[i]['stop-time'] = good_programs[i+1]['start-time']
    # average the difference
    elif overlap_strategy == 'average':
    good_programs[i]['stop-time'] = avg
    good_programs[i+1]['start-time'] = avg
    # leave as is
    else:
    pass
    # Experimental strategy to make sure programming does not disappear. All programs that overlap more
    # than the maximum overlap length, but less than the shortest length of the two programs are
    # clumped.
    if do_clump:
    for i in range(len(good_programs)-1):
    stop = good_programs[i]['stop-time']
    start = good_programs[i+1]['start-time']
    dt = stop-start
    overlap = 24*60*60*dt.days + dt.seconds
    length0 = good_programs[i]['stop-time'] - good_programs[i]['start-time']
    length1 = good_programs[i+1]['stop-time'] - good_programs[i+1]['start-time']
    l0 = length0.days*24*60*60 + length0.seconds
    l1 = length1.days*24*60*60 + length0.seconds
    if abs(overlap) >= max_overlap*60 <= min(l0,l1)*60 and \
    not good_programs[i].has_key('clumpidx') and \
    not good_programs[i+1].has_key('clumpidx'):
    good_programs[i]['clumpidx'] = '0/2'
    good_programs[i+1]['clumpidx'] = '1/2'
    good_programs[i]['stop-time'] = good_programs[i+1]['stop-time']
    good_programs[i+1]['start-time'] = good_programs[i]['start-time']
    # done, nothing to see here, please move on
    return good_programs
    def get_descriptions(programs, program_cache=None, nocattrans=0, quiet=0, slowdays=0):
    Given a list of programs, from get_channel, retrieve program information
    # This regexp tries to find details such as Genre, Acteurs, Jaar van Premiere etc.
    detail = re.compile('<li>.*?<strong>(.*?):</strong>.*?<br />(.*?)</li>', re.DOTALL)
    # These regexps find the description area, the program type and descriptive text
    description = re.compile('<div class="description">.*?<div class="text"(.*?)<div class="clearer"></div>',re.DOTALL)
    descrtype = re.compile('<div class="type">(.*?)</div>',re.DOTALL)
    descrline = re.compile('<p>(.*?)</p>',re.DOTALL)
    # randomize detail requests
    nprograms = len(programs)
    fetch_order = range(0,nprograms)
    random.shuffle(fetch_order)
    counter = 0
    for i in fetch_order:
    counter += 1
    if programs[i]['offset'] >= slowdays:
    continue
    if not quiet:
    sys.stderr.write('\n(%3.0f%%) %s: %s ' % (100*float(counter)/float(nprograms), i, programs[i]['name']))
    # check the cache for this program's ID
    cached_program = program_cache.query(programs[i]['ID'])
    if (cached_program != None):
    if not quiet:
    sys.stderr.write(' [cached]')
    # copy the cached information, except the start/end times, rating and clumping,
    # these may have changed.
    tstart = programs[i]['start-time']
    tstop = programs[i]['stop-time']
    rating = programs[i]['star-rating']
    try:
    clump = programs[i]['clumpidx']
    except:
    clump = False
    programs[i] = cached_program
    programs[i]['start-time'] = tstart
    programs[i]['stop-time'] = tstop
    programs[i]['star-rating'] = rating
    if clump:
    programs[i]['clumpidx'] = clump
    continue
    else:
    # be nice to tvgids.nl
    time.sleep(random.randint(nice_time[0], nice_time[1]))
    # get the details page, and get all the detail nodes
    descriptions = ()
    details = ()
    try:
    if not quiet:
    sys.stderr.write(' [normal fetch]')
    total = get_page(programs[i]['url'])
    details = detail.finditer(total)
    descrspan = description.search(total);
    descriptions = descrline.finditer(descrspan.group(1))
    except:
    # if we cannot find the description page,
    # go to next in the loop
    if not quiet:
    sys.stderr.write(' [fetch failed or timed out]')
    continue
    # define containers
    programs[i]['credits'] = {}
    programs[i]['video'] = {}
    # now parse the details
    line_nr = 1;
    # First, we try to find the program type in the description section.
    # Note that this is not the same as the generic genres (these are searched later on), but a more descriptive one like "Culinair programma"
    # If present, we store this as first part of the regular description:
    programs[i]['detail1'] = descrtype.search(descrspan.group(1)).group(1).capitalize()
    if programs[i]['detail1'] != '':
    line_nr = line_nr + 1
    # Secondly, we add one or more lines of the program description that are present.
    for descript in descriptions:
    d_str = 'detail' + str(line_nr)
    programs[i][d_str] = descript.group(1)
    # Remove sponsored link from description if present.
    sponsor_pos = programs[i][d_str].rfind('<i>Gesponsorde link:</i>')
    if sponsor_pos > 0:
    programs[i][d_str] = programs[i][d_str][0:sponsor_pos]
    programs[i][d_str] = filter_line(programs[i][d_str]).strip()
    line_nr = line_nr + 1
    # Finally, we check out all program details. These are generically denoted as:
    # <li><strong>(TYPE):</strong><br />(CONTENT)</li>
    # Some examples:
    # <li><strong>Genre:</strong><br />16 oktober 2008</li>
    # <li><strong>Genre:</strong><br />Amusement</li>
    for d in details:
    type = d.group(1).strip().lower()
    content_asis = d.group(2).strip()
    content = filter_line(content_asis).strip()
    if content == '':
    continue
    elif type == 'genre':
    # Fix detection of movies based on description as tvgids.nl sometimes
    # categorises a movie as e.g. "Komedie", "Misdaadkomedie", "Detectivefilm".
    genre = content;
    if (programs[i]['detail1'].lower().find('film') != -1 \
    or programs[i]['detail1'].lower().find('komedie') != -1)\
    and programs[i]['detail1'].lower().find('tekenfilm') == -1 \
    and programs[i]['detail1'].lower().find('animatiekomedie') == -1 \
    and programs[i]['detail1'].lower().find('filmpje') == -1:
    genre = 'film'
    if nocattrans:
    programs[i]['genre'] = genre.title()
    else:
    try:
    programs[i]['genre'] = cattrans[genre.lower()]
    except:
    programs[i]['genre'] = ''
    # Parse persons and their roles for credit info
    elif roletrans.has_key(type):
    programs[i]['credits'][roletrans[type]] = []
    persons = content_asis.split(',');
    for name in persons:
    if name.find(':') != -1:
    name = name.split(':')[1]
    if name.find('-') != -1:
    name = name.split('-')[0]
    if name.find('e.a') != -1:
    name = name.split('e.a')[0]
    programs[i]['credits'][roletrans[type]].append(filter_line(name.strip()))
    elif type == 'bijzonderheden':
    if content.find('Breedbeeld') != -1:
    programs[i]['video']['breedbeeld'] = 1
    if content.find('Zwart') != -1:
    programs[i]['video']['blackwhite'] = 1
    if content.find('Teletekst') != -1:
    programs[i]['teletekst'] = 1
    if content.find('Stereo') != -1:
    programs[i]['stereo'] = 1
    elif type == 'url':
    programs[i]['infourl'] = content
    else:
    # In unmatched cases, we still add the parsed type and content to the program details.
    # Some of these will lead to xmltv output during the xmlefy_programs step
    programs[i][type] = content
    # do not cache programming that is unknown at the time
    # of fetching.
    if programs[i]['name'].lower() != 'onbekend':
    program_cache.add(programs[i])
    if not quiet:
    sys.stderr.write('\ndone...\n\n')
    # done
    def title_split(program):
    Some channels have the annoying habit of adding the subtitle to the title of a program.
    This function attempts to fix this, by splitting the name at a ': '.
    if (program.has_key('titel aflevering') and program['titel aflevering'] != '') \
    or (program.has_key('genre') and program['genre'].lower() in ['movies','film']):
    return
    colonpos = program['name'].rfind(': ')
    if colonpos > 0:
    program['titel aflevering'] = program['name'][colonpos+1:len(program['name'])].strip()
    program['name'] = program['name'][0:colonpos].strip()
    def xmlefy_programs(programs, channel, desc_len, compat=0, nocattrans=0):
    Given a list of programming (from get_channels())
    returns a string with the xml equivalent
    output = []
    for program in programs:
    clumpidx = ''
    try:
    if program.has_key('clumpidx'):
    clumpidx = 'clumpidx="'+program['clumpidx']+'"'
    except:
    print program
    output.append(' <programme start="%s" stop="%s" channel="%s%s" %s> \n' % \
    (format_timezone(program['start-time']), format_timezone(program['stop-time']),\
    channel, compat and '.tvgids.nl' or '', clumpidx))
    output.append(' <title lang="nl">%s</title>\n' % filter_line(program['name']))
    if program.has_key('titel aflevering') and program['titel aflevering'] != '':
    output.append(' <sub-title lang="nl">%s</sub-title>\n' % filter_line(program['titel aflevering']))
    desc = []
    for detail_row in ['detail1','detail2','detail3']:
    if program.has_key(detail_row) and not re.search('[Gg]een detailgegevens be(?:kend|schikbaar)', program[detail_row]):
    desc.append('%s ' % program[detail_row])
    if desc != []:
    # join and remove newlines from descriptions
    desc_line = "".join(desc).strip()
    desc_line.replace('\n', ' ')
    if len(desc_line) > desc_len:
    spacepos = desc_line[0:desc_len-3].rfind(' ')
    desc_line = desc_line[0:spacepos] + '...'
    output.append(' <desc lang="nl">%s</desc>\n' % desc_line)
    # Process credits section if present.
    # This will generate director/actor/presenter info.
    if program.has_key('credits') and program['credits'] != {}:
    output.append(' <credits>\n')
    for role in program['credits']:
    for name in program['credits'][role]:
    if name != '':
    output.append(' <%s>%s</%s>\n' % (role, name, role))
    output.append(' </credits>\n')
    if program.has_key('jaar van premiere') and program['jaar van premiere'] != '':
    output.append(' <date>%s</date>\n' % program['jaar van premiere'])
    if program.has_key('genre') and program['genre'] != '':
    output.append(' <category')
    if nocattrans:
    output.append(' lang="nl"')
    output.append ('>%s</category>\n' % program['genre'])
    if program.has_key('infourl') and program['infourl'] != '':
    output.append(' <url>%s</url>\n' % program['infourl'])
    if program.has_key('aflevering') and program['aflevering'] != '':
    output.append(' <episode-num system="onscreen">%s</episode-num>\n' % filter_line(program['aflevering']))
    # Process video section if present
    if program.has_key('video') and program['video'] != {}:
    output.append(' <video>\n');
    if program['video'].has_key('breedbeeld'):
    output.append(' <aspect>16:9</aspect>\n')
    if program['video'].has_key('blackwhite'):
    output.append(' <colour>no</colour>\n')
    output.append(' </video>\n')
    if program.has_key('stereo'):
    output.append(' <audio><stereo>stereo</stereo></audio>\n')
    if program.has_key('teletekst'):
    output.append(' <subtitles type="teletext" />\n')
    # Set star-rating if applicable
    if program['star-rating'] != '':
    output.append(' <star-rating><value>%s</value></star-rating>\n' % program['star-rating'])
    output.append(' </programme>\n')
    return "".join(output)
    def main():
    # Parse command line options
    try:
    opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "capabilities",
    "preferredmethod", "days=",
    "configure", "fast", "slow",
    "cache=", "clean_cache",
    "slowdays=","compat",
    "desc-length=","description",
    "nocattrans","config-file=",
    "max_overlap=", "overlap_strategy=",
    "clear_cache", "quiet","logos="])
    except getopt.GetoptError:
    usage()
    sys.exit(2)
    # DEFAULT OPTIONS - Edit if you know what you are doing
    # where the output goes
    output = None
    output_file = None
    # the total number of days to fetch
    days = 6
    # Fetch data in fast mode, i.e. do NOT grab all the detail information,
    # fast means fast, because as it then does not have to fetch a web page for each program
    # Default: fast=0
    fast = 0
    # number of days to fetch in slow mode. For example: --days 5 --slowdays 2, will
    # fetch the first two days in slow mode (with all the details) and the remaining three
    # days in fast mode.
    slowdays = 6
    # no output
    quiet = 0
    # insert url of channel logo into the xml data, this will be picked up by mythfilldatabase
    logos = 1
    # enable this option if you were using tv_grab_nl, it adjusts the generated
    # xmltvid's so that everything works.
    compat = 0
    # enable this option if you do not want the tvgids categories being translated into
    # MythTV-categories (genres)
    nocattrans = 0
    # Maximum number of characters to use for program description.
    # Different values may work better in different versions of MythTV.
    desc_len = 475
    # default configuration file locations
    hpath = ''
    if os.environ.has_key('HOME'):
    hpath = os.environ['HOME']
    # extra test for windows users
    elif os.environ.has_key('HOMEPATH'):
    hpath = os.environ['HOMEPATH']
    # hpath = ''
    xmltv_dir = hpath+'/.xmltv'
    program_cache_file = xmltv_dir+'/program_cache'
    config_file = xmltv_dir+'/tv_grab_nl_py.conf'
    # cache the detail information.
    program_cache = None
    clean_cache = 1
    clear_cache = 0
    # seed the random generator
    random.seed(time.time())
    for o, a in opts:
    if o in ("-h", "--help"):
    usage()
    sys.exit(1)
    if o == "--quiet":
    quiet = 1;
    if o == "--description":
    print "The Netherlands (tv_grab_nl_py $Rev: 104 $)"
    sys.exit(0)
    if o == "--capabilities":
    print "baseline"
    print "cache"
    print "manualconfig"
    print "preferredmethod"
    sys.exit(0)
    if o == '--preferredmethod':
    print 'allatonce'
    sys.exit(0)
    if o == '--desc-length':
    # Use the requested length for programme descriptions.
    desc_len = int(a)
    if not quiet:
    sys.stderr.write('Using description length: %d\n' % desc_len)
    for o, a in opts:
    if o == "--config-file":
    # use the provided name for configuration
    config_file = a
    if not quiet:
    sys.stderr.write('Using config file: %s\n' % config_file)
    for o, a in opts:
    if o == "--configure":
    # check for the ~.xmltv dir
    if not os.path.exists(xmltv_dir):
    if not quiet:
    sys.stderr.write('You do not have the ~/.xmltv directory,')
    sys.stderr.write('I am going to make a shiny new one for you...')
    os.mkdir(xmltv_dir)
    if not quiet:
    sys.stderr.write('Creating config file: %s\n' % config_file)
    get_channels(config_file)
    sys.exit(0)
    if o == "--days":
    # limit days to maximum supported by tvgids.nl
    days = min(int(a),6)
    if o == "--compat":
    compat = 1
    if o == "--nocattrans":
    nocattrans = 1
    if o == "--fast":
    fast = 1
    if o == "--output":
    output_file = a
    try:
    output = open(output_file,'w')
    # and redirect output
    if debug:
    debug_file = open('/tmp/kaas.xml','w')
    blah = redirect.Tee(output, debug_file)
    sys.stdout = blah
    else:
    sys.stdout = output
    except:
    if not quiet:
    sys.stderr.write('Cannot write to outputfile: %s\n' % output_file)
    sys.exit(2)
    if o == "--slowdays":
    # limit slowdays to maximum supported by tvgids.nl
    slowdays = min(int(a),6)
    # slowdays implies fast == 0
    fast = 0
    if o == "--logos":
    logos = int(a)
    if o == "--clean_cache":
    clean_cache = 1
    if o == "--clear_cache":
    clear_cache = 1
    if o == "--cache":
    program_cache_file = a
    if o == "--max_overlap":
    max_overlap = int(a)
    if o == "--overlap_strategy":
    overlap_strategy = a
    # get configfile if available
    try:
    f = open(config_file,'r')
    except:
    sys.stderr.write('Config file %s not found.\n' % config_file)
    sys.stderr.write('Re-run me with the --configure flag.\n')
    sys.exit(1)
    #check for cache
    program_cache = ProgramCache(program_cache_file)
    if clean_cache != 0:
    program_cache.clean()
    if clear_cache != 0:
    program_cache.clear()
    # Go!
    channels = {}
    # Read the channel stuff
    for blah in f.readlines():
    blah = blah.lstrip()
    blah = blah.replace('\n','')
    if blah:
    if blah[0] != '#':
    channel = blah.split()
    channels[channel[0]] = " ".join(channel[1:])
    # channels are now in channels dict keyed on channel id
    # print header stuff
    print '<?xml version="1.0" encoding="ISO-8859-1"?>'
    print '<!DOCTYPE tv SYSTEM "xmltv.dtd">'
    print '<tv generator-info-name="tv_grab_nl_py $Rev: 104 $">'
    # first do the channel info
    for key in channels.keys():
    print ' <channel id="%s%s">' % (key, compat and '.tvgids.nl' or '')
    print ' <display-name lang="nl">%s</display-name>' % channels[key]
    if (logos):
    ikey = int(key)
    if logo_names.has_key(ikey):
    full_logo_url = logo_provider[logo_names[ikey][0]]+logo_names[ikey][1]+'.gif'
    print ' <icon src="%s" />' % full_logo_url
    print ' </channel>'
    num_chans = len(channels.keys())
    channel_cnt = 0
    if program_cache != None:
    program_cache.clean()
    fluffy = channels.keys()
    nfluffy = len(fluffy)
    for id in fluffy:
    channel_cnt += 1
    if not quiet:
    sys.stderr.write('\n\nNow fetching %s(xmltvid=%s%s) (channel %s of %s)\n' % \
    (channels[id], id, (compat and '.tvgids.nl' or ''), channel_cnt, nfluffy))
    info = get_channel_all_days(id, days, quiet)
    blah = parse_programs(info, None, quiet)
    # fetch descriptions
    if not fast:
    get_descriptions(blah, program_cache, nocattrans, quiet, slowdays)
    # Split titles with colon in it
    # Note: this only takes place if all days retrieved are also grabbed with details (slowdays=days)
    # otherwise this function might change some titles after a few grabs and thus may result in
    # loss of programmed recordings for these programs.
    if slowdays == days:
    for program in blah:
    title_split(program)
    print xmlefy_programs(blah, id, desc_len, compat, nocattrans)
    # save the cache after each channel fetch
    if program_cache != None:
    program_cache.dump(program_cache_file)
    # be nice to tvgids.nl
    time.sleep(random.randint(nice_time[0], nice_time[1]))
    if program_cache != None:
    program_cache.dump(program_cache_file)
    # print footer stuff
    print "</tv>"
    # close the outputfile if necessary
    if output != None:
    output.close()
    # and return success
    sys.exit(0)
    # allow this to be a module
    if __name__ == '__main__':
    main()
    # vim:tw=0:et:sw=4
    [cedric@tv ~]$
    Best regards,
    Cedric
    Last edited by cdwijs (2010-11-04 18:44:51)

    Running the script by python2 solves it for me:
    su - mythtv -c "nice -n 19 python2 /usr/bin/tv_grab_nl_py --output ~/listings.xml"
    Best regards,
    Cedric

  • [SOLVED] Unable to login to root unless it's through another account.

    I'm fairly inexperienced with Linux and am having a frustrating problem.
    I've forgotten my root password (oh boy) and am experiencing some weird problems attempting to reset it.
    I have other accounts, which I can log in to, and they have sudo privileges. So I am not very restricted as to what I can actually do.
    So I tried to use "passwd root" to change my root account password.
    This allowed me to log in to root (at least I believe it is root) using "su" and the newly created password.
    However, when I reboot and try to log in to root from the normal log in screen, it claims I'm using the wrong password.
    I also tried logging in to root using "su" and then using "passwd" to change the root password. I got the same results as before.
    I even tried removing the root password from the "etc/shadow" file, though I'm really not familiar with how that file works in archlinux.
    I've searched around online, and stumbled across some similar topics in this forum, but all of them have worked around the problem by using a boot disc in some way.
    I would really like to know what exactly is going on with my system here and why this password confusion is happening. If possible, I'd really really like to reset my root password remotely.
    If this has been addressed before and I missed it, please link me to the old topic.
    Thanks for reading guys. Any help is appreciated.
    Last edited by bluekirby (2011-04-05 04:55:20)

    bluekirby wrote:If there were any location where I could deny people from logging in as root, where would that file be?
    I'm really hoping it's just something I edited months ago and forgot about.
    Take a look to this topic:
    https://bbs.archlinux.org/viewtopic.php?id=67753
    And try this to reset the password:
    http://www.howtoforge.com/how-to-reset- … knoppix-p2
    After that, only the users who knows(and are listed on /etc/sudoers) the root password will be able to do root jobs, like installing/removing packages or modify the filesystem.
    Note that if you use sudo you can use visudo to edit /etc/sudoers command to prevent or allow users to do root jobs, example:
    root ALL=(ALL) ALL
    # %wheel ALL=(ALL) ALL
    If you uncomment %wheel line all users in wheel group can do root jobs if they know the root password.
    But you can leave commented %wheel line and add users manually, example(for "edward" and "christine" users):
    root ALL=(ALL) ALL
    # %wheel ALL=(ALL) ALL
    edward ALL=(ALL) ALL
    christine ALL=(ALL) ALL
    By doing this,these two users(through sudo) and root will be allowed to do root jobs and nobody else
    NOTE: Editing /etc/sudoers through visudo is hardly recommended, please dont edit the file manually with nano,vi,vim,etc. USE "visudo"
    P.S. Reseting the password through a live distro is the most recommended way to reset the root password.
    Last edited by AurosGamma (2011-04-05 04:31:34)

  • [SOLVED] Sound works at GDM but once logged in does not

    Arch has me stumped.
    When my Macbook boots to GDM there is the sound icon and sound works.
    Once I log in the sound icon disappears and there is no sound.
    If I log back out sound works again at the GDM login screen
    My output for pulse audio and pulse audio -v is:
    $ pulseaudio
    E: [pulseaudio] socket-server.c: bind(): Address already in use
    E: [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Failed to initialize daemon.
    $ pulseaudio -v
    I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
    I: [pulseaudio] core-util.c: Successfully gained nice level -11.
    I: [pulseaudio] main.c: This is PulseAudio 5.0
    I: [pulseaudio] main.c: Page size is 4096 bytes
    I: [pulseaudio] main.c: Machine ID is d9244e7a847c40c4bcb63aa228acfb21.
    I: [pulseaudio] main.c: Session ID is c4.
    I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
    I: [pulseaudio] main.c: Using state directory /home/mark/.config/pulse.
    I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-5.0/modules.
    I: [pulseaudio] main.c: Running in system mode: no
    I: [pulseaudio] main.c: Fresh high-resolution timers available! Bon appetit!
    I: [pulseaudio] cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3
    I: [pulseaudio] svolume_mmx.c: Initialising MMX optimized volume functions.
    I: [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers.
    I: [pulseaudio] svolume_sse.c: Initialising SSE2 optimized volume functions.
    I: [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers.
    I: [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions.
    I: [pulseaudio] svolume_orc.c: Initialising ORC optimized volume functions.
    I: [pulseaudio] module-device-restore.c: Successfully opened database file '/home/mark/.config/pulse/d9244e7a847c40c4bcb63aa228acfb21-device-volumes'.
    I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0; argument: "").
    I: [pulseaudio] module-stream-restore.c: Successfully opened database file '/home/mark/.config/pulse/d9244e7a847c40c4bcb63aa228acfb21-stream-volumes'.
    I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1; argument: "").
    I: [pulseaudio] module-card-restore.c: Successfully opened database file '/home/mark/.config/pulse/d9244e7a847c40c4bcb63aa228acfb21-card-database'.
    I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2; argument: "").
    I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: #3; argument: "").
    I: [pulseaudio] module.c: Loaded "module-switch-on-port-available" (index: #4; argument: "").
    I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm/HDA Intel/HDA Intel.conf
    I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card HDA Intel
    I: [pulseaudio] (alsa-lib)main.c: error: failed to import HDA Intel use case configuration -2
    I: [pulseaudio] alsa-ucm.c: UCM not available for card HDA Intel
    I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL front:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL iec958:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer iec958:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL front:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL surround40:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer surround40:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] (alsa-lib)pcm_params.c: Slave PCM not usable
    I: [pulseaudio] (alsa-lib)pcm_params.c: Slave PCM not usable
    I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:surround41:0: Invalid argument
    I: [pulseaudio] (alsa-lib)pcm_params.c: Slave PCM not usable
    I: [pulseaudio] (alsa-lib)pcm_params.c: Slave PCM not usable
    I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:surround50:0: Invalid argument
    I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:surround51:0: Invalid argument
    I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:surround71:0: Invalid argument
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL iec958:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer iec958:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:0
    I: [pulseaudio] alsa-util.c: Error opening PCM device a52:0: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:0
    I: [pulseaudio] alsa-util.c: Error opening PCM device a52:0: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM dca:0
    I: [pulseaudio] alsa-util.c: Error opening PCM device dca:0: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D3p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D3p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D7p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0,1: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D7p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0,1: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D8p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0,2: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D8p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0,2: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D9p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0,3: No such file or directory
    I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D9p' failed (-2)
    I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:0,3: No such file or directory
    I: [pulseaudio] module-card-restore.c: Restoring port latency offsets for card alsa_card.pci-0000_00_1b.0.
    I: [pulseaudio] card.c: Created 0 "alsa_card.pci-0000_00_1b.0"
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] alsa-util.c: Trying to disable ALSA period wakeups, using timers only
    I: [pulseaudio] alsa-util.c: ALSA period wakeups disabled
    I: [pulseaudio] alsa-sink.c: Successfully opened device front:0.
    I: [pulseaudio] alsa-sink.c: Selected mapping 'Analog Stereo' (analog-stereo).
    I: [pulseaudio] alsa-sink.c: Successfully enabled mmap() mode.
    I: [pulseaudio] alsa-sink.c: Successfully enabled timer-based scheduling mode.
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL front:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] sink.c: Created sink 0 "alsa_output.pci-0000_00_1b.0.analog-stereo" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
    I: [pulseaudio] sink.c: alsa.resolution_bits = "16"
    I: [pulseaudio] sink.c: device.api = "alsa"
    I: [pulseaudio] sink.c: device.class = "sound"
    I: [pulseaudio] sink.c: alsa.class = "generic"
    I: [pulseaudio] sink.c: alsa.subclass = "generic-mix"
    I: [pulseaudio] sink.c: alsa.name = "ALC889A Analog"
    I: [pulseaudio] sink.c: alsa.id = "ALC889A Analog"
    I: [pulseaudio] sink.c: alsa.subdevice = "0"
    I: [pulseaudio] sink.c: alsa.subdevice_name = "subdevice #0"
    I: [pulseaudio] sink.c: alsa.device = "0"
    I: [pulseaudio] sink.c: alsa.card = "0"
    I: [pulseaudio] sink.c: alsa.card_name = "HDA Intel"
    I: [pulseaudio] sink.c: alsa.long_card_name = "HDA Intel at 0x90700000 irq 44"
    I: [pulseaudio] sink.c: alsa.driver_name = "snd_hda_intel"
    I: [pulseaudio] sink.c: device.bus_path = "pci-0000:00:1b.0"
    I: [pulseaudio] sink.c: sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
    I: [pulseaudio] sink.c: device.bus = "pci"
    I: [pulseaudio] sink.c: device.vendor.id = "8086"
    I: [pulseaudio] sink.c: device.vendor.name = "Intel Corporation"
    I: [pulseaudio] sink.c: device.product.id = "284b"
    I: [pulseaudio] sink.c: device.product.name = "82801H (ICH8 Family) HD Audio Controller"
    I: [pulseaudio] sink.c: device.form_factor = "internal"
    I: [pulseaudio] sink.c: device.string = "front:0"
    I: [pulseaudio] sink.c: device.buffering.buffer_size = "352800"
    I: [pulseaudio] sink.c: device.buffering.fragment_size = "176400"
    I: [pulseaudio] sink.c: device.access_mode = "mmap+timer"
    I: [pulseaudio] sink.c: device.profile.name = "analog-stereo"
    I: [pulseaudio] sink.c: device.profile.description = "Analog Stereo"
    I: [pulseaudio] sink.c: device.description = "Built-in Audio Analog Stereo"
    I: [pulseaudio] sink.c: alsa.mixer_name = "Realtek ALC889A"
    I: [pulseaudio] sink.c: alsa.components = "HDA:10ec0885,106b3600,00100103"
    I: [pulseaudio] sink.c: module-udev-detect.discovered = "1"
    I: [pulseaudio] sink.c: device.icon_name = "audio-card-pci"
    I: [pulseaudio] source.c: Created source 0 "alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
    I: [pulseaudio] source.c: device.description = "Monitor of Built-in Audio Analog Stereo"
    I: [pulseaudio] source.c: device.class = "monitor"
    I: [pulseaudio] source.c: alsa.card = "0"
    I: [pulseaudio] source.c: alsa.card_name = "HDA Intel"
    I: [pulseaudio] source.c: alsa.long_card_name = "HDA Intel at 0x90700000 irq 44"
    I: [pulseaudio] source.c: alsa.driver_name = "snd_hda_intel"
    I: [pulseaudio] source.c: device.bus_path = "pci-0000:00:1b.0"
    I: [pulseaudio] source.c: sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
    I: [pulseaudio] source.c: device.bus = "pci"
    I: [pulseaudio] source.c: device.vendor.id = "8086"
    I: [pulseaudio] source.c: device.vendor.name = "Intel Corporation"
    I: [pulseaudio] source.c: device.product.id = "284b"
    I: [pulseaudio] source.c: device.product.name = "82801H (ICH8 Family) HD Audio Controller"
    I: [pulseaudio] source.c: device.form_factor = "internal"
    I: [pulseaudio] source.c: device.string = "0"
    I: [pulseaudio] source.c: module-udev-detect.discovered = "1"
    I: [pulseaudio] source.c: device.icon_name = "audio-card-pci"
    I: [pulseaudio] alsa-sink.c: Using 2.0 fragments of size 176400 bytes (1000.00ms), buffer size is 352800 bytes (2000.00ms)
    I: [pulseaudio] alsa-sink.c: Time scheduling watermark is 20.00ms
    I: [pulseaudio] alsa-sink.c: Successfully enabled deferred volume.
    I: [pulseaudio] alsa-sink.c: Hardware volume ranges from -179.00 dB to 0.00 dB.
    I: [pulseaudio] alsa-sink.c: Fixing base volume to 0.00 dB
    I: [pulseaudio] alsa-sink.c: Using hardware volume control. Hardware dB scale supported.
    I: [pulseaudio] alsa-sink.c: Using hardware mute control.
    I: [alsa-sink-ALC889A Analog] core-util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
    I: [alsa-sink-ALC889A Analog] alsa-sink.c: Starting playback.
    I: [pulseaudio] alsa-util.c: Trying to disable ALSA period wakeups, using timers only
    I: [pulseaudio] alsa-util.c: ALSA period wakeups disabled
    I: [pulseaudio] alsa-source.c: Successfully opened device front:0.
    I: [pulseaudio] alsa-source.c: Selected mapping 'Analog Stereo' (analog-stereo).
    I: [pulseaudio] alsa-source.c: Successfully enabled mmap() mode.
    I: [pulseaudio] alsa-source.c: Successfully enabled timer-based scheduling mode.
    I: [pulseaudio] (alsa-lib)control.c: Invalid CTL front:0
    I: [pulseaudio] alsa-util.c: Unable to attach to mixer front:0: No such file or directory
    I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
    I: [pulseaudio] source.c: Created source 1 "alsa_input.pci-0000_00_1b.0.analog-stereo" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
    I: [pulseaudio] source.c: alsa.resolution_bits = "16"
    I: [pulseaudio] source.c: device.api = "alsa"
    I: [pulseaudio] source.c: device.class = "sound"
    I: [pulseaudio] source.c: alsa.class = "generic"
    I: [pulseaudio] source.c: alsa.subclass = "generic-mix"
    I: [pulseaudio] source.c: alsa.name = "ALC889A Analog"
    I: [pulseaudio] source.c: alsa.id = "ALC889A Analog"
    I: [pulseaudio] source.c: alsa.subdevice = "0"
    I: [pulseaudio] source.c: alsa.subdevice_name = "subdevice #0"
    I: [pulseaudio] source.c: alsa.device = "0"
    I: [pulseaudio] source.c: alsa.card = "0"
    I: [pulseaudio] source.c: alsa.card_name = "HDA Intel"
    I: [pulseaudio] source.c: alsa.long_card_name = "HDA Intel at 0x90700000 irq 44"
    I: [pulseaudio] source.c: alsa.driver_name = "snd_hda_intel"
    I: [pulseaudio] source.c: device.bus_path = "pci-0000:00:1b.0"
    I: [pulseaudio] source.c: sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
    I: [pulseaudio] source.c: device.bus = "pci"
    I: [pulseaudio] source.c: device.vendor.id = "8086"
    I: [pulseaudio] source.c: device.vendor.name = "Intel Corporation"
    I: [pulseaudio] source.c: device.product.id = "284b"
    I: [pulseaudio] source.c: device.product.name = "82801H (ICH8 Family) HD Audio Controller"
    I: [pulseaudio] source.c: device.form_factor = "internal"
    I: [pulseaudio] source.c: device.string = "front:0"
    I: [pulseaudio] source.c: device.buffering.buffer_size = "352800"
    I: [pulseaudio] source.c: device.buffering.fragment_size = "176400"
    I: [pulseaudio] source.c: device.access_mode = "mmap+timer"
    I: [pulseaudio] source.c: device.profile.name = "analog-stereo"
    I: [pulseaudio] source.c: device.profile.description = "Analog Stereo"
    I: [pulseaudio] source.c: device.description = "Built-in Audio Analog Stereo"
    I: [pulseaudio] source.c: alsa.mixer_name = "Realtek ALC889A"
    I: [pulseaudio] source.c: alsa.components = "HDA:10ec0885,106b3600,00100103"
    I: [pulseaudio] source.c: module-udev-detect.discovered = "1"
    I: [pulseaudio] source.c: device.icon_name = "audio-card-pci"
    I: [pulseaudio] alsa-source.c: Using 2.0 fragments of size 176400 bytes (1000.00ms), buffer size is 352800 bytes (2000.00ms)
    I: [pulseaudio] alsa-source.c: Time scheduling watermark is 20.00ms
    I: [pulseaudio] alsa-source.c: Successfully enabled deferred volume.
    I: [pulseaudio] alsa-source.c: Hardware volume ranges from -16.00 dB to 30.00 dB.
    I: [pulseaudio] alsa-source.c: Fixing base volume to -30.00 dB
    I: [pulseaudio] alsa-source.c: Using hardware volume control. Hardware dB scale supported.
    I: [pulseaudio] alsa-source.c: Using hardware mute control.
    I: [alsa-source-ALC889A Analog] core-util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
    I: [alsa-source-ALC889A Analog] alsa-source.c: Starting capture.
    I: [pulseaudio] module.c: Loaded "module-alsa-card" (index: #6; argument: "device_id="0" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"").
    I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:1b.0/sound/card0 (alsa_card.pci-0000_00_1b.0) module loaded.
    I: [pulseaudio] module-udev-detect.c: Found 1 cards.
    I: [pulseaudio] module.c: Loaded "module-udev-detect" (index: #5; argument: "").
    I: [pulseaudio] module.c: Loaded "module-jackdbus-detect" (index: #7; argument: "channels=2").
    I: [pulseaudio] module.c: Loaded "module-bluetooth-policy" (index: #8; argument: "").
    I: [pulseaudio] module.c: Loaded "module-bluez5-discover" (index: #10; argument: "").
    I: [pulseaudio] module.c: Loaded "module-bluetooth-discover" (index: #9; argument: "").
    E: [pulseaudio] socket-server.c: bind(): Address already in use
    E: [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Failed to initialize daemon.
    I: [pulseaudio] module.c: Unloading "module-bluez5-discover" (index: #10).
    I: [pulseaudio] module.c: Unloaded "module-bluez5-discover" (index: #10).
    I: [pulseaudio] module.c: Unloading "module-bluetooth-discover" (index: #9).
    I: [pulseaudio] module.c: Unloaded "module-bluetooth-discover" (index: #9).
    I: [pulseaudio] module.c: Unloading "module-bluetooth-policy" (index: #8).
    I: [pulseaudio] module.c: Unloaded "module-bluetooth-policy" (index: #8).
    I: [pulseaudio] module.c: Unloading "module-jackdbus-detect" (index: #7).
    I: [pulseaudio] module.c: Unloaded "module-jackdbus-detect" (index: #7).
    I: [pulseaudio] module.c: Unloading "module-alsa-card" (index: #6).
    I: [pulseaudio] sink.c: Freeing sink 0 "alsa_output.pci-0000_00_1b.0.analog-stereo"
    I: [pulseaudio] source.c: Freeing source 0 "alsa_output.pci-0000_00_1b.0.analog-stereo.monitor"
    I: [pulseaudio] source.c: Freeing source 1 "alsa_input.pci-0000_00_1b.0.analog-stereo"
    I: [pulseaudio] card.c: Freed 0 "alsa_card.pci-0000_00_1b.0"
    I: [pulseaudio] module.c: Unloaded "module-alsa-card" (index: #6).
    I: [pulseaudio] module.c: Unloading "module-udev-detect" (index: #5).
    I: [pulseaudio] module.c: Unloaded "module-udev-detect" (index: #5).
    I: [pulseaudio] module.c: Unloading "module-switch-on-port-available" (index: #4).
    I: [pulseaudio] module.c: Unloaded "module-switch-on-port-available" (index: #4).
    I: [pulseaudio] module.c: Unloading "module-augment-properties" (index: #3).
    I: [pulseaudio] module.c: Unloaded "module-augment-properties" (index: #3).
    I: [pulseaudio] module.c: Unloading "module-card-restore" (index: #2).
    I: [pulseaudio] module.c: Unloaded "module-card-restore" (index: #2).
    I: [pulseaudio] module.c: Unloading "module-stream-restore" (index: #1).
    I: [pulseaudio] module.c: Unloaded "module-stream-restore" (index: #1).
    I: [pulseaudio] module.c: Unloading "module-device-restore" (index: #0).
    I: [pulseaudio] module.c: Unloaded "module-device-restore" (index: #0).
    I: [pulseaudio] main.c: Daemon terminated.
    $
    A search of the forums/google/duckduckgo has yielded no similar situations or solutions.
    Any ideas?
    Last edited by kramlegan (2014-08-10 03:55:59)

    Solved my own problem....
    After a day of poking around and thinking about the error message I figured there is a socket is left open or being used somewhere  and pulseaudio does not know how to handle this. I found a socket file in /tmp/.esd-UID/socket that I rm'd. 
    Rebooted my laptop and logged into my Gnome desktop and there is now sound.
    Furthermore I removed the line in /etc/pulse/default.pa that loads module-esound-protocol and have not ran in to any issues.

Maybe you are looking for