Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor I
1,928 Views

ALSA programming in edison

Jump to solution

Hello,

I am trying to do alsa programming in edison. I am trying to run this example which appears to handle two channel data (left channel and right channel audio).

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2latency_8c-example.html http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2latency_8c-example.html

but I get an error saying

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Arduino: 1.6.5 (Windows 8), Board: "Intel® Edison"

test_mraa_on_eidisson.ino.ino:15:34: fatal error: ../include/asoundlib.h: No such file or directory

compilation terminated.

Error compiling.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

So how can I do alsa programming in edison?


Accepted Solutions
Highlighted
Employee
43 Views

Hi,

Where are you putting this code, directly in the Arduino IDE? The error you get is because there are libraries missing so you can't compile the code. I'd suggest using C from the Linux terminal and try to compile from there. How are you compiling the code, directly from the IDE? If you see the same error look if you have the library included, if not, you can look for it and include it.

Take a look at these links, they contain useful information

https://trac.ffmpeg.org/wiki/Capture/ALSA https://trac.ffmpeg.org/wiki/Capture/ALSA

http://www.tldp.org/HOWTO/Alsa-sound-3.html Alsa-sound-mini-HOWTO: Before you start

http://alsa.opensrc.org/Quick_Install alsa.opensrc.org

Let me know your results.

 

Sergio

View solution in original post

0 Kudos
11 Replies
Highlighted
Employee
44 Views

Hi,

Where are you putting this code, directly in the Arduino IDE? The error you get is because there are libraries missing so you can't compile the code. I'd suggest using C from the Linux terminal and try to compile from there. How are you compiling the code, directly from the IDE? If you see the same error look if you have the library included, if not, you can look for it and include it.

Take a look at these links, they contain useful information

https://trac.ffmpeg.org/wiki/Capture/ALSA https://trac.ffmpeg.org/wiki/Capture/ALSA

http://www.tldp.org/HOWTO/Alsa-sound-3.html Alsa-sound-mini-HOWTO: Before you start

http://alsa.opensrc.org/Quick_Install alsa.opensrc.org

Let me know your results.

 

Sergio

View solution in original post

0 Kudos
Highlighted
Valued Contributor I
43 Views

Solved.

Highlighted
Valued Contributor I
43 Views

Hello Segey,

I am using the W8731 as mentioned in this page of yours:

http://www.malinov.com/Home/sergey-s-blog/inteledisonandopenmusiclabsaudiocodecshield http://www.malinov.com/Home/sergey-s-blog/inteledisonandopenmusiclabsaudiocodecshield

But when I give i2cset I get this error

codecset.sh: 105: codecset.sh: i2cset: not found

codecset.sh: 108: codecset.sh: i2cset: not found

codecset.sh: 111: codecset.sh: i2cset: not found

codecset.sh: 114: codecset.sh: i2cset: not found

codecset.sh: 117: codecset.sh: i2cset: not found

codecset.sh: 123: codecset.sh: i2cset: not found

codecset.sh: 127: codecset.sh: i2cset: not found

codecset.sh: 130: codecset.sh: i2cset: not found

How shall I solve this error.

0 Kudos
Highlighted
Valued Contributor I
43 Views

Solved. I2c-tools were supposed to be installed but how shall I configure the name of the codec and how shall I use it?

Sergey's page says this but I do not understand what software documentation he is referring to

*********************************************************Using the Audio Device

The codec is connected to ALSA device hw:1,0 . Refer to the software documentation on configuring the device name. For example in mpg123 player the audio device can be specified using -a switch:

mpg123 -a hw:1,0 -v "Dave Brubeck - Take Five.mp3"

************************************************************************

0 Kudos
Highlighted
Valued Contributor I
43 Views

I did everything and did i2cset for the code shield but when I type "aplay -l" I think the device is not getting listed.Here is the output of 'aplay -l'

***************************************

root@ubilinux:/home/edison/mraa/examples# sh codecset.sh

root@ubilinux:/home/edison/mraa/examples# aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]

Subdevices: 8/8

Subdevice # 0: subdevice # 0

Subdevice # 1: subdevice # 1

Subdevice # 2: subdevice # 2

Subdevice # 3: subdevice # 3

Subdevice # 4: subdevice # 4

Subdevice # 5: subdevice # 5

Subdevice # 6: subdevice # 6

Subdevice # 7: subdevice # 7

card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]

Subdevices: 8/8

Subdevice # 0: subdevice # 0

Subdevice # 1: subdevice # 1

Subdevice # 2: subdevice # 2

Subdevice # 3: subdevice # 3

Subdevice # 4: subdevice # 4

Subdevice # 5: subdevice # 5

Subdevice # 6: subdevice # 6

Subdevice # 7: subdevice # 7

************************************************

What shall I do? Could you please post the output of aplay -l sergey.

0 Kudos
Highlighted
Valued Contributor I
43 Views

I get a write error saying "Write failed" when I try to configure the codec shield and some times I get resource busy error. What shall I do?

0 Kudos
Highlighted
Employee
43 Views

Hi,

What image are you using, the standard Yocto image or the IoT image?

Sergio

0 Kudos
Highlighted
Valued Contributor I
43 Views

I am using Ubilinux. Should I roll back to yocto?

0 Kudos
Highlighted
Employee
43 Views

Hi,

The supported image is the Yocto image. If you need support using the Ubilinux image you can contact http://www.emutexlabs.com/forum/index EmutexLabs . They will provide a more accurate response.

Sergio

0 Kudos
Highlighted
Valued Contributor I
43 Views

I did a roll back to Yocto. Now when in Ubilinux I did this

apt-get install alsa-base libasound2 libasound2-dev alsa-tools alsa-utils

but not when I say

opkg install alsa-base libasound2 libasound2-dev alsa-tools alsa-utils

It says cannot install package alsa-base

0 Kudos
Highlighted
Employee
43 Views

Hi,

There is no package in AlexT's repo called alsa-base. Take a look at the alsa packages available in http://repo.opkg.net/edison/repo/ Index of /edison/repo .

Sergio

0 Kudos