<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.rivendellaudio.org/index.php?action=history&amp;feed=atom&amp;title=Debian_6_GPIO_MC_PCIDIO24</id>
		<title>Debian 6 GPIO MC PCIDIO24 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.rivendellaudio.org/index.php?action=history&amp;feed=atom&amp;title=Debian_6_GPIO_MC_PCIDIO24"/>
		<link rel="alternate" type="text/html" href="http://wiki.rivendellaudio.org/index.php?title=Debian_6_GPIO_MC_PCIDIO24&amp;action=history"/>
		<updated>2026-05-01T21:15:19Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>http://wiki.rivendellaudio.org/index.php?title=Debian_6_GPIO_MC_PCIDIO24&amp;diff=284&amp;oldid=prev</id>
		<title>Higgles: Created page with &quot;'''Guide Contents''' # Index # Debian 6 Minimal Gnome Install # Debian 6 Installing Pulse Audio|Installing Pulse...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.rivendellaudio.org/index.php?title=Debian_6_GPIO_MC_PCIDIO24&amp;diff=284&amp;oldid=prev"/>
				<updated>2018-03-13T15:47:37Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Guide Contents&amp;#039;&amp;#039;&amp;#039; # &lt;a href=&quot;/index.php?title=Rivendell_on_Debian_6&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Rivendell on Debian 6 (page does not exist)&quot;&gt;Index&lt;/a&gt; # &lt;a href=&quot;/index.php?title=Debian_6_Minimal_Gnome_Install&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Debian 6 Minimal Gnome Install (page does not exist)&quot;&gt;Debian 6 Minimal Gnome Install&lt;/a&gt; # Debian 6 Installing Pulse Audio|Installing Pulse...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Guide Contents'''&lt;br /&gt;
# [[Rivendell on Debian 6|Index]]&lt;br /&gt;
# [[Debian 6 Minimal Gnome Install|Debian 6 Minimal Gnome Install]]&lt;br /&gt;
# [[Debian 6 Installing Pulse Audio|Installing Pulse Audio]]&lt;br /&gt;
# [[Debian 6 Installing JACK2|Installing JACK2]]&lt;br /&gt;
# [[Debian 6 Setup JACK2 with Pulse Audio|Setup JACK2 with Pulse Audio]]&lt;br /&gt;
# [[Debian 6 Install Rivendell 2.1.1 from Source|Install Rivendell 2.1.1 from Source]]&lt;br /&gt;
# [[Debian 6 Configure Rivendell 2.1.1 with JACK|Getting Rivendell, JACK2 and Pulse Audio working together]]&lt;br /&gt;
# [[Debian 6 Connecting to JACK via Rivendell Macros|Connecting to JACK via Rivendell Macros]]&lt;br /&gt;
# [[Debian 6 Connecting to JACK via JACK Patch Bay|Connecting to JACK via JACK Patch Bay]]&lt;br /&gt;
# [[Debian 6 GPIO MC PCIDIO24|Configuring GPIO with Rivendell]]&lt;br /&gt;
# [[Debian 6 Summary Install Process|Summary Install Process]]&lt;br /&gt;
# [[Debian 6 Links to scripts and other files used|Links to scripts and other files used]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So you've followed the guide and all is well but you'd like to have some Fader activated play back (or any other combination of GPIO support).  As usual if you're working with JACK as set up in this guide, it does introduce one major problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GPIO can't be accessed unless you run the Rivendell daemons as the root user.  You can make JACK run as root but then you have all sorts of other problems as every program needs to be run as root in order to access JACK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So this guide will do the basics of installing the Rivendell GPIO driver for the Measurement Computing PCI-DIO24 Card.  Unless you are handy with C++ I don't recommend trying to get other cards to work with Rivendell as you'll need to write a custom driver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing the GPIO pre-reqs:'''&lt;br /&gt;
----&lt;br /&gt;
 sudo apt-get install build-essential linux-headers-`uname -r`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you've followed the guide, you will already have build-essential so all you'll be installing are the kernel headers for your current kernel (substituted by uname -r).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once thats complete you'll need to download the GPIO source from the Rivendell website (for the sake of the guide I'll assume you've downloaded it to your home directory):&lt;br /&gt;
----&lt;br /&gt;
 wget http://www.rivendellaudio.org/ftpdocs/gpio/gpio-1.1.0.tar.gz&lt;br /&gt;
&lt;br /&gt;
Untar it:&lt;br /&gt;
----&lt;br /&gt;
 tar -zxvf gpio-1.1.0.tar.gz&lt;br /&gt;
&lt;br /&gt;
[[File:D6-GPIO-configure-result.png|200px|thumb|right|GPIO Configure result]]Go into the unzipped directory and run configure:&lt;br /&gt;
----&lt;br /&gt;
 cd ~/gpio-1.1.0.tar.gz&lt;br /&gt;
 ./configure --prefix=/usr&lt;br /&gt;
&lt;br /&gt;
[[File:D6-GPIO-make-result.png|200px|thumb|right|GPIO make result]]After that finishes (which shouldn't take very long) compile the source:&lt;br /&gt;
----&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
Before installing, the make install script expects the following directory to be available: /lib/modules/`uname-r`/extra.  If you don't make this directory the make install step will fail complaining that the directory doesn't exist so lets make that now:&lt;br /&gt;
----&lt;br /&gt;
 sudo mkdir /lib/modules/`uname -r`/extra&lt;br /&gt;
&lt;br /&gt;
[[File:D6-GPIO-make-install-result.png|200px|thumb|right|GPIO make install result]]Now run the install:&lt;br /&gt;
----&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
With everything in place, we need to update the module database so that the kernel recognises the new gpio driver module:&lt;br /&gt;
----&lt;br /&gt;
 sudo depmod -a&lt;br /&gt;
&lt;br /&gt;
Finally we can manually activate the gpio module for testing (in theory a reboot should also detect this on start up and load the module automatically):&lt;br /&gt;
----&lt;br /&gt;
 sudo /sbin/modprobe gpio&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With that done you should find you have a new device under /dev/gpio0.  If this isn't there check your dmesg and other system logs to try and hunt for clues to why theres an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that Under Ubuntu 10.04 I had an error here that said the resource was busy and could not be added.  I believe this is some sort of conflict with the comedi libraries supplied with Ubuntu.  I could never figure out how to stop this happening and was a large part of the reason why I switched to Debian.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Time for some testing:'''&lt;br /&gt;
----&lt;br /&gt;
 sudo gpitest&lt;br /&gt;
&lt;br /&gt;
[[File:D6-gpitest.png|200px|thumb|right|gpitest GUI]]This will bring up a simple dialog that shows you the status of the inputs on the GPIO card.  If you can attach wires to the relevant pins and see inputs then everything is fine.  All we need to do now is amend the permissions and we're done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NB:''' The Measurement Computing PCI-DIO24 card has several modes of operation.  You can usually specify how you want this configured at the point of sale however being in the UK I wasn't given this option so I just received a board without any of the extra options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, you don't have any pull down resistors soldered to the board which means you'll have lots of spurious IO signals lighting up.  You can solve this by either purchasing SIPs for the board or making your own mini circuits ([[Measurement_Computing_PCI_DIO24|More info including circuit diagrams...]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Correcting the permissions'''&lt;br /&gt;
&lt;br /&gt;
As previously mentioned when using JACK the Rivendell daemons run as the local user.  Unfortunately by default /dev/gpio0 is owned and accessed only by root.  So we need to change the permissions so that other users can access the device, all we have to do is run:&lt;br /&gt;
----&lt;br /&gt;
 sudo chmod a+rw /dev/gpio0&lt;br /&gt;
&lt;br /&gt;
Unfortunately this gets reset upon a reboot so we'll need to append some changes to /etc/rc.local so that these permissions get applied at boot up.&lt;br /&gt;
----&lt;br /&gt;
 sudo vi /etc/rc.local&lt;br /&gt;
&lt;br /&gt;
Inside this file add the following before the exit 0 line:&lt;br /&gt;
----&lt;br /&gt;
 #Rivendell GPIO needs a+rw permissions&lt;br /&gt;
 #Test for the existence of /dev/gpio0&lt;br /&gt;
 logger Rivendell GPIO: Amending gpio0 permissions&lt;br /&gt;
 if [ -e &amp;quot;/dev/gpio0&amp;quot; ]&lt;br /&gt;
 then&lt;br /&gt;
   chmod a+rw /dev/gpio0&lt;br /&gt;
   logger Rivendell GPIO: Permissions changed on /dev/gpio0 to a+rw&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Its a good idea to invoke rc.local now to check for typos:&lt;br /&gt;
----&lt;br /&gt;
 sudo /etc/rc.local&lt;br /&gt;
&lt;br /&gt;
If you get no errors run&lt;br /&gt;
----&lt;br /&gt;
 sudo tail /var/log/messages&lt;br /&gt;
&lt;br /&gt;
You should see the two logger lines in the system logs at which point all you need to do is restart the Rivendell services (or reboot) and you're done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:D6-add-switcher.png|200px|thumb|right|Add Switcher GUI]]'''Adding this GPIO card to Rivendell'''&lt;br /&gt;
&lt;br /&gt;
Great so you now have a working card and you can see things happening in gpitest and/or gpotest (if you want outputs).&lt;br /&gt;
We still have to add this to the host in Rivendell so lets do that.  Open up rdadmin --&amp;gt; Manage Hosts and edit the host with the GPIO card.  Click on Switchers GPIO.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:D6-edit-switcher.png|200px|thumb|right|Edit Switcher GUI]]In this new blank box click on Add and set the Switcher Type to Local GPIO.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:D6-list-gpis.png|200px|thumb|right|List GPIO Macros GUI]]Put in a meaningful description and then double check that the device is listed as /dev/gpio0.  From here its up to you to decide how many inputs (GPIS) and outputs (GPOs) you want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that on most GPIO cards I've come across you have GPIO blocks that are grouped.  The MC PCI-DIO24 card is no different as there are 3 sets of 8 GPIO pins (marked A, B and C).  You may find that on some cards you have to have entire blocks as either input or output.  I'm not sure if this card also works this way but its something to remember if you have issues trying to get 3 GPOs and 21 GPIs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this decided, click on Configure GPIs and assign macro carts to the inputs so that Riv will actually do something.  Repeat for the GPOs and you've successfully setup GPIO under Rivendell in Debian 6.&lt;br /&gt;
&lt;br /&gt;
For testing of the GPIs I simply made a whole bunch of macro carts that changed the rdairplay label.  E.g. LB GPIO1! all the way to LB GPIO24!.  That way I could see things happening in airplay to confirm everything was moving along nicely.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Security Considerations'''&lt;br /&gt;
&lt;br /&gt;
Opening up gpio0 to all users might not be a good idea.  Consider changing the group of the device to Rivendell and adding just the group permissions of rw to the device.  That way you're not opening things up to other users that might not be authenticated.&lt;/div&gt;</summary>
		<author><name>Higgles</name></author>	</entry>

	</feed>