{"id":28917,"date":"2020-05-30T22:24:59","date_gmt":"2020-05-30T22:24:59","guid":{"rendered":"http:\/\/pcbjunkie.net\/?page_id=28917"},"modified":"2025-10-14T00:33:01","modified_gmt":"2025-10-14T00:33:01","slug":"pj-installing-drivers-on-a-vanilla-linux-setup","status":"publish","type":"page","link":"https:\/\/pcbjunkie.net\/index.php\/pj-installing-drivers-on-a-vanilla-linux-setup\/","title":{"rendered":"PJ &#8211; Installing Drivers on a Vanilla Linux Setup"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Overview:<\/h4>\n\n\n\n<p>There are two linux drivers provided specifically for use with PJ. A main communication driver (j4b) and a linux joystick driver (pjjoy). Both must be installed for the JAMMA controls and board monitoring to function properly. The driver j4b is the parent module for pjjoy, so when loading the driver modules, j4b must be loaded first.<\/p>\n\n\n\n<p>Compile drivers module if you are installing this on a vanilla retropie setup as they driver versioning is tied to the kernel and binary kernel driver files will not be provided for every kernel or retropie version.<\/p>\n\n\n\n<p>Make sure you have <a href=\"https:\/\/pcbjunkie.net\/files\/pj-drivers-1.1.zip\">this zip file<\/a> already uploaded to your Pi and extracted to your pi home directory (\/home\/pi).<br><br><strong>Communication module:<\/strong><\/p>\n\n\n\n<p>Compile the communication driver module.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/home\/pi\/linux-modules\/j4b<br>make clean<br>make<\/pre>\n\n\n\n<p>Your output *should* look something like this (kernel version may be different):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">make -C \/lib\/modules\/4.14.98-v7+\/build\/ M=\/home\/pi\/linux-modules\/j4b modules<br>make[1]: Entering directory '\/usr\/src\/linux-headers-4.14.98-v7+'<br>&nbsp; CC [M] &nbsp;\/home\/pi\/linux-modules\/j4b\/j4b.o<br>&nbsp; Building modules, stage 2.<br>&nbsp; MODPOST 1 modules<br>&nbsp; CC &nbsp; &nbsp; &nbsp;\/home\/pi\/linux-modules\/j4b\/j4b.mod.o<br>&nbsp; LD [M] &nbsp;\/home\/pi\/linux-modules\/j4b\/j4b.ko<br>make[1]: Leaving directory '\/usr\/src\/linux-headers-4.14.98-v7+'<\/pre>\n\n\n\n<p>Install binary driver module (kernel_version can be obtained by running uname -r):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cp j4b.ko \/lib\/modules\/&lt;kernel_version&gt;\/kernel\/drivers\/gpio\/<\/pre>\n\n\n\n<p><strong>Joystick module:<\/strong><\/p>\n\n\n\n<p>Compile the module:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/home\/pi\/linux-modules\/pjjoy<br>make clean<br>make<\/pre>\n\n\n\n<p>Typical compiler output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cp \/home\/pi\/linux-modules\/j4b\/Module.symvers \/home\/pi\/linux-modules\/pjjoy\nmake -C \/lib\/modules\/4.14.98-v7+\/build M=\/home\/pi\/linux-modules\/pjjoy modules\nmake[1]: Entering directory '\/usr\/src\/linux-headers-4.14.98-v7+'\n&nbsp; CC [M] &nbsp;\/home\/pi\/linux-modules\/pjjoy\/pjjoy.o\n&nbsp; Building modules, stage 2.\n&nbsp; MODPOST 1 modules\n&nbsp; CC &nbsp; &nbsp; &nbsp;\/home\/pi\/linux-modules\/pjjoy\/pjjoy.mod.o\n&nbsp; LD [M] &nbsp;\/home\/pi\/linux-modules\/pjjoy\/pjjoy.ko\nmake[1]: Leaving directory '\/usr\/src\/linux-headers-4.14.98-v7+'<\/pre>\n\n\n\n<p>Install driver module (kernel_version can be obtained by running uname -r):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cp pjjoy.ko \/lib\/modules\/&lt;kernel_version&gt;\/kernel\/drivers\/input\/<\/pre>\n\n\n\n<p>Backup your \/etc\/modules file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cp \/etc\/modules \/etc\/modules.bak<\/pre>\n\n\n\n<p>Add these lines to \/etc\/modules:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">j4b<br>pjjoy<\/pre>\n\n\n\n<p>Finally run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">depmod -a<br>reboot<\/pre>\n\n\n\n<p>Upon reboot, make sure your joystick driver modules are loaded&#8230; to confirm type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lsmod<\/pre>\n\n\n\n<p>You should get a listing of modules which includes &#8220;j4b&#8221; and &#8220;pjjoy&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Module &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp;Used by\ncfg80211 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;573440 &nbsp;0\nrfkill &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 28672 &nbsp;2 cfg80211\nsnd_bcm2835 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;32768 &nbsp;0\nsnd_pcm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;98304 &nbsp;1 snd_bcm2835\nsnd_timer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;32768 &nbsp;1 snd_pcm\nsnd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;69632 &nbsp;3 snd_timer,snd_bcm2835,snd_pcm\npwm_bcm2835 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;16384 &nbsp;0\nuio_pdrv_genirq &nbsp; &nbsp; &nbsp; &nbsp;16384 &nbsp;0\nuio &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20480 &nbsp;1 uio_pdrv_genirq\nfixed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;16384 &nbsp;0\nevdev &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;24576 &nbsp;4\njoydev &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20480 &nbsp;0\n<strong>pjjoy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;16384 &nbsp;0<\/strong>\n<strong>j4b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;16384 &nbsp;1 pjjoy<\/strong>\nuinput &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20480 &nbsp;0\nip_tables &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;24576 &nbsp;0\nx_tables &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32768 &nbsp;1 ip_tables\nipv6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;425984 &nbsp;28<\/pre>\n\n\n\n<p>If any issues occur loading the drivers this way, try doing in manually:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/home\/pi\/linux-modules\/j4b<br>sudo insmod j4b.ko<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/home\/pi\/linux-modules\/pjjoy<br>sudo insmod pjjoy.ko<\/pre>\n\n\n\n<p>If any issues check \/var\/log\/debug for more info, and verify that the module was loaded using lsmod.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview: There are two linux drivers provided specifically for use with PJ. A main communication driver (j4b) and a linux joystick driver (pjjoy). Both must be installed for the JAMMA controls and board monitoring to function properly. The driver j4b is the parent module for pjjoy, so when loading the driver modules, j4b must be &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/pcbjunkie.net\/index.php\/pj-installing-drivers-on-a-vanilla-linux-setup\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PJ &#8211; Installing Drivers on a Vanilla Linux Setup&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-28917","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/pages\/28917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/comments?post=28917"}],"version-history":[{"count":3,"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/pages\/28917\/revisions"}],"predecessor-version":[{"id":36528,"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/pages\/28917\/revisions\/36528"}],"wp:attachment":[{"href":"https:\/\/pcbjunkie.net\/index.php\/wp-json\/wp\/v2\/media?parent=28917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}