ALSA Driver WP8548

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

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_le_voicecall.html

regards,
Ashish

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, Yuriysw_problem_binding.pdf (81.0 KB)

Hi,

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

U need to start the voicecallservice

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

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

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

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

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 (78.3 KB)

Uploading…

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