# ALSA Driver WP8548

**URL:** <https://mangoh.discourse.group/t/alsa-driver-wp8548/305>\
**Category:** mangOH Green\
**Created:** [November 29, 2016, 10:24am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305 "2016-11-29T10:24:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![zorby](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zorby](https://mangoh.discourse.group/u/zorby)\
**Post date:** [November 29, 2016, 10:24am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/1 "2016-11-29T10:24:57Z")

</div>

Hello,  
we develop a voice recognition software.  
What are the right arguments for “aplay” and “arecord” on the WP8548 module?  
Thank you

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [November 30, 2016, 9:51pm UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/2 "2016-11-30T21:51:21Z")

</div>

Hi Zorby,

We provide voice and audio apis on legato. Could you look at:  
[http://legato.io/legato-docs/latest/c\_audio.html](http://legato.io/legato-docs/latest/c_audio.html)  
[http://legato.io/legato-docs/latest/c\_le\_voicecall.html](http://legato.io/legato-docs/latest/c_le_voicecall.html)

regards,  
Ashish

---

<div class="post-metadata">

**Author:** ![zorby](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zorby](https://mangoh.discourse.group/u/zorby)\
**Post date:** [December 2, 2016, 8:10am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/3 "2016-12-02T08:10:43Z")

</div>

Hi Ashish,  
thank you for your answer and support.When I try to use the framework I have a binding problem. I added you a source from my .adef file and error warning from .ide.  
Best regards, Yuriy[sw\_problem\_binding.pdf](https://mangoh.discourse.group/uploads/short-url/lT1T1k8OrQprL2JhVHoDrnqmyZJ.pdf) (81.0 KB)

---

<div class="post-metadata">

**Author:** ![daav](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/daav/32/79_2.png) [@daav](https://mangoh.discourse.group/u/daav)\
**Post date:** [December 2, 2016, 9:10am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/4 "2016-12-02T09:10:31Z")

</div>

Hi,

Your bindings are looking OK. Maybe the audioService app is not started on your device for any reason?

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [December 2, 2016, 3:31pm UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/5 "2016-12-02T15:31:24Z")

</div>

U need to start the voicecallservice

---

<div class="post-metadata">

**Author:** ![zorby](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zorby](https://mangoh.discourse.group/u/zorby)\
**Post date:** [December 8, 2016, 8:27am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/6 "2016-12-08T08:27:49Z")

</div>

Hello, you where absolutely right, There was a problem with the audioDaemon. I made a recovery system and now I can reproduce a file.  
I still can’t record , the error from legato console you can see below

## Jan 6 00:46:20 | Legato | audio\_test[4181]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToI2s() 1263 | Open I2s: FeInRef.0x10000011 FeOutRef.0x1000000f Jan 6 00:46:20 | Legato | audio\_test[4181]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToI2s() 1275 | Open I2s: FeInRef.0x10000011 FeOutRef.0x1000000f Jan 6 00:46:20 | Legato | audio\_test[4181]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToFileLocalRec() 783 | Open file /var/audio/ex1.wav with AudioFileFd.11 Jan 6 00:46:20 | Legato | audioDaemon[475]/le\_pa\_audio T=main | pa\_audio.c SetMixerParameter() 700 | Cannot get mixer controler Jan 6 00:46:20 | Legato | audioDaemon[475]/le\_pa\_audio T=main | pa\_audio.c pa\_audio\_SetDspAudioPath() 3125 | IfaceInUse is now 255 Jan 6 00:46:20 | Legato | audio\_test[4181]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToFileLocalRec() 801 | Recorder is now connected. Jan 6 00:46:20 | Legato | audioDaemon[475]/audio T=main | le\_media.c SetWavHeader() 391 | Wav header set with 1 ch, 8000 Hz, 16 bit, PCM Jan 6 00:46:20 | Legato | =ERR= | audioDaemon[475] | buffer\_bytes = (5120,5120) omin=0 omax=0 int=1 empty=0 Jan 6 00:46:20 | Legato | =ERR= | audioDaemon[475] | period\_bytes = (320,320) omin=0 omax=0 int=1 empty=0 Jan 6 00:46:20 | kernel | [1662.267693] MDM9615 Media2: ASoC: no backend DAIs enabled for MDM9615 Media2 Jan 6 00:46:20 | Legato | =ERR= | audioDaemon[475] | cannot prepare channel: errno =-22 Jan 6 00:46:20 | Legato | audioDaemon[475]/alsa\_intf T=AudioCapture-0x10000013 | pa\_pcm\_alsa.c InitPcmPlaybackCapture() 368 | Failed in pcm\_prepare Jan 6 00:46:20 | Legato | audioDaemon[475]/audio T=AudioCapture-0x10000013 | le\_media.c CaptureThread() 1352 | PCM cannot be open Jan 6 00:46:20 | Legato | audio\_test[4181]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToFileLocalRec() 813 | Failed to record the file

Play file  
Jan 6 01:14:28 | Legato | audio\_test[1059]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToFileLocalPlay() 716 | Open file /var/audio/ex1.wav with AudioFileFd.11  
Jan 6 01:14:28 | Legato | audioDaemon[476]/swiQmi T=main | swiQmi.c swiQmi\_CheckResponse() 768 | Sending QMI\_SWI\_M2M\_AUDIO\_GET\_AVMMUTE\_REQ\_V01 failed: rc=0 (), resp.result=1.[0x01], resp.error=8.[0x08]  
Jan 6 01:14:28 | Legato | audioDaemon[476]/le\_pa\_audio T=main | pa\_audio.c pa\_audio\_Mute() 3309 | Cannot get mmute status for 10 interface  
Jan 6 01:14:28 | Legato | audioDaemon[476]/swiQmi T=main | swiQmi.c swiQmi\_CheckResponse() 768 | Sending QMI\_SWI\_M2M\_AUDIO\_SET\_AVMMUTE\_REQ\_V01 failed: rc=0 (), resp.result=1.[0x01], resp.error=8.[0x08]  
Jan 6 01:14:28 | Legato | audioDaemon[476]/le\_pa\_audio T=main | pa\_audio.c pa\_audio\_Mute() 3350 | Cannot unmute audio for 10 interface  
Jan 6 01:14:28 | Legato | audioDaemon[476]/audio T=main | le\_audio.c le\_audio\_Unmute() 1752 | Cannot unmute the interface  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | capability: volume  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | dBscale-  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | min=  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | -72.00dB  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | step=  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | 0.37dB  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | max=  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | 2.55dB  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | mute=1  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | min = ffffe3e0 max = ff  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | val = c0  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | Value =  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | 1.92dB  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] |  
Jan 6 01:14:28 | Legato | audioDaemon[476]/le\_pa\_audio T=main | pa\_audio.c pa\_audio\_SetDspAudioPath() 3125 | IfaceInUse is now 255  
Jan 6 01:14:28 | Legato | audio\_test[1059]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToFileLocalPlay() 747 | FilePlayback is now connected.  
Jan 6 01:14:28 | kernel | [117.787089] mdm9615\_ar7\_enable\_codec\_ext\_clk: enable = 1  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | buffer\_bytes = (16384,16384) omin=0 omax=0 int=1 empty=0  
Jan 6 01:14:28 | Legato | =ERR= | audioDaemon[476] | period\_bytes = (2048,2048) omin=0 omax=0 int=1 empty=0  
Jan 6 01:14:28 | Legato | audioDaemon[476]/audio T=Playback-0x10000011 | le\_media.c PlaybackThread() 1554 | Play timer = 11609 usec  
Jan 6 01:14:28 | Legato | audio\_test[1059]/audio\_testComponent T=main | aud\_usr.c ConnectAudioToFileLocalPlay() 757 | File is now playing  
Jan 6 01:14:34 | Legato | audioDaemon[476]/audio T=Playback-0x10000011 | le\_media.c PlaybackThreadTimer() 1475 | No more samples to read!  
Jan 6 01:14:34 | kernel | [123.561818] mdm9615\_ar7\_enable\_codec\_ext\_clk: enable = 0  
Jan 6 01:14:46 | Legato | supervisor[425]/supervisor T=main | proc.c proc\_SigChildHandler() 1833 | Process ‘gdbserver’ (PID: 1058) has exited with exit code 0.  
Jan 6 01:14:46 | Legato | supervisor[425]/supervisor T=main | apps.c DeactivateAppContainer() 252 | Application ‘audio\_test’ has stopped.  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | capability: volume  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | dBscale-  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | min=  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | -72.00dB  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | step=  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | 0.37dB  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | max=  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | 2.55dB  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | mute=1  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | min = ffffe3e0 max = ff  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | val = 0  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | Value =  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] | 0.00dB  
Jan 6 01:14:46 | Legato | =ERR= | audioDaemon[476] |

Thank you in advance.  
Best regards Yuriy

---

<div class="post-metadata">

**Author:** ![tpensel](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/tpensel/32/128_2.png) [@tpensel](https://mangoh.discourse.group/u/tpensel)\
**Post date:** [December 9, 2016, 2:30pm UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/7 "2016-12-09T14:30:48Z")

</div>

Hi,  
In order to help the investigation, could you answer to the following questions:  
What is the legato version?  
Which audio interfaces you use?  
What is the legato API call flow for both recording and playback use cases?

Thank you  
Kr,  
Tristan

---

<div class="post-metadata">

**Author:** ![zorby](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zorby](https://mangoh.discourse.group/u/zorby)\
**Post date:** [December 11, 2016, 9:52pm UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/8 "2016-12-11T21:52:16Z")

</div>

Hi,  
I use the legato version:  
WP8548 Firmware: SWI9X15Y\_07.11.11.00 r33161 CARMD-EV-FRMWR1 2016/09/20 16:36:44  
Legato version : 16.07.0\_cd4985660a55cc9a6f9a2ed28bcc757e\_modified

I use a MangOH Board for the development with a WP8548 module which is connected through PCM to the audio codec.

I tried to reproduce the code which is given in the Legato documentation.  
To play audio I call  
ConnectAudioToCodec();  
ConnectAudioToFileLocalPlay().

To record I use  
ConnectAudioToCodec();  
ConnectAudioToFileLocalRec().

I you need, I can send you the code of my project.  
Is there a possibility to use Audio without legato framework?

Thank you in advance. Best regards, Yuriy

---

<div class="post-metadata">

**Author:** ![tpensel](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/tpensel/32/128_2.png) [@tpensel](https://mangoh.discourse.group/u/tpensel)\
**Post date:** [December 12, 2016, 10:38am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/9 "2016-12-12T10:38:37Z")

</div>

Hi Yuriy,  
Could you please send me the code of your project?  
BTW, we’ve got a limitation on recording: you can’t record audio coming from external codec.

You can use audio without Legato, but we don’t support this use case.

Kr,  
Tristan

---

<div class="post-metadata">

**Author:** ![zorby](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zorby](https://mangoh.discourse.group/u/zorby)\
**Post date:** [December 13, 2016, 8:35am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/10 "2016-12-13T08:35:50Z")

</div>

Hi Kr,  
I added the devstudio project which I work with. As I said before I use a MangOH Board.  
In audio\_test.c I built a state machine which controls the programme.  
I read input from GPIO Expander#2(U906) to trigger the statemachine and start playing the files.  
In aud\_usr.c are functions to set, play and record audio files.

If I understood you correctly WP8548 has a problem with recording audio through the codec.  
Is this a problem with the driver for Audio codec or PCM in?

We plan to connect the microphone directly with the PCM in. Will this work?  
Thank you for your help. Best regards, Yuriy  
[audio\_test.zip](https://mangoh.discourse.group/uploads/short-url/39Ha7UFbxu0VjzK42kEFWSk88S4.zip) (78.3 KB)

Uploading…

---

<div class="post-metadata">

**Author:** ![tpensel](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/tpensel/32/128_2.png) [@tpensel](https://mangoh.discourse.group/u/tpensel)\
**Post date:** [March 21, 2017, 9:47am UTC](https://mangoh.discourse.group/t/alsa-driver-wp8548/305/11 "2017-03-21T09:47:27Z")

</div>

Hi Yuriy,  
The problem only regards the codec, and it regards the local recording use case. The fix is ready and will be available in the next legato release.

You can’t connect directly the mic with the PCM in. PCM is a digital interface, while the mic is analogical. You need a codec in between. You can put your own codec, but the codec’s configuration and routing will become your duty.

Kind regards,  
Tristan
