Hi

I did only playback in my A20 setup, for record may be you need to
configure codec register properly.
and also check your machine driver is configure properly for capture the
audio.



On Wed, Dec 2, 2015 at 5:26 PM, <[email protected]> wrote:

> Dear Punith
>
> my codec is working as playback device.
> i am trying to work with as capture device.
>
> i connect tlv320aic via i2s and i am contorlling tlv's registers as
> manually using i2c. it is working while play mode.
>
> my console logs is below.
>
> and i sniffed i2s data in of A20 , the sound signal is exist.
>
> do you have any idea why not work capture?
>
> root@marsboard:/var/app/sound# aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 1: sunxisndi2s [sunxi-sndi2s], device 0: SUNXI-I2S sndi2s-0 []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
>
> root@marsboard:/var/app/sound# arecord -l
> **** List of CAPTURE Hardware Devices ****
> card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 1: sunxisndi2s [sunxi-sndi2s], device 0: SUNXI-I2S sndi2s-0 []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> root@marsboard:/var/app/sound#
>
> root@marsboard:/var/app/sound# arecord -vvvv /dev/null -D hw:1,0 -f S16_LE
> Recording WAVE '/dev/null' : Signed 16 bit Little Endian, Rate 8000 Hz,
> Mono
> Hardware PCM card 1 'sunxi-sndi2s' device 0 subdevice 0
> Its setup is:
>   stream       : CAPTURE
>   access       : RW_INTERLEAVED
>   format       : S16_LE
>   subformat    : STD
>   channels     : 1
>   rate         : 8000
>   exact rate   : 8000 (8000/1)
>   msbits       : 16
>   buffer_size  : 8192
>   period_size  : 2048
>   period_time  : 256000
>   tstamp_mode  : NONE
>   period_step  : 1
>   avail_min    : 2048
>   period_event : 0
>   start_threshold  : 1
>   stop_threshold   : 8192
>   silence_threshold: 0
>   silence_size : 0
>   boundary     : 1073741824
>   appl_ptr     : 0
>   hw_ptr       : 0
> arecord: pcm_read:1801: read error: Input/output error
>
>
>
>
>
>
>
> On Saturday, April 4, 2015 at 11:25:36 AM UTC+2, Puneet B wrote:
> > You need to check codec driver and please aware of that whatever you are
> doing in machine driver should be supported
> > from codec driver.
> >
> >
> > Check the difference of codec drivers.
> >
> > Regards
> > Punith
> >
> >
> >
> > On Sat, Apr 4, 2015 at 1:59 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> >
> > hi
> >
> > i tried your machine code and log is like this:
> >
> > root@marsboard:~# mplayer -ao alsa:device=hw=2.0 a.mp3
> > MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
> > mplayer: could not connect to socket
> > mplayer: No such file or directory
> > Failed to open LIRC support. You will not be able to use your remote
> control.
> >
> > Playing a.mp3.
> > Detected file format: MPEG audio layer 2/3 (libavformat)
> > [mp3 @ 0xb5b3c558]max_analyze_duration reached
> > [mp3 @ 0xb5b3c558]Estimating duration from bitrate, this may be
> inaccurate
> > [lavf] stream 0: audio (mp3), -aid 0
> > Clip info:
> >  title: Overprotected
> >  artist: Britney Spears
> >  genre: Other
> > Load subtitles in .
> >
> ==========================================================================
> > Requested audio codec family [mpg123] (afm=mpg123) not available.
> > Enable it at compilation.
> > Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
> > AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/4.54% (ratio: 16000->352800)
> > Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3
> audio)
> >
> ==========================================================================
> > [AO_ALSA] Format floatle is not psupported by hardware, trying default.
> > uneet rx51_hw_params
> > [   47.143600] puneet rx51_hw_params
> > puneet@TLV320AIC3100 aic31xx_set_dai_fmt
> > [   47.151019] puneet@TLV320AIC3100 aic31xx_set_dai_fmt
> > puneet@TLV320AIC3100 aic31xx_change_page
> > [   47.159817] puneet@TLV320AIC3100 aic31xx_change_page
> > ##+ aic31xx_set_dai_fmt (4101)
> > [   47.169024] ##+ aic31xx_set_dai_fmt (4101)
> > ##- aic31xx_set_dai_fmt (0)
> > [   47.175716] ##- aic31xx_set_dai_fmt (0)
> > puneet@TLV320AIC3100 aic31xx_set_dai_sysclk
> > [   47.184386] puneet@TLV320AIC3100 aic31xx_set_dai_sysclk
> > ##aic31xx_set_dai_sysclk clk_id(0) (5644800)
> > [   47.193734] ##aic31xx_set_dai_sysclk clk_id(0) (5644800)
> > <1>Invalid frequency to set DAI system clock
> > [   47.203381] Invalid frequency to set DAI system clock
> > puneet@TLV320AIC3100 aic31xx_hw_params
> > [   47.212032] puneet@TLV320AIC3100 aic31xx_hw_params
> > ##+ SET aic31xx_hw_params
> > [   47.219552] ##+ SET aic31xx_hw_params
> > puneet@TLV320AIC3100 aic31xx_get_divs
> > [   47.226732] puneet@TLV320AIC3100 aic31xx_get_divs
> > ###+ aic31xx_get_divs mclk(5644800) rate(44100)
> > [   47.236080] ###+ aic31xx_get_divs mclk(5644800) rate(44100)
> > <1>Master clock and sample rate is not supported
> > [   47.246026] Master clock and sample rate is not supported
> > <1>sampling rate not supported
> > [   47.254511] sampling rate not supported
> > <3>tlv320aic31xx-codec 2-0018: can't set tlv320aic31xx-dai hw params: -22
> > [   47.264905] tlv320aic31xx-codec 2-0018: can't set tlv320aic31xx-dai
> hw params: -22
> > [AO_ALSA] alsa-lib: pcm_hw.c:326:(snd_pcm_hw_hw_params)
> SNDRV_PCM_IOCTL_HW_PARAMS failed (-22): Invalid argument
> > [AO_ALSA] Unable to set hw-parameters: Invalid argument
> > Failed to initialize audio driver 'alsa:device=hw=2.0'
> > Could not open/initialize audio device -> no sound.
> >
> >
> >
> >
> > 2015-04-04 8:03 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> > Here will be working machine driver code for me.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Sat, Apr 4, 2015 at 1:39 AM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi
> > i found some thing. in your machine driver there are codes like this:
> >
> >       ret = snd_soc_dai_set_clkdiv(cpu_dai, 0, 44100);  //*******set the
> sample rate 44100 ****/
> >         if (ret < 0) {
> >                 return ret;
> >         }
> >
> >
> > you think is this correct?
> >
> >
> > it is dividing clock signal to 44100 value. So on the i2s line, i can
> see divided frequency signal on the frame line.
> >
> >
> > and why 44100? Any sound can be different rates. Exp 48000hz.
> >
> >
> > i think problem inside of machine driver.
> >
> >
> > Could you send me latest machine driver?
> >
> >
> > Thanks.
> >
> >
> >
> >
> > 2015-04-02 13:47 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > I used the android kernel actually i made it work for linux-sunxi also
> but applying patches also but  i am not getting that bp
> > code. but i have back up code for android kernel.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Thu, Apr 2, 2015 at 3:58 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > The data pins is correct.
> > i thing inside the i2s source code. there are something that changing
> clock settings.
> > could you send me your /sound/soc/sunxi/i2s directory to compare with
> mine?
> >
> >
> >
> >
> > Thanks.
> >
> >
> >
> >
> > 2015-04-02 13:13 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > Make ensure that DIN go to DOut of Codec and Dout should go to DIN of
> codec with respect to script file.
> > and then ensure why clocks are not coming fine.
> >
> >
> >  ret = snd_soc_dai_set_sysclk(cpu_dai, 0 , 22579200, SND_SOC_CLOCK_OUT);
> >
> >
> > this will set MCLK to 11.29MHZ by dividing 22579200 clock by using some
> divider.
> >
> >
> > and also ensure the difference between your codec and my codec. if
> nothing much difference is there , it should work.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Thu, Apr 2, 2015 at 3:31 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 2015-04-02 12:40 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> > Could you send schematic of your board?.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Thu, Apr 2, 2015 at 2:57 PM, Puneet B <[email protected]> wrote:
> >
> >
> >
> > Yes . then may be some clock issue is there i think. make clock should
> be fine.
> >
> > regards
> > Punith
> >
> >
> >
> >
> >
> > On Thu, Apr 2, 2015 at 2:23 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi.
> > my codec chip is TLV320AIC3101IRHBR.
> >
> >
> > and i used tlv320aic31xx.c driver. i used the driver that you modified.
> i fount it on the web it is named like tlv320aic3100_new.c
> >
> >
> > http://e2e.ti.com/support/arm/sitara_arm/f/791/p/345940/1229942
> >
> >
> >
> > is this chip same with that you used.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 2015-04-02 11:25 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> > I think you need to use correct codec driver  particular to your chip
> set.
> > which chip set you are using?.
> >
> >
> >
> > the same chip set driver name  you need to add in machine driver and in
> device.c file.
> >
> > and regarding clock wclk should be 44.1khz and bclk=2*sample_rate(16 or
> 32)*wclk
> >
> > and mclk=11.2MHZ , kindly check this.
> >
> >
> > Regards
> >
> > Punith
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Apr 2, 2015 at 1:46 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> >
> > 1.aplay -l
> >
> >
> >
> > root@marsboard:~# aplay -l
> > **** List of PLAYBACK Hardware Devices ****
> > card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > card 1: sunxisndi2s [sunxi-sndi2s], device 0: SUNXI-I2S sndi2s-0 []
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > card 2: RX51 [RX-51], device 0: AIC34 tlv320aic31xx-dai-0 []
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > root@marsboard:~#
> >
> >
> > 2.the mplayer command line which is you used?.
> >
> > mplayer -ao alsa:device=hw=2.0 a.mp3
> >
> >
> >
> > 3.The log output.
> >
> > attachment.
> >
> >
> > 4.The mclk,din,wclk,bclk frequency.
> >
> > mclk=2.5Mhz
> > din=4.798kHz
> > wclk=3.674kHz
> > bclk=238.1khz
> >
> >
> >
> >
> >
> >
> >
> >
> > 2015-04-02 10:52 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> >
> >
> >
> > Can you send these outputs.
> > 1.aplay -l
> > 2.the mplayer command line which is you used?.
> > 3.The log output.
> > 4.The mclk,din,wclk,bclk frequency.
> >
> > Regards
> >
> > Punith
> >
> >
> >
> >
> >
> > On Thu, Apr 2, 2015 at 1:13 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi.
> > i tried android kernel and the kernel compiled not working on my board.
> i think .config issue.
> >
> >
> > i found i2s patch
> https://github.com/itead/ITEADSW_kernel-record/blob/master/linux-sunxi-3.4-ITEADDevelopingRecord.md
> .
> >
> >
> > and i applied it.
> >
> >
> > now i2s exist on the line. Logic anlyser can resolve i2s data. But i
> think the frequency of signals is wrong.
> >
> >
> > LRCLK = frame is 3.674 khz. must be 44 khz
> > MCLK = 2.5MHZ
> >
> >
> > i added screen shot video.
> >
> >
> >
> >
> >
> >
> > 2015-03-31 10:29 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > https://dl.linux-sunxi.org/SDK/cubietruck/
> >
> > try this link.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Tue, Mar 31, 2015 at 12:55 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > ok.
> >
> >
> > where can i download the android kernel. if i use same with you, it must
> be easier for me. thanks for your help.
> >
> >
> >
> >
> > 2015-03-31 9:52 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> > Check once , No need if there is no kernel panic error.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Tue, Mar 31, 2015 at 12:17 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi,
> >
> >
> > i can not get clocks. There are some dummy signals. and data line of i2s
> is always low.
> >
> >
> > i am using new marsboard and my base board. so if i can use android
> cubiboard kernel, can i configure to use my marsboard.
> >
> >
> >
> >
> >
> >
> > 2015-03-31 8:33 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > Are you getting all clocks?.
> >
> > If not current sunxi-3.4 is needs some patches, so why dont you use some
> android kernel ex from cubieboard2.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Mon, Mar 30, 2015 at 9:15 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi,
> >
> >
> > finally, kernel isnt broken anymore,
> >
> >
> > this is my log. But i cant see correct i2s signals. but i cant correct
> i2s signals on the line. and the counter("A:   0.0 (00.0) of 202.1
> (03:22.1) ??,?% $<3>"),
> > in this console line, not increasing.
> >
> >
> >
> > Enable it at compilation.
> > Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
> > AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/4.54% (ratio: 16000->352800)
> > Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3
> audio)
> >
> ==========================================================================
> > [AO_ALSA] Format floatle is not psupported by hardware, trying default.
> > uneet rx51_hw_params
> > [  897.712783] puneet rx51_hw_params
> > puneet rx51_hw_params
> > [  897.718978] puneet rx51_hw_params
> > puneet rx51_hw_params
> > [  897.724927] puneet rx51_hw_params
> > puneet rx51_hw_params
> > [  897.730441] puneet rx51_hw_params
> > puneet rx51_hw_params
> > [  897.736415] puneet rx51_hw_params
> > AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
> > Video: no video
> > Starting playback...
> > [IIS] dma trigger start
> > [  897.768765] [IIS] dma trigger start
> > [IIS] 0x01c22400+0x24 = 0xd4, line= 235
> > [  897.775866] [IIS] 0x01c22400+0x24 = 0xd4, line= 235
> > A:   0.0 (00.0) of 202.1 (03:22.1) ??,?% $<3>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 2015-03-30 12:08 GMT+03:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > See, Rx51 is sound card which will link platform driver to codec driver
> , then codec will able to play audio.
> > if you play audio through the only sunxii2s device , codec probe will
> not happen so you will not get any audio.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Mon, Mar 30, 2015 at 2:29 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi,
> >
> >
> > i have a question.
> > when we play with this command " mplayer -ao alsa:device=hw=1.0 a.mp3",
> so sunxii2s device, we can see all i2s signals on the line.
> > why does we need RX51 device?
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 2015-03-25 12:29 GMT+02:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > That i taken care codec drive for your case thats not needed right now
> first ensure all clocks are coming without
> > any kernel panic error.
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Wed, Mar 25, 2015 at 3:53 PM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> > hi,
> >
> >
> > i checked i2c,
> >
> >
> >
> > root@marsboard:/home/marsboard# i2cset -y 2 0x18 0x05 0x05
> > root@marsboard:/home/marsboard# i2cget -y 2 0x18 0x05
> > 0x00
> >
> >
> > in your older post you gave a register table read from tlv.
> > how did you read all registers.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 2015-03-25 10:02 GMT+02:00 Puneet B <[email protected]>:
> >
> >
> >
> > This means that kernel issue i think , please use android kernel 3.4
> (check  cubieboard2 sources).
> >
> > Regards
> > Punith
> >
> >
> >
> >
> >
> > On Wed, Mar 25, 2015 at 11:18 AM, OMER AYGOR EYZA TEKNOLOJİ <
> [email protected]> wrote:
> >
> >
> > hi,
> > thanks for your kindly replay.
> >
> >
> > i am using 3.4.103 kernel. which patches l need. i didnt see any patch
> old posts.
> >
> >
> > i tried command you said. when i pass to " mplayer -ao alsa:device=hw=
>        2.0 a.mp3"
> > command. it is crashing. in your machine driver, it calls rx51_hw_params
>  function.
> >
> >
> >
> >
> >
> >
> > root@marsboard:/home/marsboard# mplayer -ao alsa:device=hw=         2.0
> a.mp3
> > MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
> > mplayer: could not connect to socket
> > mplayer: No such file or directory
> > Failed to open LIRC support. You will not be able to use your remote
> control.
> >
> >
> > Playing a.mp3.
> > Detected file format: MPEG audio layer 2/3 (libavformat)
> > [mp3 @ 0xb5bb4558]max_analyze_duration reached
> > [mp3 @ 0xb5bb4558]Estimating duration from bitrate, this may be
> inaccurate
> > [lavf] stream 0: audio (mp3), -aid 0
> > Clip info:
> >  title: Overprotected
> >  artist: Britney Spears
> >  genre: Other
> > Load subtitles in .
> >
> ==========================================================================
> > Requested audio codec family [mpg123] (afm=mpg123) not available.
> > Enable it at compilation.
> > Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
> > AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/4.54% (ratio: 16000->352800)
> > Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3
> audio)
> >
> ==========================================================================
> > [AO_ALSA] Format floatle is not psupported by hardware, trying default.
> > uneet rx51_hw_params
> >
> >
> > [  437.854378] puneet rx51_hw_params
> > <1>Unable to handle kernel NULL pointer dereference at virtual address
> 0000002c
> >
> >
> > <1>Unable to handle kernel NULL pointer dereference at virtual address
> 0000002c
> >
> >
> > [ < 437.866460] Unable to handle kernel NULL pointer dereference at
> virtual address 0000002c
> > 1[  437.873500] Unable to handle kernel NULL pointer dereference at
> virtual address 0000002c
> > >pgd = c0004000
> >
> >
> >
> > [ < 437.891315] pgd = c0004000
> > 1>[0000002c] *pgd=00000000
> > [  437.896362] [0000002c] *pgd=00000000
> >
> >
> > <0>Internal error: Oops: 17 [#1] PREEMPT SMP ARM
> >
> >
> > <[  437.904450] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
> > d>Modules linked in: [  437.911658] Modules linked in:g_mass_storage
>  g_mass_storagerfcomm bnep  rfcomm bnepbluetooth  bluetoothsunxi_cedar_mod
>  sunxi_cedar_modmali ump  mali umphdmi sunxi_gmac  hdmi sunxi_gmac8188eu
> >  8188eu
> >
> >
> > CPU: 0    Not tainted  (3.4.103+ #28)
> >
> >
> > [ P 437.933105] CPU: 0    Not tainted  (3.4.103+ #28)
> > C is at regulator_enable+0x4/0x20c
> >
> >
> > L[  437.941015] PC is at regulator_enable+0x4/0x20c
> > R is at regulator_bulk_enable_async+0x10/0x18
> >
> >
> >
> >
> > 2015-03-25 6:47 GMT+02:00 Puneet B <[email protected]>:
> >
> >
> >
> >
> > you need to pass fallowing command
> >
> >  mplayer -ao alsa:device=hw=2.0 a.mp3
> >
> > and also ensure that all clocks are coming fine...
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "linux-sunxi" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/linux-sunxi/t44VY2-cOMo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to