All of lore.kernel.org
 help / color / mirror / Atom feed
* Question: setting up the hardware for alsa
@ 2005-11-04 15:49 David Smoot
  2005-11-04 16:13 ` James Courtier-Dutton
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: David Smoot @ 2005-11-04 15:49 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]

Greetings, first post to the list and hopefully a simple question:

My company builds Linux based telemetry systems. We are working on an
airborne telemetry platform. The customer has expressed a desire to record
the pilot voice traffic on the data stream with the other data from the
instruments.

We use a stripped down kernel and build pretty much everything by hand. I'm
attempting to set up ALSA so I can pull the audio data from the line in.

Here's what I have done so far:
1. Bought the cheapest supported card I could find on the matrix for testing
(Sound Blaster Live 24Bit, ca0106 driver)

2. Recompiled my kernel to have sound, ALSA, and the appropriate card driver
all built as modules.

3. made scripts to make my device nodes (I'm running the root file system on
a ramdisk so I create my nodes each time I boot plus this lets me run a
minimal kernel and customize it to my environment)
mknod /dev/mixer c 14 0
mknod /dev/mixer1 c 14 16
mknod /dev/mixer2 c 14 32
mknod /dev/mixer3 c 14 48
mknod /dev/dsp c 14 3
mknod /dev/dsp1 c 14 19
mknod /dev/dsp2 c 14 35
mknod /dev/dsp3 c 14 51
mknod /dev/audio c 14 4
mknod /dev/audio1 c 14 20
mknod /dev/audio2 c 14 36
mknod /dev/audio3 c 14 52
mknod /dev/sndstat c 14 6
mknod /dev/audioctl c 14 7

4. Made another script to load my kernel modules
/run/tools/insmod soundcore.ko
/run/tools/insmod snd.ko
/run/tools/insmod snd-timer.ko
/run/tools/insmod snd-page-alloc.ko
/run/tools/insmod snd-pcm.ko
/run/tools/insmod snd-ac97-codec.ko #I inserted this because it is selected
by the ca0106 module
/run/tools/insmod snd-ca0106.ko

5. I copied libasound to my libraries folder.

At this point I at least knew libasound was OK because I could execute some
simple code that listed libasound data types and parameters.

But I can't open any devices and talk to them. I know I am missing some kind
of crucial step in setting up the hw:0,0 device but I can't seem to figure
out the next step. I've read tutorials, googled, but I am stuck. If someone
would point me to the proper documents I would be grateful.

David

[-- Attachment #2: Type: text/html, Size: 2414 bytes --]

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

* Re: Question: setting up the hardware for alsa
  2005-11-04 15:49 Question: setting up the hardware for alsa David Smoot
@ 2005-11-04 16:13 ` James Courtier-Dutton
  2005-11-04 17:33   ` David Smoot
  2005-11-04 16:14 ` James Courtier-Dutton
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: James Courtier-Dutton @ 2005-11-04 16:13 UTC (permalink / raw)
  To: David Smoot; +Cc: alsa-devel

David Smoot wrote:
> Greetings, first post to the list and hopefully a simple question:
> 
> My company builds Linux based telemetry systems. We are working on an
> airborne telemetry platform. The customer has expressed a desire to record
> the pilot voice traffic on the data stream with the other data from the
> instruments.
> 
> We use a stripped down kernel and build pretty much everything by hand. I'm
> attempting to set up ALSA so I can pull the audio data from the line in.
> 
> At this point I at least knew libasound was OK because I could execute some
> simple code that listed libasound data types and parameters.
> 
> But I can't open any devices and talk to them. I know I am missing some kind
> of crucial step in setting up the hw:0,0 device but I can't seem to figure
> out the next step. I've read tutorials, googled, but I am stuck. If someone
> would point me to the proper documents I would be grateful.
> 
> David
> 

The ca0106 alsa driver is quite new and as such might not be the most 
reliable driver to use for avionics systems. Line in/Mic input was only 
recently added to the driver, so it would be important for you to tell 
us which alsa version you are using. The following will tell you.
cat /proc/asound/version.

Another problem you will have is noise on the input. Special care has to 
be taken when recording voice in an aircraft.

A good application to use to test voice capture is arecord.
The ca0106 card is very basic, and you should only really use a capture 
rate of 48000 Hz if you want any sort of quality captured. You can 
resample it in your application to a lower rate, or compress it using a 
codec before transmission over the telemetry link. The ca0106 is 
particulary bad at 44100 Hz, but should be ok at rates 24000, 12000,8000 Hz

You should open the devices directly, but instead use the libasound 
snd_pcm_open() call.

James



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

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

* Re: Question: setting up the hardware for alsa
  2005-11-04 15:49 Question: setting up the hardware for alsa David Smoot
  2005-11-04 16:13 ` James Courtier-Dutton
@ 2005-11-04 16:14 ` James Courtier-Dutton
  2005-11-06  0:45 ` Lee Revell
  2005-11-07 10:26 ` Clemens Ladisch
  3 siblings, 0 replies; 9+ messages in thread
From: James Courtier-Dutton @ 2005-11-04 16:14 UTC (permalink / raw)
  To: David Smoot; +Cc: alsa-devel

David Smoot wrote:
> Greetings, first post to the list and hopefully a simple question:
> 
> My company builds Linux based telemetry systems. We are working on an
> airborne telemetry platform. The customer has expressed a desire to record
> the pilot voice traffic on the data stream with the other data from the
> instruments.
> 
> We use a stripped down kernel and build pretty much everything by hand. I'm
> attempting to set up ALSA so I can pull the audio data from the line in.
> 
> At this point I at least knew libasound was OK because I could execute some
> simple code that listed libasound data types and parameters.
> 
> But I can't open any devices and talk to them. I know I am missing some kind
> of crucial step in setting up the hw:0,0 device but I can't seem to figure
> out the next step. I've read tutorials, googled, but I am stuck. If someone
> would point me to the proper documents I would be grateful.
> 
> David
> 

The ca0106 alsa driver is quite new and as such might not be the most 
reliable driver to use for avionics systems. Line in/Mic input was only 
recently added to the driver, so it would be important for you to tell 
us which alsa version you are using. The following will tell you.
cat /proc/asound/version.

Another problem you will have is noise on the input. Special care has to 
be taken when recording voice in an aircraft.

A good application to use to test voice capture is arecord.
The ca0106 card is very basic, and you should only really use a capture 
rate of 48000 Hz if you want any sort of quality captured. You can 
resample it in your application to a lower rate, or compress it using a 
codec before transmission over the telemetry link. The ca0106 is 
particulary bad at 44100 Hz, but should be ok at rates 24000, 12000,8000 Hz

You should open the devices directly, but instead use the libasound 
snd_pcm_open() call.

James



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

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

* Re: Question: setting up the hardware for alsa
  2005-11-04 16:13 ` James Courtier-Dutton
@ 2005-11-04 17:33   ` David Smoot
  2005-11-05 23:34     ` Sasha Khapyorsky
  0 siblings, 1 reply; 9+ messages in thread
From: David Smoot @ 2005-11-04 17:33 UTC (permalink / raw)
  To: James Courtier-Dutton; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 2713 bytes --]

Sorry, it appears I did not provide enough detail. I am playing with the
tutorial from the linuxjournal:
http://www.linuxjournal.com/article/6735

I can compile and run the first listing, it just prints out some variables
set up by the soundalib. But the second listing that actually calls
"snd_pcm_open"
fails because it cannot open the default device.

So I believe I am failing somewhere to set some variable or parameter that
tells ALSA what the default devices is. All I am doing so far is creating
the nodes and loading the sound modules. I'm thinking I am missing one more
step. Any suggestions?

David
On 11/4/05, James Courtier-Dutton <James@superbug.co.uk> wrote:
>
> David Smoot wrote:
> > Greetings, first post to the list and hopefully a simple question:
> >
> > My company builds Linux based telemetry systems. We are working on an
> > airborne telemetry platform. The customer has expressed a desire to
> record
> > the pilot voice traffic on the data stream with the other data from the
> > instruments.
> >
> > We use a stripped down kernel and build pretty much everything by hand.
> I'm
> > attempting to set up ALSA so I can pull the audio data from the line in.
> >
> > At this point I at least knew libasound was OK because I could execute
> some
> > simple code that listed libasound data types and parameters.
> >
> > But I can't open any devices and talk to them. I know I am missing some
> kind
> > of crucial step in setting up the hw:0,0 device but I can't seem to
> figure
> > out the next step. I've read tutorials, googled, but I am stuck. If
> someone
> > would point me to the proper documents I would be grateful.
> >
> > David
> >
>
> The ca0106 alsa driver is quite new and as such might not be the most
> reliable driver to use for avionics systems. Line in/Mic input was only
> recently added to the driver, so it would be important for you to tell
> us which alsa version you are using. The following will tell you.
> cat /proc/asound/version.
>
> Another problem you will have is noise on the input. Special care has to
> be taken when recording voice in an aircraft.
>
> A good application to use to test voice capture is arecord.
> The ca0106 card is very basic, and you should only really use a capture
> rate of 48000 Hz if you want any sort of quality captured. You can
> resample it in your application to a lower rate, or compress it using a
> codec before transmission over the telemetry link. The ca0106 is
> particulary bad at 44100 Hz, but should be ok at rates 24000, 12000,8000
> Hz
>
> You should open the devices directly, but instead use the libasound
> snd_pcm_open() call.
>
> James
>
>

[-- Attachment #2: Type: text/html, Size: 3239 bytes --]

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

* Re: Question: setting up the hardware for alsa
  2005-11-04 17:33   ` David Smoot
@ 2005-11-05 23:34     ` Sasha Khapyorsky
  2005-11-06  0:32       ` Lee Revell
  0 siblings, 1 reply; 9+ messages in thread
From: Sasha Khapyorsky @ 2005-11-05 23:34 UTC (permalink / raw)
  To: David Smoot; +Cc: James Courtier-Dutton, alsa-devel

On 11:33 Fri 04 Nov     , David Smoot wrote:
> 
> I can compile and run the first listing, it just prints out some variables
> set up by the soundalib. But the second listing that actually calls
> "snd_pcm_open"
> fails because it cannot open the default device.

You probably need to copy (create) some minimalistic configuration set
(such as in alsa-lib/src/conf ) in order to use "default" or "hw" device
names.

Sasha.


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

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

* Re: Question: setting up the hardware for alsa
  2005-11-05 23:34     ` Sasha Khapyorsky
@ 2005-11-06  0:32       ` Lee Revell
  0 siblings, 0 replies; 9+ messages in thread
From: Lee Revell @ 2005-11-06  0:32 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: David Smoot, James Courtier-Dutton, alsa-devel

On Sun, 2005-11-06 at 01:34 +0200, Sasha Khapyorsky wrote:
> On 11:33 Fri 04 Nov     , David Smoot wrote:
> > 
> > I can compile and run the first listing, it just prints out some variables
> > set up by the soundalib. But the second listing that actually calls
> > "snd_pcm_open"
> > fails because it cannot open the default device.
> 
> You probably need to copy (create) some minimalistic configuration set
> (such as in alsa-lib/src/conf ) in order to use "default" or "hw" device
> names.
> 

Actually you should not have to do this - alsa-lib should open the
file /usr/share/alsa/cards/CA0106.conf which defines the default PCM for
this card.

Try stracing your app and verify that it's trying to open that file.

Lee



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

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

* Re: Question: setting up the hardware for alsa
  2005-11-04 15:49 Question: setting up the hardware for alsa David Smoot
  2005-11-04 16:13 ` James Courtier-Dutton
  2005-11-04 16:14 ` James Courtier-Dutton
@ 2005-11-06  0:45 ` Lee Revell
  2005-11-06 17:46   ` David Smoot
  2005-11-07 10:26 ` Clemens Ladisch
  3 siblings, 1 reply; 9+ messages in thread
From: Lee Revell @ 2005-11-06  0:45 UTC (permalink / raw)
  To: David Smoot; +Cc: alsa-devel

On Fri, 2005-11-04 at 09:49 -0600, David Smoot wrote:
> 5.  I copied libasound to my libraries folder.
> 
> At this point I at least knew libasound was OK because I could
> execute some simple code that listed libasound data types and
> parameters.
> 
> But I can't open any devices and talk to them.  I know I am missing
> some kind of crucial step in setting up the hw:0,0 device but I can't
> seem to figure out the next step.  I've read tutorials, googled, but I
> am stuck.  If someone would point me to the proper documents I would
> be grateful.
> 

Ah, this is the problem.  It's not sufficient to just copy the libasound
binary into your LD_LIBRARY_PATH.  Alsa-lib needs these files too:

/usr/share/alsa/alsa.conf
/usr/share/alsa/pcm/*
/usr/share/alsa/cards/*

Why not just run "make install" instead of trying to install alsa-lib by
hand?

Lee



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

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

* Re: Question: setting up the hardware for alsa
  2005-11-06  0:45 ` Lee Revell
@ 2005-11-06 17:46   ` David Smoot
  0 siblings, 0 replies; 9+ messages in thread
From: David Smoot @ 2005-11-06 17:46 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

I have to do a hand install... My box that I am wanting to eventually
capture data on is a very limited, special purpose device. It does not have
gcc or support for building native. Thanks for the tips though, it is good
to know what my configuration files are. I'm taking it easier and installing
first on one of my full development systems.

David


On 11/5/05, Lee Revell <rlrevell@joe-job.com> wrote:
>
> On Fri, 2005-11-04 at 09:49 -0600, David Smoot wrote:
> > 5. I copied libasound to my libraries folder.
> >
> > At this point I at least knew libasound was OK because I could
> > execute some simple code that listed libasound data types and
> > parameters.
> >
> > But I can't open any devices and talk to them. I know I am missing
> > some kind of crucial step in setting up the hw:0,0 device but I can't
> > seem to figure out the next step. I've read tutorials, googled, but I
> > am stuck. If someone would point me to the proper documents I would
> > be grateful.
> >
>
> Ah, this is the problem. It's not sufficient to just copy the libasound
> binary into your LD_LIBRARY_PATH. Alsa-lib needs these files too:
>
> /usr/share/alsa/alsa.conf
> /usr/share/alsa/pcm/*
> /usr/share/alsa/cards/*
>
> Why not just run "make install" instead of trying to install alsa-lib by
> hand?
>
> Lee
>
>

[-- Attachment #2: Type: text/html, Size: 1767 bytes --]

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

* Re: Question: setting up the hardware for alsa
  2005-11-04 15:49 Question: setting up the hardware for alsa David Smoot
                   ` (2 preceding siblings ...)
  2005-11-06  0:45 ` Lee Revell
@ 2005-11-07 10:26 ` Clemens Ladisch
  3 siblings, 0 replies; 9+ messages in thread
From: Clemens Ladisch @ 2005-11-07 10:26 UTC (permalink / raw)
  To: David Smoot; +Cc: alsa-devel

David Smoot wrote:
> 3. made scripts to make my device nodes
> mknod /dev/mixer c 14 0
> ...

ALSA devices are in /dev/snd/; see the snddevices script in the alsa-driver
package.

> 4. Made another script to load my kernel modules
> /run/tools/insmod soundcore.ko
> ...

If you use the OSS emulation (/dev/dsp etc.), you have to load the snd-xxx-oss
modules.


HTH
Clemens


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

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

end of thread, other threads:[~2005-11-07 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 15:49 Question: setting up the hardware for alsa David Smoot
2005-11-04 16:13 ` James Courtier-Dutton
2005-11-04 17:33   ` David Smoot
2005-11-05 23:34     ` Sasha Khapyorsky
2005-11-06  0:32       ` Lee Revell
2005-11-04 16:14 ` James Courtier-Dutton
2005-11-06  0:45 ` Lee Revell
2005-11-06 17:46   ` David Smoot
2005-11-07 10:26 ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.