7 Replies Latest reply on Jul 19, 2016 6:45 PM by xbolshe

    install MRAA

    julian403

      Hello, I have an intel galileo gen 1 with  a debian SO because I needed SDL library.  How can I install MRAA API? I need mraa to use the pinout.

       

      Thanks.

        • 1. Re: install MRAA
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello julian403,

          If you are not using Yocto, you should build MRAA by following the instructions found in http://iotdk.intel.com/docs/master/mraa/building.html. If you were using Yocto it would be a lot simpler, you could simply set up the repo and download the packages as I explain in https://communities.intel.com/message/393752#393752.

          -Peter.

          1 of 1 people found this helpful
          • 2. Re: install MRAA
            xbolshe

            Hi,

             

            also need to note that a debian image must have Kernel drivers for Galileo Gen1 board to control pins.

            Kernel drivers are required for MRAA.

             

            BR,

            xbolshe

            1 of 1 people found this helpful
            • 3. Re: install MRAA
              julian403

              Well, I'm going to use Yocto but the problem with it is that I can't use SDL API. Because I need to use Sound Card's ADC and I have problem with Alsa. For example, in Intel System Studio Iot I wrote:

               

               

              [code]

              #include "mraa.hpp"

               

              #include <iostream>

              #include <unistd.h>

              #include <stdio.h>

              #include <stdlib.h>

              #include </usr/include/alsa/asoundlib.h>

               

              #define PCM_DEVICE "default"

               

              int main()

              {

                int rc;

                 snd_pcm_t *handle;

                 snd_pcm_hw_params_t *params;

                 unsigned int val, val2;

                 int dir;

                 snd_pcm_uframes_t frames;

               

               

                 /* Open PCM device for playback. */

                 rc = snd_pcm_open(&handle, "default",

                                   SND_PCM_STREAM_PLAYBACK, 0);

              [/code]

               

              if you see, I included asoundlib.h correctly because I have not problem with the sentences:

               

              [code]

              snd_pcm_t *handle;

              snd_pcm_hw_params_t *params;

              snd_pcm_uframes_t frames;

              [/code]

               

              But the ide give me the next message to the sentence:

               

              [code]

              snd_pcm_open(&handle, "default",

                                   SND_PCM_STREAM_PLAYBACK, 0);

              [/code]

               

              where Eclipse trhows: undefined reference to snd_pcm_open();

               

              I went in Galileo with ssh, and I checks /usr/include/alsa an is all .h necesary and it's included in asoundlib.h as you can see in asounlib.h

               

              Captura de pantalla de 2016-07-15 14-50-06.png

               

              then I go to pcm.h And there is defined snd_pcm_open()

               

              Captura de pantalla de 2016-07-15 15-04-55.png

               

              Why can I do? Can I install SDL in Yocto? How?

               

              I sent this question to jessica.gomez.hernandez@intel.com and she sent this information to Brendan (that's what she said, sayin he is the mraa expert)

              • 4. Re: install MRAA
                xbolshe

                Hi,

                 

                It seems that your problem does not related with MRAA.

                 

                Have you tried to change this line

                 

                #include </usr/include/alsa/asoundlib.h>
                

                 

                like shown below?

                 

                #include <alsa/asoundlib.h>
                

                 

                What is Eclipse message in this case?

                 

                BR,

                xbolshe

                • 5. Re: install MRAA
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  I agree with @xbolshe and you can also try to install SDL from source from https://www.libsdl.org/download-2.0.php. You can see their documentation in http://wiki.libsdl.org/FrontPage including how to install it (http://wiki.libsdl.org/Installation).
                   
                  And in case you have issues installing this package you can contact them in http://forums.libsdl.org/.
                   
                  -Peter.

                  • 6. Re: install MRAA
                    julian403

                    I did the change to [code]#include <alsa/asoundlib.h> [/code] but it still don't work.

                     

                    [quote]What is Eclipse message in this case?[/quote]

                     

                    undefined reference to snd_pcm_open()

                     

                    That's the eclipse message but as I said, the library is correctly included because there is not problem with the definition of [code]snd_pcm_t *handle[/code] and snd_pcm_t is a variable types defined in asoundlib.h

                    • 7. Re: install MRAA
                      xbolshe

                      julian403

                      Have you added the SDL library in linker options?

                      Eclipse Community Forums: C / C++ IDE (CDT) » How do I include easily new libraries

                       

                      It may be a problem with libSDL, so you may try to add libasound.

                       

                       

                      BTW, intel_corp

                      "i586-poky-linux" has no libSDL

                      "quark-wrs-linux" has libSDL

                       

                      It is strange. I use "iss-iot-win_03-24-16.7z".

                       

                      BR,

                      xbolshe

                      1 of 1 people found this helpful