Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
1,234 Views

GPIO pinmode 1 in mraa code?

Jump to solution

Hi , I would like to set in C/C++ MRAA gpio pins 40,41,42,43 to pinmode1 for I2S on intel edison.

MRAA37 GPIO 40 J19-10 SSP2_CLK

MRAA51 GPIO 41 J20-10 SSP2_FS

 

MRAA50 GPIO 42 J20-9 SSP2_RXD

MRAA38 GPIO 43 J19-11 SSP2_TXD

 

how do I set these pins to pinmode1 ?

PIN_FAST_GPIO ? This intel edison table on this page says I need to set GPIO to pinmode1

https://iotdk.intel.com/docs/mraa/v0.9.6/edison.html mraa: Intel Edison

I'm sure I'm overlooking something very obvious here !

0 Kudos
1 Solution
idata
Community Manager
71 Views

Hello bennnn,

 

 

Thanks for reaching out!

 

 

As you can see in https://iotdk.intel.com/docs/master/mraa/, the functionalities of mraa are limited to GPIO, I2C, AIO, PWM, SPI and UART, therefore, Edison's I2S capabilities are not accessible through this library.

 

 

If you'd like to use this interface, I'd suggest you to read Edison's Audio Setup Guide which can be found in http://www.intel.com/content/www/us/en/support/boards-and-kits/000005983.html.

 

 

I hope this helps.

 

-Peter.

View solution in original post

5 Replies
idata
Community Manager
72 Views

Hello bennnn,

 

 

Thanks for reaching out!

 

 

As you can see in https://iotdk.intel.com/docs/master/mraa/, the functionalities of mraa are limited to GPIO, I2C, AIO, PWM, SPI and UART, therefore, Edison's I2S capabilities are not accessible through this library.

 

 

If you'd like to use this interface, I'd suggest you to read Edison's Audio Setup Guide which can be found in http://www.intel.com/content/www/us/en/support/boards-and-kits/000005983.html.

 

 

I hope this helps.

 

-Peter.

View solution in original post

idata
Community Manager
71 Views

Hi Peter, makes sence mraa does'nt support the SSP on the SOC when I think about it !

Is the ALSA dummy DPCM machine driver set to IO I2S audio on SSP2 by default ?

The edison audio guide says I should look at to impliment a dummy machine driver, do I need a machine driver if I just want to

IO i2S ? or maybe I should edit merr_dpcm_dummy.c to achieve this ?

I get;

root@edison:~# cd /linux/sound/soc/intel/board/

-sh: cd: /linux/sound/soc/intel/board/: No such file or directory

I can control my DSP device with I2C and I can have SD I2S or TDM IO from my DSP in slave mode, so the SSP2 port should work as is with arecord and aplay ?

how do I setup the I2S or change to PCM so I can IO TDM etc ?

if I run pactl list I get this list , is the dummy driver here?

root@edison:~# pactl list

Module # 0

Name: module-udev-detect

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "Detect available audio hardware and load matching drivers"

module.version = "6.0"

Module # 2

Name: module-alsa-card

Argument: device_id="0" name="0" card_name="alsa_card.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"

Usage counter: 0

Properties:

module.author = "Lennart Poettering"

module.description = "ALSA Card"

module.version = "6.0"

Module # 3

Name: module-native-protocol-unix

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "Native protocol (UNIX sockets)"

module.version = "6.0"

Module # 4

Name: module-bluetooth-policy

Argument:

Usage counter: n/a

Properties:

module.author = "Frédéric Dalleau"

module.description = "When a bluetooth sink or source is added, load module-loopback"

module.version = "6.0"

Module # 5

Name: module-bluez5-discover

Argument:

Usage counter: n/a

Properties:

module.author = "João Paulo Rechi Vita"

module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"

module.version = "6.0"

Module # 6

Name: module-stream-restore

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "Automatically restore the volume/mute/device state of streams"

module.version = "6.0"

Module # 7

Name: module-device-restore

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "Automatically restore the volume/mute state of devices"

module.version = "6.0"

Module # 8

Name: module-default-device-restore

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "Automatically restore the default sink and source"

module.version = "6.0"

Module # 9

Name: module-rescue-streams

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "When a sink/source is removed, try to move its streams to the default sink/source"

module.version = "6.0"

Module # 10

Name: module-always-sink

Argument:

Usage counter: n/a

Properties:

module.author = "Colin Guthrie"

module.description = "Always keeps at least one sink loaded even if it's a null one"

module.version = "6.0"

Module # 11

Name: module-suspend-on-idle

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "When a sink/source is idle for too long, suspend it"

module.version = "6.0"

Module # 12

Name: module-position-event-sounds

Argument:

Usage counter: n/a

Properties:

module.author = "Lennart Poettering"

module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them."

module.version = "6.0"

Sink # 0

State: SUSPENDED

Name: alsa_output.0.analog-stereo

Description: Loopback Analog Stereo

Driver: module-alsa-card.c

Sample Specification: s16le 2ch 44100Hz

Channel Map: front-left,front-right

Owner Module: 2

Mute: no

Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB

balance 0.00

Base Volume: 65536 / 100% / 0.00 dB

Monitor Source: alsa_output.0.analog-stereo.monitor

Latency: 0 usec, configured 0 usec

Flags: HARDWARE HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY

Properties:

alsa.resolution_bits = "16"

device.api = "alsa"

device.class = "sound"

alsa.class = "generic"

alsa.subclass = "generic-mix"

alsa.name = "Loopback PCM"

alsa.id = "Loopback PCM"

alsa.subdevice = "0"

alsa.subdevice_name = "subdevice # 0"

alsa.device = "0"

alsa.card = "0"

alsa.card_name = "Loopback"

alsa.long_card_name = "Loopback 1"

device.bus_path = "/devices/virtual/sound/card0"

sysfs.path = "/devices/virtual/sound/card0"

device.string = "front:0"

device.bu...

idata
Community Manager
71 Views

Hi bennnn,

 

 

I get the same results as you. Please let me investigate about this and if I'm able to find something useful I will post it here.

 

 

-Peter.
idata
Community Manager
71 Views

Great thanks for looking into this.

I have an arduino adapter board and have the mini intel breakout board in the post so can try both.

I found that the arduino baord uses pins

arduino SSP2

PIN 10 SSP2_FS

PIN 11 SSP2_TXD

PIN 12 SSP2_RXD

PIN 13 SSP2_CLK

I will hook up my oscilloscope to the SS2 and play some audio and post results here when I get time.

I'm assuming SSP2_CLK is MCLK and SSP2_FS is BCLCK.

My DSP clock is 24.576mhz but the IO port I want to use can sync to the edison (master) in slave mode as long as its normal I2S / TDM clock derived from a multiple of sample frequency.

Look forward to getting any info regarding SSP2 will take a look at the Quark SoC x1000 data sheet also to see if there is any info.

ben

idata
Community Manager
71 Views

OK, I think I have to get the source tree located here https://downloadcenter.intel.com/download/25028/Intel-Edison-Board-Software-Package?v=t Download Intel® Edison Board Software Package

downloading now...

then I need to modify the dummy codec driver in the source located here

/linux/sound/soc/intel/board/merr_dpcm_dummy.c

I don't actually need machine control since I'm not looking to add a codec.

I only need to make changes to the SSP2 port configuration to TDM 4 slot or TDM 8 slot.

I will report back here if merr_dpcm_dummy.c makes sence to me

I have built modified kernels beore but never yokto ...

EDIT > ok I think I should start a new thread , this one started as a pinmode question and ended as a kernel building question !!

Reply