public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* ALSA with OMAP1510
@ 2006-03-16 12:25 Prakash Narayanan M
  2006-03-16 17:27 ` Daniel Petrini
  0 siblings, 1 reply; 7+ messages in thread
From: Prakash Narayanan M @ 2006-03-16 12:25 UTC (permalink / raw)
  To: linux-omap-open-source

Hai All

 

Thanks first of all to Mika, Komal and Nishanth.....now I have made
2.6.14 up and running on OMAP1510 Innovator.

 

The ALSA part is compiled with kernel.  Now when I do #cat test.raw >
/dev/dsp no response from the audio device.  I have created and tested
test.raw in my host machine.  

 

Also I used a C program to check the audio device.

1. opens /dev/mixer and set the mic gain to 100 and close /dev/mixer
2. opens /dev/dsp (Read only mode) and set the parameters
3. reads the mic values to a buffer and close /dev/dsp
4. opens /dev/mixer and set the mic gain to 0 and close /dev/mixer
5. opens /dev/dsp (Write only mode) and set the parameters
6. write the buffer to /dev/dsp device



 OBSERVATIONS:

          arg = 16;       /* sample size */
          status = ioctl(fd, SOUND_PCM_READ_BITS, &arg);
          if (arg != SIZE)    ////// I find arg is returned with 8
instead of 16 
            perror("unable to set sample size");
 
Similarly for the following 
        status = ioctl(fd, SOUND_PCM_READ_CHANNELS, &arg);
2 channels asked and 1 returned
 
        status = ioctl(fd, SOUND_PCM_READ_RATE, &arg);
rate asked 44100 returned 8000
 

How do I go about testing the sound device in OMAP1510 Innovator ?

How do I go about trouble shooting ALSA?

 

 

Thanks in advance

Regards

Prakash

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ALSA with OMAP1510
  2006-03-16 12:25 ALSA with OMAP1510 Prakash Narayanan M
@ 2006-03-16 17:27 ` Daniel Petrini
  2006-03-16 17:29   ` Daniel Petrini
  2006-03-16 18:12   ` lamikr
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Petrini @ 2006-03-16 17:27 UTC (permalink / raw)
  To: Prakash Narayanan M; +Cc: linux-omap-open-source

HI,

On 3/16/06, Prakash Narayanan M <mnarayan@cedt.iisc.ernet.in> wrote:
> Hai All
<snip>
> The ALSA part is compiled with kernel.  Now when I do #cat test.raw >
> /dev/dsp no response from the audio device.  I have created and tested
> test.raw in my host machine.

You should use "aplay test.raw" to play using alsa stack.

> Also I used a C program to check the audio device.
>
> 1. opens /dev/mixer and set the mic gain to 100 and close /dev/mixer
> 2. opens /dev/dsp (Read only mode) and set the parameters
> 3. reads the mic values to a buffer and close /dev/dsp
> 4. opens /dev/mixer and set the mic gain to 0 and close /dev/mixer
> 5. opens /dev/dsp (Write only mode) and set the parameters
> 6. write the buffer to /dev/dsp device

Maybe taking a look at the source of some alsa application, like the
aplay itself would help.

Regards,

Daniel
--
INdT

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ALSA with OMAP1510
  2006-03-16 17:27 ` Daniel Petrini
@ 2006-03-16 17:29   ` Daniel Petrini
  2006-03-16 18:12   ` lamikr
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Petrini @ 2006-03-16 17:29 UTC (permalink / raw)
  To: Prakash Narayanan M; +Cc: linux-omap-open-source

Hi,

> > The ALSA part is compiled with kernel.  Now when I do #cat test.raw >
> > /dev/dsp no response from the audio device.  I have created and tested
> > test.raw in my host machine.
>
> You should use "aplay test.raw" to play using alsa stack.

Or even verify if OSS emulation is enabled in the kernel.

Daniel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ALSA with OMAP1510
  2006-03-16 17:27 ` Daniel Petrini
  2006-03-16 17:29   ` Daniel Petrini
@ 2006-03-16 18:12   ` lamikr
  1 sibling, 0 replies; 7+ messages in thread
From: lamikr @ 2006-03-16 18:12 UTC (permalink / raw)
  To: Daniel Petrini; +Cc: linux-omap-open-source, Prakash Narayanan M


>You should use "aplay test.raw" to play using alsa stack.
>  
>
Yes, for alsa driver the "aplay" should be the easiest solution.
I have myself used alsa succesfully with the tsc2101 chipset and latest
kernel in git repository (about 2.6.16-rc5)
by applying the 3 patches I and daniel send for the list about 10 days ago.

Daniel tested the tsc2101 and aic23 drivers by using OSK and H2 boards.
I used myself omap1510 based h6300 for writing and testing. With that
board there were two issues compared to other devices that I needed to
handle.

1) I needed to add following to audio_process_dma() in
sound/arm/omap_alsa.c that was was not needed by other boards.
    Without this, the dma stopped after first small buffer transfered.
If you have problems you could enable that also for your boards.

#ifdef CONFIG_MACH_OMAP_H6300
        spin_lock_irqsave(&s->dma_lock, flags);
        omap_stop_alsa_sound_dma(s);
        spin_unlock_irqrestore(&s->dma_lock, flags);
#endif

2) In sound/arm/omap/omap-alsa-tsc2101.c tsc2101_snd_omap_alsa_playback
structure h6300 needs to be configured to have 8 bit dma.
(this is not yet in the patch sent to the list)

#ifdef CONFIG_MACH_OMAP_H6300
    .formats = (SNDRV_PCM_FMTBIT_S8),
#else
    .formats = (SNDRV_PCM_FMTBIT_S16_LE),
#endif

If you want to test the play with different samplerates, you can use a
program called "sox" for creating wavs with different samplerates.
(sox song.wav -r 8000 -c 1  -s -w song8000.wav)
**
Mika

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: ALSA with OMAP1510
@ 2006-03-17 12:21 Prakash Narayanan M
  2006-03-17 13:06 ` Komal Shah
  2006-03-17 13:42 ` Daniel Petrini
  0 siblings, 2 replies; 7+ messages in thread
From: Prakash Narayanan M @ 2006-03-17 12:21 UTC (permalink / raw)
  To: linux-omap-open-source

Hai

I am using TI Innovator OMAP1510 kit (This does not have tsc2101, but
AIC23 is the codec and ADS7846 touch screen controller). Kernel 2.6.14
toolchain gcc3.4.1. 

1) While selecting ALSA in menuconfig (kernel 2.6.14), is it required to
select AIC23 separately somewhere (I do not know where) for ALSA to
work?

2) If I select OSK5912 it gives the following error.
ALSA / OSK5912 enabled sound/built-in.o(.text+0x3c16c): 
In function `$a':
: undefined reference to `OMAP_DMA_CCR' sound/built-in.o(.text+0x3c178):

In function `$a': : undefined reference to `OMAP_DMA_CCR'


3) If I select OSS driver also along with ALSA the following error is
observed.

OSS Sound modules / Persistent DMA buffers enabled
sound/oss/soundcard.c:68: error: `MAX_DMA_CHANNELS' undeclared here (not
in a function)
sound/oss/soundcard.c:68: error: storage size of `dma_alloc_map' isn't
known sound/oss/soundcard.c:68: warning: 'dma_alloc_map' defined but not
used make[2]: *** [sound/oss/soundcard.o] Error 1 make[1]: ***
[sound/oss] Error 2 make: *** [sound]

4) Do you have any idea of the source of error (or what to do)?

5) Also does "aplay" gets compiled with the kernel if you select ALSA
driver?
What we have to do to get "aplay" also compiled?

Hope kernel-2.6.14 / ALSA supports sound in OMAP1510 TI Innovator.

Thanks in advance
Regards
Prakash


-----Original Message-----
From: lamikr [mailto:lamikr@cc.jyu.fi] 
Sent: Thursday, March 16, 2006 11:42 PM
To: Daniel Petrini
Cc: Prakash Narayanan M; linux-omap-open-source@linux.omap.com
Subject: Re: ALSA with OMAP1510


>You should use "aplay test.raw" to play using alsa stack.
>  
>
Yes, for alsa driver the "aplay" should be the easiest solution.
I have myself used alsa succesfully with the tsc2101 chipset and latest
kernel in git repository (about 2.6.16-rc5)
by applying the 3 patches I and daniel send for the list about 10 days
ago.

Daniel tested the tsc2101 and aic23 drivers by using OSK and H2 boards.
I used myself omap1510 based h6300 for writing and testing. With that
board there were two issues compared to other devices that I needed to
handle.

1) I needed to add following to audio_process_dma() in
sound/arm/omap_alsa.c that was was not needed by other boards.
    Without this, the dma stopped after first small buffer transfered.
If you have problems you could enable that also for your boards.

#ifdef CONFIG_MACH_OMAP_H6300
        spin_lock_irqsave(&s->dma_lock, flags);
        omap_stop_alsa_sound_dma(s);
        spin_unlock_irqrestore(&s->dma_lock, flags);
#endif

2) In sound/arm/omap/omap-alsa-tsc2101.c tsc2101_snd_omap_alsa_playback
structure h6300 needs to be configured to have 8 bit dma.
(this is not yet in the patch sent to the list)

#ifdef CONFIG_MACH_OMAP_H6300
    .formats = (SNDRV_PCM_FMTBIT_S8),
#else
    .formats = (SNDRV_PCM_FMTBIT_S16_LE),
#endif

If you want to test the play with different samplerates, you can use a
program called "sox" for creating wavs with different samplerates.
(sox song.wav -r 8000 -c 1  -s -w song8000.wav)
**
Mika

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: ALSA with OMAP1510
  2006-03-17 12:21 Prakash Narayanan M
@ 2006-03-17 13:06 ` Komal Shah
  2006-03-17 13:42 ` Daniel Petrini
  1 sibling, 0 replies; 7+ messages in thread
From: Komal Shah @ 2006-03-17 13:06 UTC (permalink / raw)
  To: Prakash Narayanan M, linux-omap-open-source

--- Prakash Narayanan M <mnarayan@cedt.iisc.ernet.in> wrote:

> Hai
> 
> I am using TI Innovator OMAP1510 kit (This does not have tsc2101, but
> AIC23 is the codec and ADS7846 touch screen controller). Kernel
> 2.6.14
> toolchain gcc3.4.1. 
> 
> 1) While selecting ALSA in menuconfig (kernel 2.6.14), is it required

Please visit ALSA and OSS (Open Sound System) project webpages. aplay
is a user space application which calls the alsa library functions to
play the wav files. You should not use the raw interface /dev/dsp, as
was the case in OSS. Both are different projects, and you will see 
Open Sound System as deprecated (but still OMAP drivers are available)
in the menuconfig. 

I would suggest you to try OSS first. So you can easily test
with #cat test.wav > /dev/dsp :). 

In Menuconfig

Device Drivers -> Sound -> Sound Card Support -> Open Sound System ->
Open Sound System (Deprecated) -> OMAP Sound Driver -> AIC23 Stereo
codec

and build.



---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ALSA with OMAP1510
  2006-03-17 12:21 Prakash Narayanan M
  2006-03-17 13:06 ` Komal Shah
@ 2006-03-17 13:42 ` Daniel Petrini
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Petrini @ 2006-03-17 13:42 UTC (permalink / raw)
  To: Prakash Narayanan M; +Cc: linux-omap-open-source

Hi,

On 3/17/06, Prakash Narayanan M <mnarayan@cedt.iisc.ernet.in> wrote:
> Hai
>
> I am using TI Innovator OMAP1510 kit (This does not have tsc2101, but
> AIC23 is the codec and ADS7846 touch screen controller). Kernel 2.6.14
> toolchain gcc3.4.1.
>
> 1) While selecting ALSA in menuconfig (kernel 2.6.14), is it required to
> select AIC23 separately somewhere (I do not know where) for ALSA to
> work?

It should be automatically selected but you can confirm that looking
in Drivers/I2C SUpport/Micellaneous I2C Chips/TLV320AIC23 in make
menuconfig and select if not already.

> 2) If I select OSK5912 it gives the following error.
> ALSA / OSK5912 enabled sound/built-in.o(.text+0x3c16c):
> In function `$a':
> : undefined reference to `OMAP_DMA_CCR' sound/built-in.o(.text+0x3c178):
>
> In function `$a': : undefined reference to `OMAP_DMA_CCR'

Humm, I don't know about it. In my tests I could generate a 1510
kernel finely, although I can not test it.

> 3) If I select OSS driver also along with ALSA the following error is
> observed.
>
> OSS Sound modules / Persistent DMA buffers enabled
> sound/oss/soundcard.c:68: error: `MAX_DMA_CHANNELS' undeclared here (not
> in a function)
> sound/oss/soundcard.c:68: error: storage size of `dma_alloc_map' isn't
> known sound/oss/soundcard.c:68: warning: 'dma_alloc_map' defined but not
> used make[2]: *** [sound/oss/soundcard.o] Error 1 make[1]: ***
> [sound/oss] Error 2 make: *** [sound]

You should not select OSS along with ALSA, both in the main "Sound
Card Support" menu. There is an option inside  ALSA menu called "OSS
PCM" you can select it for OSS emulation if you wish.

> 4) Do you have any idea of the source of error (or what to do)?
>
> 5) Also does "aplay" gets compiled with the kernel if you select ALSA
> driver?
> What we have to do to get "aplay" also compiled?

Aplay is a user space application, you can install it in your file
system. You can use it in your PC, as well, as long as it has alsa
suport on it.

> Hope kernel-2.6.14 / ALSA supports sound in OMAP1510 TI Innovator.
>
> Thanks in advance
> Regards
> Prakash

Regards,
Daniel

> -----Original Message-----
> From: lamikr [mailto:lamikr@cc.jyu.fi]
> Sent: Thursday, March 16, 2006 11:42 PM
> To: Daniel Petrini
> Cc: Prakash Narayanan M; linux-omap-open-source@linux.omap.com
> Subject: Re: ALSA with OMAP1510
>
>
> >You should use "aplay test.raw" to play using alsa stack.
> >
> >
> Yes, for alsa driver the "aplay" should be the easiest solution.
> I have myself used alsa succesfully with the tsc2101 chipset and latest
> kernel in git repository (about 2.6.16-rc5)
> by applying the 3 patches I and daniel send for the list about 10 days
> ago.
>
> Daniel tested the tsc2101 and aic23 drivers by using OSK and H2 boards.
> I used myself omap1510 based h6300 for writing and testing. With that
> board there were two issues compared to other devices that I needed to
> handle.
>
> 1) I needed to add following to audio_process_dma() in
> sound/arm/omap_alsa.c that was was not needed by other boards.
>     Without this, the dma stopped after first small buffer transfered.
> If you have problems you could enable that also for your boards.
>
> #ifdef CONFIG_MACH_OMAP_H6300
>         spin_lock_irqsave(&s->dma_lock, flags);
>         omap_stop_alsa_sound_dma(s);
>         spin_unlock_irqrestore(&s->dma_lock, flags);
> #endif
>
> 2) In sound/arm/omap/omap-alsa-tsc2101.c tsc2101_snd_omap_alsa_playback
> structure h6300 needs to be configured to have 8 bit dma.
> (this is not yet in the patch sent to the list)
>
> #ifdef CONFIG_MACH_OMAP_H6300
>     .formats = (SNDRV_PCM_FMTBIT_S8),
> #else
>     .formats = (SNDRV_PCM_FMTBIT_S16_LE),
> #endif
>
> If you want to test the play with different samplerates, you can use a
> program called "sox" for creating wavs with different samplerates.
> (sox song.wav -r 8000 -c 1  -s -w song8000.wav)
> **
> Mika
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>


--
INdT - Manaus - Brazil

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-03-17 13:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-16 12:25 ALSA with OMAP1510 Prakash Narayanan M
2006-03-16 17:27 ` Daniel Petrini
2006-03-16 17:29   ` Daniel Petrini
2006-03-16 18:12   ` lamikr
  -- strict thread matches above, loose matches on Subject: below --
2006-03-17 12:21 Prakash Narayanan M
2006-03-17 13:06 ` Komal Shah
2006-03-17 13:42 ` Daniel Petrini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox