This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unable to find alsa jack plugin in ti sdk 8

Am using ti sdk 8, am trying to use alsa jack plugin but am facing the below errors

etc/asound.conf

pcm.!default {
    type plug
    slave { pcm "jack" }
}

pcm.jack {
    type jack
    playback_ports {
        0 alsa_pcm:playback_1
        1 alsa_pcm:playback_2
    }
    capture_ports {
        0 alsa_pcm:capture_1
        1 alsa_pcm:capture_2
    }
}

ctl.mixer0 {
    type hw
    card 0
}

root@am335x-evm:/# aplay -D pcm.jack TangoForTajMusic11.wav
ALSA lib 
/home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm.c:2239:(snd_pcm_open_noupdate) 
Unknown PCM pcm.jack
aplay: main:722: audio open error: No such file or directory
root@am335x-evm:/#

Kindly do the needful as early as possible as am stuck with this from past many days

Eagerly awaiting for your replies,

  • Hi,

    I will forward this to the SW team.

  • Dear Biser,

    Sorry to push you hard, Could you please ask software team to reply to this thread as early as possible,

    As am stuck with this issue from many days

    Kindly do the needful as early as possible,

    Many Thanks in advance
  • I cannot do that. Your issue will be addressed as soon as possible.

  • Does the playback works with the default device? What is the case when you use:
    aplay TangoForTajMusic11.wav
    ?

    Have you done all amixer settings as described here: processors.wiki.ti.com/.../Linux_Core_Audio_User's_Guide#AM335x_EVM ?

    Best Regards,
    Yordan
  • Dear Yordan,

    As you are already aware that I have ported UDA1345TS audio codec driver support in linux kernel 3.12 (ti sdk 7), & it is working fine (e2e.ti.com/.../1409757),

    Since we have moved to latest BSP's ie.,ti sdk 8 , I have ported the same audio driver in sdk 8, the basic arecord & aplay works

    But we have developed an alsa application for establishing the GSM call over stereo codec UDA1345TS, I have here by attached the alsa application as well for your reference, whereas this application works fine in ti sdk 7 with some amount of echo with two way GSM call

    Instead of using this alsa application, am planning to use this jack alsa plugin which would be straight forward, that's why am facing the above error, when I try to use this plugin, could you please help me how this jack alsa plugin can be ported to ti sdk 8, but I have tried with only alsa application in ti sdk 7 & not with jack plugin 

    But whereas when I run the same application on ti sdk 8 (where I have ported UDA1345TS audio codec driver), I hear a huge amount of tone sound without 2 way GSM call, I have even tried with ti sdk 7 rootfs with ti sdk8 kernel image & device tree but still the result is same, So now I suspect there is an issue in ti sdk8 kernel image & device tree,

    On contrary am going to try with ti sdk8 rootfs with ti sdk 7 kernel image & device tree inorder to confirm that thre is no issues in rootfs of ti sdk8 for my application

    Could you please help me out what could be the issue & please help me in resolving this issue

    Pls find the details of the design GSM call established over stereo codec

    what ever the GSM analog audio out data is pumped as VINR to stereo codec & the output of the stereo codec ie., VOUTR is pumped to the Speaker of the custom board
    GSM MIC-> VINR -> stereo codec->VOUTR -> board speaker

    what ever the board MIC data is pumped as VINL to stereo codec & the output of the stereo codec ie., VOUTL is pumped as analog input to the GSM Speaker
    Board Mic -> VINL-> stereo codec -> VOUTL ->GSM speaker

    Please let me know if you require any other details from my side

    Kindly do the needful as early as possible

    Many Thanks in advance

    #include <stdio.h>
    #include <stdlib.h>
    #include <alsa/asoundlib.h>
    #define BUF_BYTES 128
     
    int main (/*int argc, char *argv[]*/) {
    	int err;
    	unsigned char buf_right[BUF_BYTES];
    	unsigned char buf_left[BUF_BYTES];
    	 //char *buf;
    	int size;
    
    	snd_pcm_t *playback_handle_right;
    	snd_pcm_t *capture_handle_right;
    	
    	snd_pcm_t *playback_handle_left;
    	snd_pcm_t *capture_handle_left;
    
    
    #if 0	
    	char* device = "default";
    	if (argc > 1) device = argv[1];
    #endif
    	char* crdevice = "VINR";
    
    	char* prdevice = "VOUTR";
    
    	char* cldevice = "VINL";
    
    	char* pldevice = "VOUTL";
    
    
    //	unsigned int rate = 48000;
    	unsigned int rate = 8000;
    	unsigned int nchannels = 1;
    	snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
    	unsigned int buf_frames_right = BUF_BYTES / nchannels / 2;
    	unsigned int buf_frames_left = BUF_BYTES / nchannels / 2;
    
    ///// RIGHT CHANNEL 
    	if ((err = snd_pcm_open (&playback_handle_right, prdevice, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
    	fprintf (stderr, "cannot open playback right audio device %s (%s)\n", prdevice, snd_strerror (err)); exit (1);
    	}
    	else
    	{
    	  printf("Opened Playback right audio device  successfully %s \n", prdevice);
    	}
    	
    	if ((err = snd_pcm_set_params(playback_handle_right, format, SND_PCM_ACCESS_RW_INTERLEAVED, nchannels, rate, 1, 500000)) < 0) { /* 0.5sec */
    	fprintf(stderr, "Playback right open error: %s\n", snd_strerror(err)); exit(1);
    	}
    
    	if ((err = snd_pcm_open (&capture_handle_right, crdevice, SND_PCM_STREAM_CAPTURE, 0)) < 0) {
    	fprintf (stderr, "cannot open capture right audio device %s (%s)\n", crdevice, snd_strerror (err)); exit (1);
    	}
    	else
    	{
    	  printf("Opened Capture right audio device successfully %s \n", crdevice);
    	}
    
    	if ((err = snd_pcm_set_params(capture_handle_right, format, SND_PCM_ACCESS_RW_INTERLEAVED, nchannels, rate, 1, 500000)) < 0) { /* 0.5sec */
    	fprintf(stderr, "capture right open error: %s\n", snd_strerror(err)); exit(1);
    	}	
    
    ////LEFT CHANNEL
    	if ((err = snd_pcm_open (&playback_handle_left, pldevice, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
    	fprintf (stderr, "cannot open playback left audio device %s (%s)\n", pldevice, snd_strerror (err)); exit (1);
    	}
    	else
    	{
    	  printf("Opened Playback left audio device successfully %s \n", pldevice);
    	}
    	
    	if ((err = snd_pcm_set_params(playback_handle_left, format, SND_PCM_ACCESS_RW_INTERLEAVED, nchannels, rate, 1, 500000)) < 0) { /* 0.5sec */
    	fprintf(stderr, "Playback left open error: %s\n", snd_strerror(err)); exit(1);
    	}
    
    	if ((err = snd_pcm_open (&capture_handle_left, cldevice, SND_PCM_STREAM_CAPTURE, 0)) < 0) {
    	fprintf (stderr, "cannot open capture left audio device %s (%s)\n", cldevice, snd_strerror (err)); exit (1);
    	}
    	else
    	{
    	  printf("Opened Capture left audio device successfully %s \n", crdevice);
    	}
    
    	if ((err = snd_pcm_set_params(capture_handle_left, format, SND_PCM_ACCESS_RW_INTERLEAVED, nchannels, rate, 1, 500000)) < 0) { /* 0.5sec */
    	fprintf(stderr, "capture left open error: %s\n", snd_strerror(err)); exit(1);
    	}
    
    
    
    	while(1) {
    ///// RIGHT CHANNEL 
    		if ((err = snd_pcm_readi (capture_handle_right, buf_right, buf_frames_right)) != buf_frames_right) {
    		fprintf (stderr, "read from audio interface right failed (%s)\n", snd_strerror (err)); exit (1);
    		}	
    
    		if ((err = snd_pcm_writei (playback_handle_right, buf_right, buf_frames_right)) != buf_frames_right) {
    		fprintf (stderr, "write to audio interface right failed (%s)\n", snd_strerror (err)); exit (1);
    		}
    ////LEFT CHANNEL
    		if ((err = snd_pcm_readi (capture_handle_left, buf_left, buf_frames_left)) != buf_frames_left) {
    		fprintf (stderr, "read from audio interface left failed (%s)\n", snd_strerror (err)); exit (1);
    		}	
    
    		if ((err = snd_pcm_writei (playback_handle_left, buf_left, buf_frames_left)) != buf_frames_left) {
    		fprintf (stderr, "write to audio interface left failed (%s)\n", snd_strerror (err)); exit (1);
    		}
    
    	}
     
    	fprintf (stderr, "close handles\n");
    	snd_pcm_close (playback_handle_right);
    	snd_pcm_close (capture_handle_right);
    
    	snd_pcm_close (playback_handle_left);
    	snd_pcm_close (capture_handle_left);
    
    	return 0;
    } 
    

  • Hi Srini,

    Sorry for the delayed response.
    What was the result from testing the SDK7 kernel (v 3.12) with SDK8 filesystem?
    Can you compare the audio drivers & device tree in SDK8 with the ones in the latest Sitara SDK 1.0: software-dl.ti.com/.../index_FDS.html

    Best Regards,
    Yordan
  • Dear Yordan,

    Thanks a lot for your prompt responses,

    I tried from testing SDK7 kernel with SDK8 filesystem, aplay is working but am unable to get arecord working so I haven't tried with GSM application

    Will try to compare audio driver & device tree in sdk8 with latest ones & will update you..

    Could you please provide inputs w.r.t the queries below:

    1. Could you please let me know, firstly where can I find alsa libraries in ti sdk 8 rootfs with what names (path of the alsa libraries in ti sdk 8 rootfs)???

    2. What is the version of this alsa libraries??? does this alsa libraries support all alsa plugins like dshare, dmix jack etc., how can I confirm this that it exists in the ti sdk 8 rootfs??

    3. As am trying to fix this issue permanently without this gsm application,  Mainly Does this alsa plugins support Jack plugin also ?? or it needs to be explicitly re compiled, if it already supports how can i confirm that it is compiled with jack plugin


    Pls let me know if you require any other details from my side

    Kindly do the needful as early as possible

    Many Thanks in advance

  • Dear Yordan,

    Could you please provide atleast some info w.r.t the queries

    Kindly do the needful as early as possible

    Awaiting for your replies,
    Many Thanks in advance
  • Sorry Yordan the above message was posted from my colleagues login

    Could you please provide atleast some info w.r.t the queries

    Kindly do the needful as early as possible

    Many Thanks in advance

  • Hi,
    "1. Could you please let me know, firstly where can I find alsa libraries in ti sdk 8 rootfs with what names (path of the alsa libraries in ti sdk 8 rootfs)???"
    Alsa libraries should be located in /usr/lib

    "2. What is the version of this alsa libraries???"
    You can check the alsa utils & libraries version in the software manifest (software-dl.ti.com/.../software_manifest.htm), it is located in the AM335x SDK Documentation section in the SDK download page (software-dl.ti.com/.../index_FDS.html)
    Alsa lib version is: 1.0.27.2-r0

    "does this alsa libraries support all alsa plugins like dshare, dmix jack etc., how can I confirm this that it exists in the ti sdk 8 rootfs??"
    You should check this in the ALSA Project community forum: www.alsa-project.org/.../Main_Page

    Best Regards,
    Yordan
  • Dear Yordan,

    Am using the below application with linux kernel 3.14 & with alsa lib version 1.0.27.2-r0 ie., (ti sdk 8) (am using ti sdk8 because all the development is being done in ti sdk 8, & now am unable to move to latest ti sdk version) but the below application was working fine in ti sdk 7 with no issues

    gist.github.com/.../1886976

    Could you please test the above application from your end & please let me know whether does it works fine or not

    Kindly do the needful as early as possible

    Many Thanks in advance
  • Dear Yordan,

    When I run the above app with 8Khz , I see broken pipe issue & more overrun & underrun issue in linux kernel 3.14 ti sdk 8 whereas I dont see those issues in ti sdk 7

    Could you please help me out inorder how to resolve with this broken pipe overrun & underrun issue in ti sdk 8

    Kindly do the needful as early as possible

    Many Thanks in advance