Hi Pablo,

I don’t know for 4.2. Try to read the sound/alsa/soc/davinci/davinci-mcasp.c 
file to understand which functionalities are implemented. I used the kernel 
from Robert C Nelson’s repo on github.

After a quick search on google, I saw you are not the first person to attempt 
to connect this codec to the BBB.
http://www.spinics.net/lists/alsa-devel/msg41291.html
Maybe you can try to contact this Wendelin Klimann.

BTW, this PCM3168 seems like a very neat chip. What exactly are you building ?

Cheers,
Robin

> On 8 janv. 2016, at 23:17, Pablo Fonovich <pablo7fonov...@gmail.com> wrote:
> 
> Thanks Robin,
> Im using latest stable kernel, think is 4.2, i can check when i get home... i 
> will add printk statements, as you suggested... 
> Another question. I inted to use one mcasp serializer for 4 channels... in 
> the am335x datasheet it seems possible, so i configured 4 tdm slots in the 
> device tree instead of 2, but if i try to record with -c 6 it says again the 
> "channels count non available". Do you know if its possible? its quite 
> frustrating to work without propper documentation, but in need this project 
> to get my title...
> 
> And last thing, where you able to get alsamixer working?
> Thanks very much
> 
> 2016-01-08 19:03 GMT-03:00 Robin Scheibler <fakuf...@gmail.com 
> <mailto:fakuf...@gmail.com>>:
> Hi Pablo,
> 
> What is the kernel version you are using ? I have finally used kernel 3.14 
> because in 3.8 it seems that the mcasp driver implementation could not 
> support more than two channels.
> 
> I was in the same position as you. I mostly dug as much as possible from TI 
> documentation and also read the drivers for other chipsets in the kernel 
> code. Then, I also used
> the sitara am355xx data sheet to understand how McASP works. It took me quite 
> some time to piece together how things work. Still now I do not fully 
> understand. The problem is that there is no proper documentation for the ALSA 
> SoC wrt embedded platforms such as the BBB.
> 
> Note that the TI example code might not be for exactly the same kernel 
> version you are using. There might be discrepancies.
> 
> I suggest you run a search on the source code to find where the error “ASoC: 
> machine hw_params failed” is generated. You can add printk statements in your 
> code so that you can later check in the kernel log that things are happening 
> as you expect.
> 
> Cheers,
> Robin
> 
>> On 8 janv. 2016, at 01:25, Pablo Fonovich <pablo7fonov...@gmail.com 
>> <mailto:pablo7fonov...@gmail.com>> wrote:
>> 
>> sorry, the message also states:
>> 
>> arecord: set_params:1297: Unable to install hw params:
>> ACCESS:  RW_INTERLEAVED
>> FORMAT:  S24_LE
>> SUBFORMAT:  STD
>> SAMPLE_BITS: 32
>> FRAME_BITS: 128
>> CHANNELS: 4
>> RATE: 96000
>> PERIOD_TIME: (21333 21334)
>> PERIOD_SIZE: 2048
>> PERIOD_BYTES: 32768
>> PERIODS: 4
>> BUFFER_TIME: (85333 85334)
>> BUFFER_SIZE: 8192
>> BUFFER_BYTES: 131072
>> TICK_TIME: 0
>> # aplay -f S24_LE -r 96000 ../Yam*wav
>> Warning: format is changed to S16_LE
>> Playing WAVE '../Yamaha-TG100-Ocarina-C5.wav' : Signed 16 bit Little Endian, 
>> Rate 44100 Hz, Stereo
>> [  102.291787] davinci_evm sound: ASoC: machine hw_params failed: -524
>> aplay: set_params:1297: Unable to install hw params:
>> ACCESS:  RW_INTERLEAVED
>> FORMAT:  S16_LE
>> SUBFORMAT:  STD
>> SAMPLE_BITS: 16
>> FRAME_BITS: 32
>> CHANNELS: 2
>> RATE: 44100
>> PERIOD_TIME: (125011 125012)
>> PERIOD_SIZE: 5513
>> PERIOD_BYTES: 22052
>> PERIODS: 4
>> BUFFER_TIME: (500045 500046)
>> BUFFER_SIZE: 22052
>> BUFFER_BYTES: 88208
>> TICK_TIME: 0
>> 
>> 
>> 2016-01-07 21:24 GMT-03:00 Pablo Fonovich <pablo7fonov...@gmail.com 
>> <mailto:pablo7fonov...@gmail.com>>:
>> Thanks very much, that was a problem. But now another error appears: 
>> "davinci_evm sound: ASoC: machine hw_params failed: -524". Do you know what 
>> it means, or where can i find the meaning? I assume this means there is 
>> something wrong when i created the pcm3168_hw_params in the alsa machine 
>> layer... but i don't know the problem... where did you look for info? only 
>> in that TI guide? I attach my files, and if is not much trouble for you i 
>> would be grateful if you help me...
>> 
>> i've noticed that some functions you used in davinci_evm.c where not 
>> explained in that guide... and it's very difficult for a noob like me in 
>> this subject for understainding what to do... I've just based my pcm3168.c 
>> in another driver, and i really don't quite understand much of what is going 
>> on, nor found any simple documentation about it. If you could give me some 
>> hints it would be great!
>> 
>> Thanks very much..
>> 
>> 2016-01-07 17:30 GMT-03:00 Robin Scheibler <fakuf...@gmail.com 
>> <mailto:fakuf...@gmail.com>>:
>> Hi Pablo,
>> 
>> With McASP it is not possible to capture less than 2 channels. Try with -c 2 
>> argument.
>> 
>> Best,
>> Robin
>> 
>>> On 7 janv. 2016, at 20:16, pablo7fonov...@gmail.com 
>>> <mailto:pablo7fonov...@gmail.com> wrote:
>>> 
>>> Hi Robin:
>>> 
>>> I'm doing a similar project, but with a PCM3168 codec... I also followed 
>>> the guide 
>>> http://processors.wiki.ti.com/index.php/Sitara_Linux_Audio_DAC_Example 
>>> <http://processors.wiki.ti.com/index.php/Sitara_Linux_Audio_DAC_Example>
>>> Anyway there are lots of things that are not very clear for me...  
>>> <http://processors.wiki.ti.com/index.php/Sitara_Linux_Audio_DAC_Example>
>>> 
>>> In my case, i use codec as clock slave, and synch, so the problem you had 
>>> should not affect to me... But when i try to record it says:
>>> 
>>>  arecord -D hw:0,0 -f S24_LE -c 1 -r 96000 -t wav test.wav
>>> Recording WAVE 'test.wav' : Signed 24 bit Little Endian, Rate 96000 Hz, Mono
>>> arecord: set_params:1239: Channels count non available
>>> 
>>> Could you help me?
>>> 
>>> On Sunday, May 24, 2015 at 4:38:43 AM UTC-3, Robin Scheibler wrote:
>>> Dear all,
>>> 
>>> I have created a custom cape around the STA321MP 
>>> <http://www.st.com/web/en/catalog/sense_power/FM125/CL935/SC534/PF251500d.d24>
>>>  chip from ST Microelectronics. It has 6 MEMS microphones and outputs them 
>>> on an I2S bus with 3 data lines. I am trying to use mcasp0 on the boneblack 
>>> side to receive the data. I am now to the point where the codec 
>>> configuration happens correctly (I can see the i2s signals with a logic 
>>> analyzer) and a soundcard is detected. However, when I try to record sound 
>>> with arecord, I get the following error:
>>> 
>>> root@beaglebone:~# arecord -l
>>> **** List of CAPTURE Hardware Devices ****
>>> card 0: EVM [STA321MP EVM], device 0: STA321MP sta321mp-audio-0 []
>>>   Subdevices: 1/1
>>>   Subdevice #0: subdevice #0
>>> root@beaglebone:~# arecord -D hw:0,0 -f S24_LE -c 6 -r 44100 -t wav test.wav
>>> Recording WAVE 'test.wav' : Signed 24 bit Little Endian, Rate 44100 Hz, 
>>> Channels 6
>>> arecord: pcm_read:1801: read error: Input/output error
>>> 
>>> Let me know provide more details.
>>> The codec is frame and bit clocks master
>>> The connection to mcasp0 is the following:
>>> Bit clock <=> P9_12 (mcasp0_aclkr_mux3)
>>> Frame sync clock (L/R) <=>  P9_27 (mcasp0_fsr)
>>> Data <=> P9_28 (mcasp0_axr2)
>>> Data <=> P9_30 (mcasp0_axr0)
>>> Data <=> P9_25 (mcasp0_axr3)
>>> I am using kernel 3.14.41 (because 3.8 doesn't have support for mcasp with 
>>> >2 channels)
>>> I am using dtb-builder to add my device to the device tree
>>> All the code I have added to the kernel (codec and machine code) and to the 
>>> device tree is on github. Here are the links to the specific changes I have 
>>> made.
>>> 
>>> kernel: 
>>> https://github.com/fakufaku/linux/commit/3a6680960412ef0fc3fbcc6f2c0021350039cc92
>>>  
>>> <https://github.com/fakufaku/linux/commit/3a6680960412ef0fc3fbcc6f2c0021350039cc92>
>>> device tree: 
>>> https://github.com/fakufaku/dtb-rebuilder/commit/127dbf3c82c78cc602058308ed72978b170c99a6
>>>  
>>> <https://github.com/fakufaku/dtb-rebuilder/commit/127dbf3c82c78cc602058308ed72978b170c99a6>
>>> It is my first time trying to code audio driver so please be indulgent :) I 
>>> have spent a lot of time on this but it seems I am now completely stuck. 
>>> I'd really appreciate some help. I'd be happy to provide more 
>>> clarifications on anything.
>>> 
>>> One thing I do not understand is if I need to add mixer bindings. And also 
>>> the audio routing (jack vs codec pins, etc).
>>> 
>>> Thank you in advance!
>>> Robin
>>> 
>>> -- 
>>> For more options, visit http://beagleboard.org/discuss 
>>> <http://beagleboard.org/discuss>
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "BeagleBoard" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe 
>>> <https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe>.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> beagleboard+unsubscr...@googlegroups.com 
>>> <mailto:beagleboard+unsubscr...@googlegroups.com>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <https://groups.google.com/d/optout>.
>> 
>> 
>> -- 
>> For more options, visit http://beagleboard.org/discuss 
>> <http://beagleboard.org/discuss>
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe 
>> <https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe>.
>> To unsubscribe from this group and all its topics, send an email to 
>> beagleboard+unsubscr...@googlegroups.com 
>> <mailto:beagleboard+unsubscr...@googlegroups.com>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
>> 
>> 
>> 
>> -- 
>> For more options, visit http://beagleboard.org/discuss 
>> <http://beagleboard.org/discuss>
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe 
>> <https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe>.
>> To unsubscribe from this group and all its topics, send an email to 
>> beagleboard+unsubscr...@googlegroups.com 
>> <mailto:beagleboard+unsubscr...@googlegroups.com>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> For more options, visit http://beagleboard.org/discuss 
> <http://beagleboard.org/discuss>
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe 
> <https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> beagleboard+unsubscr...@googlegroups.com 
> <mailto:beagleboard+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> For more options, visit http://beagleboard.org/discuss 
> <http://beagleboard.org/discuss>
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe 
> <https://groups.google.com/d/topic/beagleboard/pptZ_9PTqMY/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> beagleboard+unsubscr...@googlegroups.com 
> <mailto:beagleboard+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to