* Linux audio driver OMAP5912
[not found] <3BE48DD0EC7D3948BC183931D9150C210684CA9F@ii0015exch001u.iprc.l ucent.com>
@ 2006-04-05 11:42 ` ruchir.gulati
2006-04-05 16:38 ` Michal Szabat
0 siblings, 1 reply; 10+ messages in thread
From: ruchir.gulati @ 2006-04-05 11:42 UTC (permalink / raw)
To: linux-omap-open-source
Hello,
I am trying to record/capture and play/render audio on the OMAP5912 OSK
supplied by Spectrum Digital. I am aware of the TLV320AIC23 Audio Codec IC
present on this board. I want to record and play the audio using the GPP
or the ARM9 processor, through the MotaVista Linux OS present on the ARM
processor.
Can anyone please tell me how can I do this? If there is any driver (I
mean Linux driver for OMAP5912) available for this, then where is it? As
of now I have searched the OMAP page on the Spectrum Digital webpage and a
few other websites, but without any success.
If anyone has worked on such a thing, please help with this! Or, if this
is not possible, please let me know, so that I could take some other
approach....
Thanks in advance,
Ruchir Gulati
Embedded Systems Group,
TATA Consultancy Services Ltd.
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Linux audio driver OMAP5912
2006-04-05 11:42 ` Linux audio driver OMAP5912 ruchir.gulati
@ 2006-04-05 16:38 ` Michal Szabat
2006-04-06 10:06 ` ruchir.gulati
0 siblings, 1 reply; 10+ messages in thread
From: Michal Szabat @ 2006-04-05 16:38 UTC (permalink / raw)
To: linux-omap-open-source, ruchir.gulati
----- Original Message -----
From: <ruchir.gulati@tcs.com>
To: <linux-omap-open-source@linux.omap.com>
Sent: Wednesday, April 05, 2006 1:42 PM
Subject: Linux audio driver OMAP5912
>
> Hello,
>
> I am trying to record/capture and play/render audio on the OMAP5912 OSK
> supplied by Spectrum Digital. I am aware of the TLV320AIC23 Audio Codec IC
> present on this board. I want to record and play the audio using the GPP
> or the ARM9 processor, through the MotaVista Linux OS present on the ARM
> processor.
>
> Can anyone please tell me how can I do this? If there is any driver (I
> mean Linux driver for OMAP5912) available for this, then where is it? As
> of now I have searched the OMAP page on the Spectrum Digital webpage and a
> few other websites, but without any success.
>
> If anyone has worked on such a thing, please help with this! Or, if this
> is not possible, please let me know, so that I could take some other
> approach....
>
> Thanks in advance,
> Ruchir Gulati
> Embedded Systems Group,
> TATA Consultancy Services Ltd.
>
> Notice: The information contained in this e-mail message and/or
> attachments to it may contain confidential or privileged information. If
> you are not the intended recipient, any dissemination, use, review,
> distribution, printing or copying of the information contained in this
> e-mail message and/or attachments to it are strictly prohibited. If you
> have received this communication in error, please notify us by reply
> e-mail or telephone and immediately and permanently delete the message and
> any attachments. Thank you
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>
Hello.
I want to compress audio to mp3 or other format, by now without cuccess.
You can check it http://oskfordummies.hp.infoseek.co.jp/howto/audio.html.
----------------------------------------------------------------------
Poznaj Stefana! Zmien komunikator! >>> http://link.interia.pl/f1924
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Linux audio driver OMAP5912
2006-04-05 16:38 ` Michal Szabat
@ 2006-04-06 10:06 ` ruchir.gulati
2006-04-06 12:51 ` Menon, Nishanth
0 siblings, 1 reply; 10+ messages in thread
From: ruchir.gulati @ 2006-04-06 10:06 UTC (permalink / raw)
To: linux-omap-open-source
Thank you Michal, Sriram, and Nishant,
I tried the steps mentioned at the website suggested by you and they work.
I am able to play sound. Actually i have a raw PCM file which contains
mono speech sampled at 8KHz and uses 16 bits/sample resolution.
Though this file is playing, it seems to be getting played very fast in
spite of doing the proper configuration. Is it necessary to convert any
PCM file to the *.au file before attempting to play it or can I also play
a simple PCM file as described above? If yes, then how should I go about
it?
Thanks in advance....
Ruchir Gulati
Tata Consultancy Services Limited
M2 & N2, Sector V, Block GP,
Salt Lake Electronics Complex
Kolkata - 700091,West Bengal
India
Mailto: ruchir.gulati@tcs.com
Website: http://www.tcs.com
"Michal Szabat" <michal611@interia.pl>
04/05/2006 10:08 PM
To
<linux-omap-open-source@linux.omap.com>, <ruchir.gulati@tcs.com>
cc
Subject
Re: Linux audio driver OMAP5912
----- Original Message -----
From: <ruchir.gulati@tcs.com>
To: <linux-omap-open-source@linux.omap.com>
Sent: Wednesday, April 05, 2006 1:42 PM
Subject: Linux audio driver OMAP5912
>
> Hello,
>
> I am trying to record/capture and play/render audio on the OMAP5912 OSK
> supplied by Spectrum Digital. I am aware of the TLV320AIC23 Audio Codec
IC
> present on this board. I want to record and play the audio using the GPP
> or the ARM9 processor, through the MotaVista Linux OS present on the ARM
> processor.
>
> Can anyone please tell me how can I do this? If there is any driver (I
> mean Linux driver for OMAP5912) available for this, then where is it? As
> of now I have searched the OMAP page on the Spectrum Digital webpage and
a
> few other websites, but without any success.
>
> If anyone has worked on such a thing, please help with this! Or, if this
> is not possible, please let me know, so that I could take some other
> approach....
>
> Thanks in advance,
> Ruchir Gulati
> Embedded Systems Group,
> TATA Consultancy Services Ltd.
>
> Notice: The information contained in this e-mail message and/or
> attachments to it may contain confidential or privileged information. If
> you are not the intended recipient, any dissemination, use, review,
> distribution, printing or copying of the information contained in this
> e-mail message and/or attachments to it are strictly prohibited. If
you
> have received this communication in error, please notify us by reply
> e-mail or telephone and immediately and permanently delete the message
and
> any attachments. Thank you
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>
Hello.
I want to compress audio to mp3 or other format, by now without cuccess.
You can check it http://oskfordummies.hp.infoseek.co.jp/howto/audio.html.
----------------------------------------------------------------------
Poznaj Stefana! Zmien komunikator! >>> http://link.interia.pl/f1924
ForwardSourceID:NT0000413E
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
2006-04-06 10:06 ` ruchir.gulati
@ 2006-04-06 12:51 ` Menon, Nishanth
0 siblings, 0 replies; 10+ messages in thread
From: Menon, Nishanth @ 2006-04-06 12:51 UTC (permalink / raw)
To: ruchir.gulati, linux-omap-open-source
Hi Ruchir,
>mono speech sampled at 8KHz and uses 16 bits/sample resolution.
Some of the codecs do not support Mono mode of data. the behavior of playing a mono data on a stereo line is expected to be playing fast. if you can check out http://www.opensound.com/pguide/oss.pdf, the IOCTLs required to put the codec into mono mode are listed there. if the ioctls fail, it is a fair assumption that that the device does not support mono mode.
One trick to work around this is as follows: have a mono sample at x khz and configure the codec at (x/2) khz (provided it is supported on the codec).
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
[not found] <520AB2AD990DC04082102F77CA172638030C4EF6@dlee03.ent.ti.com>
@ 2006-04-10 11:49 ` ruchir.gulati
0 siblings, 0 replies; 10+ messages in thread
From: ruchir.gulati @ 2006-04-10 11:49 UTC (permalink / raw)
To: Menon, Nishanth, linux-omap-open-source
Hello,
Thanks for the help. Nishant's tip suggesting about sampling rate getting
halved for stereo mode made file playback on the OMAP possible!!
Now I'm stuck with the other half. I'm not able to record audio through
the microphone input. Although I have doe things as suggested in OSS.pdf,
I am unable to make this work. I am including a snippet of my code which I
am using to configure the sound card.
Though it shows that active recording source is MIC, yet I'm unable to
record after that. Also the MIC volume is coming as 27500, where as I
guess the allowd values are between 0 and 100. Can anybody please tell me
what the possible problem might be??
Its as follows:
int fd_mixer = open("/dev/mixer", O_RDONLY);
int fd = open("/dev/dsp", O_WRONLY);
int format, mask = 0, vol = 0;
if(fd_mixer == -1) {
printf("Mixer Open Failure\n");
return -1;
}
format = AFMT_S16_LE;
if(ioctl(fd, SNDCTL_DSP_SETFMT, &format) == -1){
printf("ioctl failure\n");
return -1;
}
if(format != AFMT_S16_LE) {
....
format = 2;
if(ioctl(fd, SNDCTL_DSP_CHANNELS, &format) == -1){
....
format = 8000;
if(ioctl(fd, SNDCTL_DSP_SPEED, &format) == -1){
....
if(format != 8000) {
....
printf("Supported Fs = %d\n", format);
if(ioctl(fd_mixer, SOUND_MIXER_READ_RECMASK, &mask) == -1){
printf("ioctl failure\n");
}
if(mask & (1 << SOUND_MIXER_MIC)) {
printf("Active i/p is MIC\n");
}
else if(mask & (1 << SOUND_MIXER_LINE)) {
printf("Active i/p is LINE\n");
}
if(ioctl(fd_mixer, MIXER_READ(SOUND_MIXER_MIC),&vol) == -1) {
printf("MIC volume read failure\n");
}
printf("MIC Volume = %d\n", vol);
close(fd_mixer);
Thanks & Regards,
Ruchir Gulati
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
@ 2006-04-10 14:35 Menon, Nishanth
2006-04-26 9:27 ` ruchir.gulati
0 siblings, 1 reply; 10+ messages in thread
From: Menon, Nishanth @ 2006-04-10 14:35 UTC (permalink / raw)
To: ruchir.gulati, linux-omap-open-source
>Also the MIC volume is coming as 27500, where as I guess the allowd
values are between 0 and 100. Can anybody please tell me what the
possible problem might be??
Oss.pdf again. Left channel 8 bits and right channel 8 bits are depicted
as as RRLL for the 16 bits to the volume ioctl. You can have 0 to 100
for either RR or LL. 27500 = 0x6B6C ==> Left = 0x6C and right = 0x6B
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
2006-04-10 14:35 Menon, Nishanth
@ 2006-04-26 9:27 ` ruchir.gulati
0 siblings, 0 replies; 10+ messages in thread
From: ruchir.gulati @ 2006-04-26 9:27 UTC (permalink / raw)
To: linux-omap-open-source, Menon, Nishanth
Hi,
Thanks for all the advise. Now I am able to play and record correctly
using Linux (OSS driver) on the OMAP 5912 board.
However as I am trying to make a complete application, I am facing some
more problems.
I am not able to record and play simultaneouly using the OSS driver.
Though I have opened the device in the "O_RDWR" mode, I am able to record
properly but not play. In fact whenever I try to play, if the device was
opened in the "O_RDWR" mode, playback does not happen correctly. Sometimes
it gives the error message like Omap_audio: DMA IRQ received for
non-existing buffer. Ultimately the board hangs and a reboot needs to be
done.
I have configured the device in the Full-Duplex mode and also also checked
whether it has the full-duplex capability, which it seems to have. Yet I
am not able to fix this problem.
Can someone please tell me where the problem is? If the problem is with
device fragment size, then what is the correct procedure for setting the
same, and to what value should it be set? If somone working on the OMAP
5912 has come across similar problems, and fixed them, then please throw
some light on the solution for me also!
Thanks & Regards,
Ruchir Gulati
Tata Consultancy Services Limited
M2 & N2, Sector V, Block GP,
Salt Lake Electronics Complex
Kolkata - 700091,West Bengal
India
Mailto: ruchir.gulati@tcs.com
Website: http://www.tcs.com
"Menon, Nishanth" <x0nishan@ti.com>
04/10/2006 08:05 PM
To
<ruchir.gulati@tcs.com>, <linux-omap-open-source@linux.omap.com>
cc
Subject
RE: Linux audio driver OMAP5912
>Also the MIC volume is coming as 27500, where as I guess the allowd
values are between 0 and 100. Can anybody please tell me what the possible
problem might be??
Oss.pdf again. Left channel 8 bits and right channel 8 bits are depicted
as as RRLL for the 16 bits to the volume ioctl. You can have 0 to 100 for
either RR or LL. 27500 = 0x6B6C è Left = 0x6C and right = 0x6B
Regards,
Nishanth Menon
ForwardSourceID:NT000042F2
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
@ 2006-04-26 14:38 Menon, Nishanth
2006-05-04 12:29 ` ruchir.gulati
0 siblings, 1 reply; 10+ messages in thread
From: Menon, Nishanth @ 2006-04-26 14:38 UTC (permalink / raw)
To: ruchir.gulati, linux-omap-open-source
Hi Ruchir,
> Sometimes it gives the error message like Omap_audio: DMA IRQ received
for non-existing buffer. Ultimately the board hangs and a reboot needs
to be done.
This points at some sort of buffer handling issues on the audio layer.
The OSS driver is kind of deprecated now-a-days. Have you tried alsa
driver yet? This should be present in the latest omap-linux git tree.
> Can someone please tell me where the problem is? If the problem is
with device fragment size, then what is the correct procedure for
setting the same, and to what value should it be set? If somone working
on the OMAP 5912 has come across similar problems, and fixed them, then
please throw some light on the solution for me also!
Check out oss.pdf again for DSP_SETFRAGMENTS ioctl for adjusting the
kernel buffer parameters.
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
2006-04-26 14:38 Menon, Nishanth
@ 2006-05-04 12:29 ` ruchir.gulati
0 siblings, 0 replies; 10+ messages in thread
From: ruchir.gulati @ 2006-05-04 12:29 UTC (permalink / raw)
To: Menon, Nishanth, linux-omap-open-source
Hi,
Is it so that the OSS driver on the OMAP5912will not work in the
full-dulpex mode at all? I think the problem I am facing presently is of
buffer underrun while audio playback, and hope to resolve it by trying
different fragment sizes. I really hope this works! Any more help/tips on
this topic??
Please let me know if switching to ALSA would be absolutely necessary for
supporting full-duplex sort of functioning on the OMAP5912
Thanks & Regards,
Ruchir Gulati
"Menon, Nishanth" <x0nishan@ti.com>
04/26/2006 08:08 PM
To
<ruchir.gulati@tcs.com>, <linux-omap-open-source@linux.omap.com>
cc
Subject
RE: Linux audio driver OMAP5912
Hi Ruchir,
> Sometimes it gives the error message like Omap_audio: DMA IRQ received
for non-existing buffer. Ultimately the board hangs and a reboot needs to
be done.
This points at some sort of buffer handling issues on the audio layer. The
OSS driver is kind of deprecated now-a-days. Have you tried alsa driver
yet? This should be present in the latest omap-linux git tree.
> Can someone please tell me where the problem is? If the problem is with
device fragment size, then what is the correct procedure for setting the
same, and to what value should it be set? If somone working on the OMAP
5912 has come across similar problems, and fixed them, then please throw
some light on the solution for me also!
Check out oss.pdf again for DSP_SETFRAGMENTS ioctl for adjusting the
kernel buffer parameters.
Regards,
Nishanth Menon
ForwardSourceID:NT0000473A
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Linux audio driver OMAP5912
@ 2006-05-04 13:41 Menon, Nishanth
0 siblings, 0 replies; 10+ messages in thread
From: Menon, Nishanth @ 2006-05-04 13:41 UTC (permalink / raw)
To: ruchir.gulati, linux-omap-open-source
Hi Ruchir,
Usually, I don't face buffer underflow/overrun unless I have a data rate
difference. E.g. I configure the hardware to 48K sampling rate, but the
file operations rate is 1k. The kernel's intermediate buffers can handle
the rate difference to a limit for some time at least, however, if the
data rate difference is too much over the head, then you'd end up where
the fileops take too much time compared to the read and the kernel's
audio buffer overflows/underflows. There are various means to handle
this. My favorite suggestion is to use dedicated threads to pull
data/throw data in, while another thread does fileops. This forces the
application to do buffering on its own (in addition to kernel's
buffering mechanism). FileIO overheads are upto the apps to handle, the
kernel buffers are basically targeted at OS being not consistent is
scheduling the read/write thread (vanilla linux being not 100% real
time)- this can handle scenarios on an overloaded system where the
kernel schedules the audio app in varying durations. My second favourite
suggestion would be to use a faster fileio filesystem (such as flash on
jffs2 rather than NFS over a heavily loaded network).
I suggest ALSA over OSS as the buffering logic used there is common for
all platforms - which implies, the problems that you might be seeing on
OSS (which has omap specific buffering logic), would have already been
solved. But then, if you so prefer, you can isolate the fileio overheads
before giving up on OSS (write and read to intermediate buffers,
complete ops, and then do fileio).
Regards,
Nishanth Menon
________________________________
From: ruchir.gulati@tcs.com [mailto:ruchir.gulati@tcs.com]
Sent: Thursday, May 04, 2006 7:29 AM
To: Menon, Nishanth; linux-omap-open-source@linux.omap.com
Subject: RE: Linux audio driver OMAP5912
Hi,
Is it so that the OSS driver on the OMAP5912will not work in the
full-dulpex mode at all? I think the problem I am facing presently is of
buffer underrun while audio playback, and hope to resolve it by trying
different fragment sizes. I really hope this works! Any more help/tips
on this topic??
Please let me know if switching to ALSA would be absolutely necessary
for supporting full-duplex sort of functioning on the OMAP5912
Thanks & Regards,
Ruchir Gulati
"Menon, Nishanth" <x0nishan@ti.com>
04/26/2006 08:08 PM
To
<ruchir.gulati@tcs.com>, <linux-omap-open-source@linux.omap.com>
cc
Subject
RE: Linux audio driver OMAP5912
Hi Ruchir,
> Sometimes it gives the error message like Omap_audio: DMA IRQ received
for non-existing buffer. Ultimately the board hangs and a reboot needs
to be done.
This points at some sort of buffer handling issues on the audio layer.
The OSS driver is kind of deprecated now-a-days. Have you tried alsa
driver yet? This should be present in the latest omap-linux git tree.
> Can someone please tell me where the problem is? If the problem is
with device fragment size, then what is the correct procedure for
setting the same, and to what value should it be set? If somone working
on the OMAP 5912 has come across similar problems, and fixed them, then
please throw some light on the solution for me also!
Check out oss.pdf again for DSP_SETFRAGMENTS ioctl for adjusting the
kernel buffer parameters.
Regards,
Nishanth Menon
ForwardSourceID:NT0000473A
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-05-04 13:41 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3BE48DD0EC7D3948BC183931D9150C210684CA9F@ii0015exch001u.iprc.l ucent.com>
2006-04-05 11:42 ` Linux audio driver OMAP5912 ruchir.gulati
2006-04-05 16:38 ` Michal Szabat
2006-04-06 10:06 ` ruchir.gulati
2006-04-06 12:51 ` Menon, Nishanth
[not found] <520AB2AD990DC04082102F77CA172638030C4EF6@dlee03.ent.ti.com>
2006-04-10 11:49 ` ruchir.gulati
2006-04-10 14:35 Menon, Nishanth
2006-04-26 9:27 ` ruchir.gulati
-- strict thread matches above, loose matches on Subject: below --
2006-04-26 14:38 Menon, Nishanth
2006-05-04 12:29 ` ruchir.gulati
2006-05-04 13:41 Menon, Nishanth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox