Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - l3mce

Pages: 1 [2] 3 4
16
Users / Roku users, need some feedback before I break your stuff :)
« on: August 14, 2012, 04:50:29 pm »
If anyone is using the roku1, I would appreciate it if you would do an experiment for me. Please open device template #2049. The second line has an "Edit Ruby Codes" button. Please change some or all of them from: nfsend("press send");     to: nfsend("press s");    for instance.
Update the template and reload the router.

The roku 2 supports command stacking, so the word tries to send several commands, whereas on the roku 1 I believe the rest are ignored.

If someone could confirm this works, I am holding off on several DT commits. I have fixed the Dinovo Mini, the Gyration Go Mouse, and added support for Adesso remote controls as well as added support for the Roku 2's MAC range, and, of course, these changes to fix navigation behavior.

Thanks.

17
This only applies to GT XXX not GT XXXX which should all have HDMI. For example
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT216 [GeForce GT 230M] [10de:0a2a] (rev a2)
or
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT218 [GeForce 210] [10de:0a65] (rev a2)
are good examples of what I am looking for.

What I am NOT looking for is
01:00.0 VGA compatible controller [0300]: nVidia Corporation G70 [GeForce 7800 GT] [10de:0092] (rev a1)

I need the output of:
lspci -nn | grep -w 'VGA'
apt-cache policy linux-backports-modules-alsa-$(uname -r)
sudo aplay -l

18
Thanks to armorgnome for helping me figure out why intels were breaking.


A while back I added code to update the pciid database so I could get better information on newer cards, and an odd quirk was that some were coming back in upper case. I changed the scheme to convert all names to upper case, but on the Intel side missed a supplemental install which is necessary for many of them to work. Unfortunately a blogger trying to install LMCE was affected by this, so his experience was less than good and his opinion of the project, less than favorable.

There should be a new build sometime later today, and a new snap. If you were affected by this
sudo apt-get update
apt-cache policy pluto-boot-scripts | grep -i candidate

When the version is >= 26303 then either, sudo apt-get install pluto-boot-scripts, or sudo apt-get upgrade.

Sorry for the oversight.

19
So... currently we have to mount the drive momentarily to extract its size. I figured out a trick to get around that, and as always... I need testers. This change will not break anything, and is less invasive than the current method. If it didn't work, it would simply not report the size, or not report it correctly.

That is another thing. I am reporting ACTUAL size... so do not be confused if your 2TB drive shows up as 1.82 TB... for example.

Just backup your current /usr/pluto/bin/StorageDevices_Radar.sh, and replace it with this
http://svn.linuxmce.org/trac.cgi/export/26267/people/l3mce/StorageDevices_Radar.sh

Then either plug in some drives, or remove known drives from your system and let it detect them.

This should work for physical devices you attach to the system (hard drives, usb drives, sd drives, software raids etc), not network devices.
Thank you in advance.
 

20
So as the title says. In my continuing quest to get HDMI audio right, I have moved on to ATI... which is actually more of a pain than nVidia.

So, light em if you got em.

Begin by giving me the output of
Code: [Select]
sudo aplay -l

21
So I wrote this a while back, and have made some adjustments to it. I need to do this the right way and use the DB to determine MDs instead of the cheat I am using, but for now it will do. I also need to log... so it is likely to change shortly, but what it does is upgrade your entire system at the same time, upgrading the MDs locally. The steps it takes are:

1. Update/upgrade the core.
2. Copies the packages files to /usr/pluto/deb-cache
3. Creates a new Packages.gz file
4. Backs up the entire /usr/pluto/diskless directory in a tarball in /usr/pluto/backup
5. Updates/upgrades MDs, regardless of their on/off state using NFS link to cores deb-cache (meaning, the upgrades for MDs are local)
6. Cleans up and exits.

So, at the moment, you shouldn't turn an MD off if it is on while it is upgrading. Nor should you try and use this if you have different MD versions (like 810 MD on a 1004 hybrid).

Would appreciate feedback. Just put it somewhere on the core (/usr/pluto/bin would be a good place), and run it as root.
Code: [Select]
svn co http://svn.linuxmce.org/svn/people/l3mce/GlobalUpgrades.shIf you don't have subversion, then
Code: [Select]
wget http://svn.linuxmce.org/svn/people/l3mce/GlobalUpgrades.sh; chmod +x GlobalUpgrades.sh

This is an upgrade. It COULD break things. Remember, there is a backup of the MDs. This occurs before upgrade so you can restore.
This is an upgrade. ALL Machines will need to be restarted. I do not do this automatically in case they are in use.

This is a little bulky atm because I am a bit hesitant to use a mv command with the packages, so I am duplicating them. That WILL change. The backup also takes up some space... and atm this all happens on the core drive... so... you will need a little free space...
There is no more duplication of packages. I have also added some mounting which fixes certain kinds of package upgrades with MD's that are not active.

This will work on any version of LMCE.


22
Users / 1004: The time has come.
« on: April 14, 2012, 03:37:39 am »
No, not beta time.

The time has come where our DVD installer is stable enough that I need more people to use it and find bugs so we can get it to beta.

I can't break it any more.

What it does different than previous DVD installers
  • It is one process. It does not install Kubuntu, then run an installer. It installs Kubuntu with LMCE.
  • Almost everything pre-exists on the DVD. Very little downloading at all is necessary.
  • You can do offline installs.
  • It has its own installer, so (though I am not sure why one would) it can do side-by-side installs.
  • It has a hybrid or core-only install option.
  • It has greatly improved video detection/utilization. You can now use MOST nVidia, ATI, Intel, and VIA chipsets.
  • You no longer need to run the laborious Diskless_CreateTBZ.sh to run media directors. It is embedded. Just plug something in and boot.
  • There is a live boot option, which will take you directly into AVWizard. (You will want a decent amount of ram for this option)
  • The entire install process is less than 40 minutes including the MD stuff.
  • It's prettier.

You will want to use this snapshot, or newer: http://linuxmce.iptp.org/snapshots/LMCE-1004-20120412224425879.iso   Latest is latest, but doesn't always mean greatest.
And check the snapshot wiki for the BEST versions in the future: http://wiki.linuxmce.org/index.php/Snapshot_overview   (Snap ending in 118 is there atm but I am sure bongowongo will soon change it.)

Known problems:
  • The first time Setup Wizard tries to load, it is not actually finished generating, so while it is still installing the remaining pieces it spits two window errors "Cannot read orbiter configuration from the server" and "The UI is being regenerated. This may take 15-30 minutes". It does not take anywhere near 15 minutes to resolve itself. http://svn.linuxmce.org/trac.cgi/ticket/1446
  • Desktop spits an error when attempting to load. Workaround: where "USER" (in lower case) is the OS user you specify in the dvd installer: sudo chown -R USER.USER /home/USER/.kde
  • KVM vesa throws a failure to setup X.
  • SSH to core is broken.
  • AVWizard pre-installs the wrong driver for ATI cards not supported by the proprietary driver.
  • AVWizard creates an xorg.conf file prematurely.
  • Headless incorrectly warns that AVWizard is coming.

I am working to resolve these (obviously).

So... give it a go. PLEASE submit tickets for bugs you find not related to the above at http://svn.linuxmce.org/
Feel free to report success here.
Thanks for testing.

23
Developers / A note about the work I have been doing.
« on: April 12, 2012, 02:00:47 am »
I have done some things recently which have a lot of instant gratification, and curb appeal. The DVD installer is prettier and should end up easier to use than prior stuff. The video detection opened up a LOT of previously unavailable hardware opportunities for use with LMCE.

A lot of people have told me I'm cool. It makes me feel pretty inside.

Then I look over at golgoj's nic. Awake and plugging away when I am. Handling complaints about software he is writing in languages unknown to other devs, with no support outside of that which involves the existing system. He is in uncharted territory, building from scratch... and nobody has really picked up the invitation to help him (outside of Merk of course). He is unshaken by this, and when he encounters a problem, learns the language behind the problem and carries on.

The base code was there for everything I have done, except the dvd thing which I had a lot of existing other projects to steal from... and... it's just bash scripting. I can type #bash in IRC if I have a problem, and there are 15 experts who dump a solution I have been working on for hours or days in a couple of seconds. Golgoj IS one of the top guys in the qt channels. He has to understand the core architecture of LMCE, learn C++, js, qt, QML, mysql, build it all from scratch and make it all work... and people seem to be more complaining than alerting about problems.

So... while I am very happy with myself and my pet projects... they are NOTHING like the scope of things golgoj is doing, with little adulation or fanfare. Once I am satisfied that my projects are not causing any problems whatsoever, I will be helping him full time. I really do thank you all for your support of my instant gratification exercises... but... when you think about it... give golgoj the props. His stuff is a lot harder, without the YAY factor, and will end up completely changing how this project interacts with the users.


All hail Langston.
You f!@#$in rock.

24
Users / Dual GPU laptops and LMCE
« on: April 10, 2012, 07:56:18 pm »
So I have written some code to handle disabling the discrete GPU and running the powerful GPU on laptops supplied with two for battery saving. Unfortunately I have no such hardware, so I have just sort of guessed at it. I would like someone with a laptop that has two GPU's to test this code. Chances are my first guess won't just work OOTB, so it would be helpful if someone would drop in IRC at their convenience to try and get this going. I am particularly interested in anyone with a weak and a powerful Intel based GPU pair. Typically there is a low power intel and a higher power nVidia or ATI, which is frankly a lot easier to deal with. Having the code figure out WHICH Intel to pick is a bit dicey, esp without any actual hardware to test on.

Thanks in advance to anyone who will test.

25
Users / VIDEO CARDS: ATI, Intel, VIA... whatever you got...
« on: March 14, 2012, 03:12:19 pm »
At long last, as a side effect of dealing with the dvd snapshot maker, I picked up where I left off trying to get better video card support. I believe the next build should have video detection kicked wide open.

I need people to test Intel, ATI, and VIA MDs. I am trying not to be overly optimistic... but I am out of equipment to test on... and everything works (newest versions of nVidia hardware notwithstanding). However the new nVidia chipset interoperability is right around the corner. I have the source code, I just need to compile our own versions of the nVidia 295.20 drivers and nvidia-settings specific to that driver, and get it all happy in the DB. I have already written the detection scheme. On the newest nVidia chipsets there is a new VDPAU revision (rev D) which reports greatly improved h264 support, so I am looking forward to that.

LMCE should work on just about anything now. Just apt-get update, apt-get upgrade, and you will have to then run /usr/pluto/bin/Diskless_CreateTBZ.sh (again if run before, so that the new code is used for them).

Then pull out your abandoned cards/MD projects, and just plug them in. Set your laptops to network boot... MDs are all slim clients... your host OS will not be affected.

So, come on folks. Make me a liar.
Please report any failures along with output of lspci -v | grep "VGA"

26
Users / New LMCE splash screen/logo!
« on: January 31, 2012, 03:36:15 pm »



No... that isn't it.

You haven't made it yet. As I am graphically challenged I am asking for the LMCE communities help. We are working on a new branded lmce install dvd, and I need a 640x480 .png which looks awesome. My sense of design is stuck in 1992, so this, I thought, would be a great way for folks to contribute. Please look at the above image to get a sense of the menu/title. It is trapped there for all intents and purposes. No I cannot put it at the bottom or on the side. It goes there. There may be more options added, so leave some room underneath for a few more entries.

I thought if we got some submissions I would make a poll for people to vote on what we like best. I think this is a cool opportunity to contribute something for those who don't code, and even those who do. At the end of the day, you must release this image as GPL for use with LinuxMCE... so no grifting OK? Original work only please.

You are also free to make a bootloader image like phenigmas... You don't have to go full boat and make an actual bootloader package... but are welcome to. I am happy using phenigmas... I like it... but some have held reservations about poor little tux being a bit played out and dominating... or sort of out of place. Again, I love the little guy, and the ONLY official images he had to work with are loungetux. That is another thing... please make the logo you come up with a layer so we can use it elsewhere if you are struck with lightning. Transparency is supported, and is currently black.

Feel free to submit as many as you like. Try to remember though... this will be the first thing everyone who installs sees on their screen... so pretending we are professional is probably the best tack. So... show us what you got! You will not get any discouraging remarks.

27
I believe I have found the problem with ATI and Intel auto-detection.
Please replace /usr/pluto/bin/Utils.sh with the following
Code: [Select]
#!/bin/bash

if [[ -n "$HEADER_Utils" ]]; then
        return 0
fi
HEADER_Utils=included

. /usr/pluto/bin/SQL_Ops.sh
. /usr/pluto/bin/Config_Ops.sh

DEVICETEMPLATE_OnScreen_Orbiter=62
DEVICEDATA_Use_OpenGL_effects=172
DEVICEDATA_Use_alpha_blended_UI=169
DEVICEDATA_PK_UI=104

function AddBookmark {
        return 0
        Url="$1"
        Name="$2"

        [[ ! -f /home/public/bookmarks.html ]] || return 0

        # Generate an id for this bookmark
        ID=$(echo "$Url" | sha1sum)
        ID='rdf:#$'${ID:0:6}

        # Generate the bookmark entry
        Bookmark='   <DT><A HREF="'$Url'" ADD_DATE="1126869382" LAST_MODIFIED="1126869442" ID="'$ID'">'$Name'</A>'
        Bookmark=$(echo $Bookmark | sed 's/"/\\\"/g')

        for BookmarksFile in /home/public/bookmarks.html /home/user_*/bookmarks.html ;do
                # See if the bookmark is already there
                if grep -q "ID=\"$ID\"" $BookmarksFile ;then
                        continue
                fi

                # Add the bookmark string to the file
                awk '
                        BEGIN { HR=0 }
                        HR==0 && /<HR>/ {print "'"$Bookmark"'"; HR=1}
                        {print}
                ' $BookmarksFile > $BookmarksFile.$$
                mv $BookmarksFile.$$ $BookmarksFile
        done

}

function DelBookmark {
        return 0
        Url="$1"
        Name="$2"

        [[ ! -f /home/public/bookmarks.html ]] || return 0

        # Generate an id for this bookmark
        ID=$(echo "$Url" | sha1sum)
        ID='rdf:#$'${ID:0:6}

        for BookmarksFile in /home/public/bookmarks.html /home/user_*/bookmarks.html ;do
                grep -v "ID=\"$ID\"" $BookmarksFile >> $BookmarksFile.$$
                mv $BookmarksFile.$$ $BookmarksFile
        done
}

TranslateSerialPort()
{
        local SearchFor="$1"
        local PCI USB

        SerialPort=
        if [[ "$SearchFor" == pci* ]]; then
                if [[ -d /sys/class/tty ]]; then
                        pushd /sys/class/tty &>/dev/null
                        for dev in ttyUSB*/device ttyACM*/device; do
                                id=$(readlink -f "$dev" | sed -r 's,^.*(pci.*)/usb[0-9]*/[0-9./-]*/[0-9]*-([0-9.]*):[0-9.]*(/ttyUSB[0-9]*)?$,\1+\2,g')
                                if [[ "$id" == "$SearchFor" ]]; then
                                        SerialPort="/dev/$(dirname "$dev")"
                                        break;
                                fi
                        done
                        popd &>/dev/null
                fi
        else
                SerialPort="$SearchFor"
        fi

        builtin echo "$SerialPort"
}

TranslateSoundCard()
{
        local SoundCard="$1" AlsaCard=
        local PCI USB
        local Cards Card Dev

        if [[ -d /sys/class/sound && "$SoundCard" == pci* ]]; then
                if [[ "$SoundCard" == *+* ]]; then
                        PCI="${SoundCard%+*}"
                        USB="${SoundCard#*+}"
                else
                        PCI="${SoundCard}"
                        USB=
                fi
                pushd /sys/class/sound &>/dev/null
                Cards=$(find -name 'controlC*')
                for Card in $Cards; do
                        Card="${Card#./}"
                        Dev=$(readlink "$Card/device"|cut -f3 -d/)
                        if [[ -n "$USB" ]]; then
                                if [[ "$Dev" == *"$PCI"*usb*"$USB:"* ]]; then
                                        AlsaCard="${Card#controlC}"
                                        break
                                fi
                        else
                                if [[ "$PCI" == *"$Dev" ]]; then
                                        AlsaCard="${Card#controlC}"
                                        break
                                fi
                        fi
                done
                popd &>/dev/null
        fi

        builtin echo "$AlsaCard"
}

UseAlternativeLibs()
{
        export LD_LIBRARY_PATH=/opt/libsdl/lib:/opt/libxine/lib:/opt/libsdl1.2-1.2.7+1.2.8cvs20041007/lib:/opt/linphone-1.3.5/lib
}

function ListTemplates_Category {
        local FK_DeviceCategory_Parent="$1"
        local PK_DeviceTemplate_List=""
        local PK_DeviceCategory=""
        local PK_DeviceTemplate=""

        R=$(RunSQL "SELECT PK_DeviceCategory FROM DeviceCategory WHERE FK_DeviceCategory_Parent = $FK_DeviceCategory_Parent")
        for PK_DeviceCategory in $R ;do
                PK_DeviceTemplate_List="$PK_DeviceTemplate_List $(ListTemplates_Category "$PK_DeviceCategory")"
        done

        R=$(RunSQL "SELECT PK_DeviceTemplate FROM DeviceTemplate WHERE FK_DeviceCategory=$FK_DeviceCategory_Parent")
        for PK_DeviceTemplate in $R ;do
                PK_DeviceTemplate_List="$PK_DeviceTemplate_List $PK_DeviceTemplate"
        done

        echo $PK_DeviceTemplate_List
}


FindDevice_Template()
{
        local PK_Device_Parent="${1//\'}" FK_DeviceTemplate="${2//\'}" NoRecursion="$3" IncludeParent="$4" All="$5"
        local Limit Found=0

        if [[ -z "$PK_Device_Parent" || -z "$FK_DeviceTemplate" ]]; then
                echo ""
                return 1
        fi

        if [[ -z "$All" ]]; then
                Limit="LIMIT 1"
        fi

        local i R Q
        if [[ "$PK_Device_Parent" == 0 ]]; then
                Q="
                        SELECT PK_Device
                        FROM Device
                        WHERE FK_Device_ControlledVia IS NULL AND FK_DeviceTemplate IN ($FK_DeviceTemplate)
                        $Limit
                "
        elif [[ -z "$IncludeParent" ]]; then
                Q="
                        SELECT PK_Device
                        FROM Device
                        WHERE FK_Device_ControlledVia='$PK_Device_Parent' AND FK_DeviceTemplate IN ($FK_DeviceTemplate)
                        $Limit
                "
        else
                Q="
                        SELECT PK_Device
                        FROM Device
                        WHERE (FK_Device_ControlledVia='$PK_Device_Parent' OR PK_Device='$PK_Device_Parent') AND FK_DeviceTemplate IN ($FK_DeviceTemplate))
                        $Limit
                "
        fi
        R="$(RunSQL "$Q")"

        if [[ -n "$R" ]]; then
                echo "$R"
        fi

        if [[ ( -z "$R" || -n "$All" ) && -z "$NoRecursion" ]]; then
                Q="SELECT PK_Device FROM Device WHERE FK_Device_ControlledVia='$PK_Device_Parent'"
                R="$(RunSQL "$Q")"
                for i in $R; do
                        if FindDevice_Template "$i" "$FK_DeviceTemplate" "" "" "$All"; then
                                if [[ -z "$All" ]]; then
                                        return 0
                                else
                                        Found=1
                                fi
                        fi
                done
        else
                return 1
        fi

        [[ "$Found" -eq 1 ]]
        return $?
}

FindDevice_Category()
{
        local PK_Device_Parent="${1//\'}" FK_DeviceCategory="${2//\'}" NoRecursion="$3" IncludeParent="$4" All="$5"
        local Limit Found=0

        if [[ -z "$PK_Device_Parent" || -z "$FK_DeviceCategory" ]]; then
                echo ""
                return 1
        fi

        if [[ -z "$All" ]]; then
                Limit="LIMIT 1"
        fi

        local i R Q
        if [[ "$PK_Device_Parent" == 0 ]]; then
                Q="
                        SELECT PK_Device
                        FROM Device
                        JOIN DeviceTemplate ON FK_DeviceTemplate=PK_DeviceTemplate
                        WHERE FK_Device_ControlledVia IS NULL AND FK_DeviceCategory IN ($FK_DeviceCategory)
                        $Limit
                "
        elif [[ -z "$IncludeParent" ]]; then
                Q="
                        SELECT PK_Device
                        FROM Device
                        JOIN DeviceTemplate ON FK_DeviceTemplate=PK_DeviceTemplate
                        WHERE FK_Device_ControlledVia='$PK_Device_Parent' AND FK_DeviceCategory IN ($FK_DeviceCategory)
                        $Limit
                "
        else
                Q="
                        SELECT PK_Device
                        FROM Device
                        JOIN DeviceTemplate ON FK_DeviceTemplate=PK_DeviceTemplate
                        WHERE (FK_Device_ControlledVia='$PK_Device_Parent' OR PK_Device='$PK_Device_Parent') AND FK_DeviceCategory IN ($FK_DeviceCategory)
                        $Limit
                "
        fi
        R="$(RunSQL "$Q")"

        if [[ -n "$R" ]]; then
                echo "$R"
        fi

        if [[ ( -z "$R" || -n "$All" ) && -z "$NoRecursion" ]]; then
                Q="SELECT PK_Device FROM Device WHERE FK_Device_ControlledVia='$PK_Device_Parent'"
                R="$(RunSQL "$Q")"
                for i in $R; do
                        if FindDevice_Category "$i" "$FK_DeviceCategory" "" "" "$All"; then
                                if [[ -z "$All" ]]; then
                                        return 0
                                else
                                        Found=1
                                fi
                        fi
                done
        else
                return 1
        fi

        [[ "$Found" -eq 1 ]]
        return $?
}

# Get the device number for the parent of the given device
# Returns: number or empty string
GetDeviceParent()
{
        local PK_Device="$1"
        Q="
                SELECT FK_Device_ControlledVia
                FROM Device
                WHERE PK_Device='$PK_Device'
        "
        local R=$(RunSQL "$Q")

        if [[ "$R" == NULL ]]; then
                R=""
        fi
        echo "$R"
}

# Delete a device and make its children top level
# Does exactly the same thing as CMD_Delete_Device in General_Info_Plugin
DeleteDevice()
{
        local PK_Device="$1"
        local Q R

        # Delete embedded devices
        Q="SELECT PK_Device FROM Device where FK_Device_RouteTo=$PK_Device"
        R=$(RunSQL "$Q")
        for Device in $R; do
                DeleteDevice "$Device"
        done

        local -a Queries
        Queries=(
                "UPDATE Device SET FK_Device_ControlledVia=NULL WHERE FK_Device_ControlledVia=$PK_Device"
                "DELETE FROM Device WHERE PK_Device=$PK_Device"
                "DELETE FROM CommandGroup_Command WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_Command WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_CommandGroup WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_DeviceData WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_DeviceGroup WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_Device_Related WHERE FK_Device=$PK_Device OR FK_Device_Related=$PK_Device"
                "DELETE FROM Device_EntertainArea WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_HouseMode WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_Orbiter WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_StartupScript WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_Users WHERE FK_Device=$PK_Device"
                "DELETE FROM Package_Device WHERE FK_Device=$PK_Device"
                "DELETE FROM PaidLicense WHERE FK_Device=$PK_Device"
                "DELETE FROM Device_Device_Pipe WHERE FK_Device_From=$PK_Device OR FK_Device_To=$PK_Device"
                "DELETE FROM PaidLicense WHERE FK_Device=$PK_Device"
        )

        for Q in "${Queries[@]}"; do
                RunSQL "$Q"
        done
}

XineConfSet()
{
        local Setting="$1"
        local Value="$2"
        local XineConf="${3:-/etc/pluto/xine.conf}"

        [[ -z "$Setting" || -z "$Value" ]] && return 1

        if grep -qF "$Setting" "$XineConf"; then
                sed -i "s/^.*$Setting:.*$/$Setting:$Value/" "$XineConf"
        else
                echo "$Setting:$Value" >>"$XineConf"
        fi
}

DeviceIsDisabled()
{
        local PK_Device="$1"
        local R Q

        [[ -z "$PK_Device" ]] && return 1

        Q="SELECT COUNT(*) FROM Device WHERE PK_Device='$PK_Device' AND Disabled=0"
        R=$(RunSQL "$Q")

        if [[ -n "$R" && "$R" -eq 0 ]]; then
                return 0 # Device is disabled or does not exist at all
        else
                return 1 # Device exists and is enabled
        fi
}

FindInArray()
{
        local Value="$1" Array i
        shift
        Array=("$@")

        for ((i = 0; i < ${#Array[*]}; i++)); do
                if [[ "${Array[$i]}" == "$Value" ]]; then
                        echo "$i"
                        return 0
                fi
        done
        return 1
}

FindInArray_Prefix()
{
        local Value="$1" Array i
        shift
        Array=("$@")

        for ((i = 0; i < ${#Array[*]}; i++)); do
                if [[ "${Array[$i]}" == "$Value"* ]]; then
                        echo "$i"
                        return 0
                fi
        done
        return 1
}

# Verify that the given string is a valid IPv4
ValidIP()
{
        local IP="$1"

        local IPn="[0-9]{1,3}"
        local IPpattern="^($IPn)\\.($IPn)\\.($IPn)\\.($IPn)$"
        local i Number

        # Bash 3.1 requires $IPpattern to be quoted, otherwise it gives a syntax error
        # Bash 3.2 requires $IPpattern to be unquoted, otherwise it fails to match the pattern
        # Ubuntu has Bash 3.2
        if [[ ! "$IP" =~ $IPpattern ]]; then
                return 1
        fi

        for ((i = 1; i <= 4; i++)); do
                Number="${BASH_REMATCH[$i]}"
                if ((Number < 0 || Number > 255)); then
                        return 1
                fi
        done

        return 0
}

GetVideoDriver()
{
        if [[ -n "$ForceVESA" ]]; then
                echo vesa
                return 0
        fi

        local VideoDriver
#
#<-mkr_B_via_b->
        VideoDriver=$(lspci | grep ' VGA ' | cut -d' ' -f5)
        # If we only detect a vesa based system, lets see if we can find out what else it might be
        #if [[ "$VideoDriver" == "vesa" ]]; then
        #{
        #        DisplayNote=$(lshwd|grep "Display controller"| cut -f 2 -d \|)
                # This should work beautifully for the ASUS eee Box
        #        if [[ "$DisplayNote" == "Mobile Integrated Graphics Controller (vesa)" ]]; then
        #        {
        #                VideoDriver="intel"
        #        }
        #        fi
        #}
        #fi
        case "$VideoDriver" in
                nVidia)
                        if PackageIsInstalled nvidia-glx || PackageIsInstalled nvidia-glx-new || PackageIsInstalled nvidia-glx-71 || PackageIsInstalled nvidia-glx-96 || PackageIsInstalled nvidia-glx-173 || PackageIsInstalled nvidia-glx-180 || PackageIsInstalled nvidia-glx-190 || PackageIsInstalled nvidia-glx-195 || PackageIsInstalled nvidia-glx-260 ;then
                                VideoDriver="nvidia"
                        fi
                ;;
                Radeon|ATI) PackageIsInstalled xorg-driver-fglrx && VideoDriver="fglrx" ;;
                Intel) VideoDriver="intel" ;;
                "") VideoDriver="vesa" ;; # just-in-case default
        esac
#<-mkr_B_via_e->
        echo "$VideoDriver"
}

ReloadDevicesOnThisMachine()
{
        for Dev in $(cat /usr/pluto/locks/pluto_spawned_local_devices.txt); do
                /usr/pluto/bin/MessageSend "$DCERouter" 0 "$Dev" 7 1 163 "Utils.sh ReloadDevicesOnThisMachine"
        done
}

OpenGLeffects()
{
        local Q

        Q="
                SELECT IK_DeviceData
                FROM Device
                LEFT JOIN Device AS Parent ON Parent.PK_Device=Device.FK_Device_ControlledVia
                JOIN Device_DeviceData ON Device.PK_Device=FK_Device
                WHERE
                        Device.FK_DeviceTemplate='$DEVICETEMPLATE_OnScreen_Orbiter'
                        AND (
                                Device.FK_Device_ControlledVia='$PK_Device'
                                OR Parent.FK_Device_ControlledVia='$PK_Device'
                        )
                AND FK_DeviceData='$DEVICEDATA_Use_OpenGL_effects'
        "
        RunSQL "$Q"
}

AlphaBlendingEnabled()
{
        local Q

        Q="
                SELECT IK_DeviceData
                FROM Device
                LEFT JOIN Device AS Parent ON Parent.PK_Device=Device.FK_Device_ControlledVia
                JOIN Device_DeviceData ON Device.PK_Device=FK_Device
                WHERE
                        Device.FK_DeviceTemplate='$DEVICETEMPLATE_OnScreen_Orbiter'
                        AND (
                                Device.FK_Device_ControlledVia='$PK_Device'
                                OR Parent.FK_Device_ControlledVia='$PK_Device'
                        )
                AND FK_DeviceData='$DEVICEDATA_Use_alpha_blended_UI'
        "
        RunSQL "$Q"
}

GetDeviceData()
{
        local Q
        local Device="$1" DeviceData="$2"

        Q="
                SELECT IK_DeviceData
                FROM Device_DeviceData
                WHERE FK_Device='$Device' AND FK_DeviceData='$DeviceData'
        "
        Field 1 "$(RunSQL "$Q")"
}

SetDeviceData()
{
        local Q
        local Device="$1" DeviceData="$2" Value="$3"

        Q="
                UPDATE Device_DeviceData
                SET IK_DeviceData='$Value'
                WHERE FK_Device=$Device AND FK_DeviceData=$DeviceData
        "
        RunSQL "$Q"
}

UI_SetOptions()
{
        local OrbiterDev="$1"
        local OpenGLeffects="$2"
        local AlphaBlending="$3"
        local UI_Version="$4"

        # disable OpenGL effects
        Q="
                REPLACE INTO Device_DeviceData(FK_Device, FK_DeviceData, IK_DeviceData)
                VALUES('$OrbiterDev', '$DEVICEDATA_Use_OpenGL_effects', '$OpenGLeffects')
        "
        RunSQL "$Q"
        # disable alpha blending
        Q="
                REPLACE INTO Device_DeviceData(FK_Device, FK_DeviceData, IK_DeviceData)
                VALUES('$OrbiterDev', '$DEVICEDATA_Use_alpha_blended_UI', '$AlphaBlending')
        "
        RunSQL "$Q"
        # select UI
        Q="
                REPLACE INTO Device_DeviceData(FK_Device, FK_DeviceData, IK_DeviceData)
                VALUES('$OrbiterDev', '$DEVICEDATA_PK_UI', '$UI_Version')
        "
        RunSQL "$Q"
}

function GeneratePassword() {
        #TODO: Replace with this --->  </dev/urandom tr -dc A-Za-z0-9_ | head -c8
        local -a alpha1=(Q W E R T Y U I O P A S D F G H J K L Z X C V B N M)
        local -a alpha2=(q w e r t y u i o p a s d f g h j k l z x c v b n m)
        local -a alpha3=(1 2 3 4 5 6 7 8 9 0)

        local pass=""
        pass=$pass"${alpha1[$(($RANDOM%26))]}${alpha1[$(($RANDOM%26))]}${alpha1[$(($RANDOM%26))]}"
        pass=$pass"${alpha2[$(($RANDOM%26))]}${alpha2[$(($RANDOM%26))]}${alpha2[$(($RANDOM%26))]}"
        pass=$pass"${alpha3[$(($RANDOM%10))]}${alpha3[$(($RANDOM%10))]}"

        local fromwhere=$(( $RANDOM % 3 + 1 ))
        [[ $fromwhere == 1 ]] && pass=$pass"${alpha1[$(($RANDOM%26))]}"
        [[ $fromwhere == 2 ]] && pass=$pass"${alpha2[$(($RANDOM%26))]}"
        [[ $fromwhere == 3 ]] && pass=$pass"${alpha3[$(($RANDOM%10))]}"


        for i in `seq 1 100` ;do
                local split=$(( $RANDOM % ${#pass} + 1 ))
                pass1=${pass:$split}
                pass2=${pass:0:$split}
                pass="${pass1}${pass2}"
        done

        echo $pass
}

function GeneratePasswordOf6Digits()
{
        local pass
        for ((i = 0; i < 6; i++)); do
                pass="${pass}$((RANDOM % 10))"
        done
        echo "$pass"
}

Log()
{
        local File="$1"; shift
        local Msg="$*"

        echo "LOG: $Msg"
        echo "$Msg" >>"$File"
}


function BlacklistConfFiles()
{
        local file=$1

        if [[ -e /etc/confblacklist ]] ;then
                while read line; do
                        if [[ "$line" == "$file" ]] ;then
                                return 0
                        fi
                done < /etc/confblacklist
        fi

        return 1
}

function VDRInstalled() {
        # Return true if VDR is installed
        DEVICETEMPLATE_VDR_Plugin="1704"
        Q="SELECT PK_Device FROM Device Where FK_DeviceTemplate = $DEVICETEMPLATE_VDR_Plugin"
        VDRDevice=$(RunSQL "$Q")                                         
        if [ "$VDRDevice" == "" ] ; then                                 
                RETURNVALUE=1                                             
        else                                                             
                RETURNVALUE=0                                             
        fi                                                               
        return $RETURNVALUE
}

Boot a new MD with either Intel or ATI.
Medium overlay at best please.

Please report results.
Thank you as always.

28
I have attached a script that should blow open all mixer channels on all cards. This is meant to occur before AVWizard eventually.

It works for my onboard sound... but as AVWizard is doing its own switching magic, I intend to unmute and raise volume on everything (onboard, 1 card, 2 cards, whatever...) and then mute unneeded channels after AVWiz does its thing.

In order to use this script, please download onto your core someplace
then cd into the directory it lives in
Code: [Select]
sudo su
alsamixer
Mute everything and exit (esc).
Code: [Select]
chmod +x amix.sh
./amix.sh

Then please check your alsamixer and make sure everything is unmuted and report success or failure here. Then feel free to mute everything you normally do. Also let me know if the levels are all pegged, or if they (as intended) are at 60%. I will handle the re-muting after AVWizard.

Please then paste the output of a file which is created in the same directory named amix.log
This is mine:
Code: [Select]
cat amix.log

umamix.sh generated script
#!/bin/bash
amixer set -c 0 "Master Front,0" 60 unmute
amixer set -c 0 "Headphone,0" 60 unmute
amixer set -c 0 "PCM,0" 60 unmute
amixer set -c 0 "Front,0" 60 unmute
amixer set -c 0 "Front Mic,0" 60 unmute
amixer set -c 0 "Surround,0" 60 unmute
amixer set -c 0 "Center,0" 60 unmute
amixer set -c 0 "LFE,0" 60 unmute
amixer set -c 0 "Side,0" 60 unmute
amixer set -c 0 "Line,0" 60 unmute
amixer set -c 0 "CD,0" 60 unmute
amixer set -c 0 "Mic,0" 60 unmute
amixer set -c 0 "IEC958,0" 60 unmute
amixer set -c 0 "IEC958 Default PCM,0" 60 unmute
amixer set -c 0 "IEC958,1" 60 unmute
amixer set -c 0 "Capture,0" 60 unmute
amixer set -c 0 "Capture,1" 60 unmute
amixer set -c 0 "Independent HP,0" 60 unmute
amixer set -c 0 "Input Source,0" 60 unmute
amixer set -c 0 "Smart 5.1,0" 60 unmute
Mixer settings
Simple mixer control 'Master Front',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [14.00dB] [on]
  Front Right: Playback 31 [100%] [14.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 27
  Mono:
  Front Left: Playback 27 [100%] [0.00dB] [on]
  Front Right: Playback 27 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 60 [24%] [-39.00dB]
  Front Right: Playback 60 [24%] [-39.00dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 27
  Mono:
  Front Left: Playback 27 [100%] [0.00dB] [on]
  Front Right: Playback 27 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [14.00dB] [on]
  Front Right: Playback 31 [100%] [14.00dB] [on]
Simple mixer control 'Surround',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 27
  Mono:
  Front Left: Playback 27 [100%] [0.00dB] [on]
  Front Right: Playback 27 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 27
  Mono: Playback 27 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 27
  Mono: Playback 27 [100%] [0.00dB] [on]
Simple mixer control 'Side',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 27
  Mono:
  Front Left: Playback 27 [100%] [0.00dB] [on]
  Front Right: Playback 27 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [14.00dB] [on]
  Front Right: Playback 31 [100%] [14.00dB] [on]
Simple mixer control 'CD',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [14.00dB] [on]
  Front Right: Playback 31 [100%] [14.00dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [14.00dB] [on]
  Front Right: Playback 31 [100%] [14.00dB] [on]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 20
  Front Left: Capture 20 [100%] [35.00dB] [on]
  Front Right: Capture 20 [100%] [35.00dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 20
  Front Left: Capture 20 [100%] [35.00dB] [on]
  Front Right: Capture 20 [100%] [35.00dB] [on]
Simple mixer control 'Independent HP',0
  Capabilities: enum
  Items: 'OFF' 'ON'
  Item0: 'OFF'
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Stereo Mixer' 'Mic' 'Front Mic' 'Line' 'CD'
  Item0: 'Mic'
Simple mixer control 'Smart 5.1',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]

To run on an md, as root, where XX is your moon number:
Code: [Select]
cp /wherever/exists/on/core/amix.sh /usr/pluto/diskless/XX/usr/pluto/bin   
ssh moonXX
/usr/pluto/bin/amix.sh
Then
Code: [Select]
cat /usr/pluto/bin/amix.logand paste here...

Thanks for those who help.

29
Users / Richard Van de Perre (rperre) is gone.
« on: April 30, 2011, 07:25:32 pm »
Our friend rperre was lost in a training exercise on Thursday. As those who knew him were aware, he was an Apache helicopter instructor, as well as a LinuxMCE enthusiast. Many of us secretly envied his expertise in so many fields, not the least of which was skilfully maneuvering one of the most difficult craft in the air to fly. Beyond simply being a brilliant guy, he was an admirable person just to talk with. I very much enjoyed his company, and was often taken aback by his even keel and demeanor, even when people deserved a bit of backlash. He was just an all around great guy. A Dutch native, he became a US Citizen in 2010. He served with honor in Afghanistan and Africa. He was just 39.

He is survived by his wife Wilma, and step children, Lindsey Fain, Brooks Latta, Emily Anne Latta, and his grandson, John Parker. For those of you who pray, keep them in yours. It must be dismal to endure this personal tragedy, surrounded by the destruction that has occurred in Alabama just a day earlier. He will be very sorely missed.


rust in vrede

30
Installation issues / ATI chipsets: Seeking testers
« on: April 26, 2011, 08:54:34 pm »
A minor change has recently been made to the detection schema regarding ATI, and I am asking for some help figuring out what works, what doesn't, and why.

If you have spare equipment lying around with ATI, I would appreciate some feedback just attempting to make it autodetect correctly.
What I would ask that you do, for an MD, is:
  • Note the card/chipset
  • Note whether 810 or 1004
  • Attempt a normal MD creation
  • Note successful or failure (either failed to setup x or avwizard boots)
  • ssh into the MD (ssh moonXX  where XX is the moon number)
  • Note whether there is or is not a /etc/X11/xorg.conf file
  • If there is a file /etc/X11/pluto.xorg.conf.avwizard, AND you failed to setup X, please edit the file and change the driver from "fglxr" to "radeon" and reboot
  • Note if this behaves as expected

For a core install:
  • Note the card/chipset
  • Note whether 810 or 1004
  • After OS install, but before LMCE install scripts, copy the /etc/X11/xorg.conf file
  • Note successful or failure (either failed to setup x or avwizard boots)
  • Check existence of /etc/X11/xorg.conf file
  • If x fails AND If  /etc/X11/xorg.conf does not exist, copy saved file back and reboot
  • Note if this behaves as expected

Thanks to any who help.

Pages: 1 [2] 3 4