Resources for “Introduction to Sound Programming with ALSA”

ALSA Project: www.alsa-project.org

Alternate Sound APIs:

aRts and CSL: www.arts-project.org

JACK: jackit.sourceforge.net

OpenAL: www.openal.org/home

SDL: www.libsdl.org

Sound and MIDI Software for Linux: linux-sound.org

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

do u know how to solve this e

hardik's picture

do u know how to solve this error i got the same error
plz tell me how to link the programme with alsa library
hardik

simple capture program doesn't record nothing...

Marco Antonio Lopez Trinidad's picture

I typed the simple playing program and I made some tests, it works almost with no problems.

However, this is not the case for the simple capture program. It is typed like the article says, I compiled and no errors, but the file where the result is redirected has in appearence not information. I played the content of this file with the simple playing. I have tried with different inputs, the CD and the MIC on the KMix interface without many success. The same happens with the 6735l4.c file, there is any idea???
The version of the ALSA API is 1.0.8rc2.
thanx,

--marco.

Am I missing something?

Geoff's picture

I expected to find the listings from the article, transcribed for compillation by the lazy. But no?

problems compiling listing 1

Anonymous's picture

I get this when I try to run listing 1. I am using alsa version 1.0.6
Do I need to link something?

> /tmp/ccY117TW.o(.text+0x47): In function `main':
> : undefined reference to `snd_pcm_stream_name'
> /tmp/ccY117TW.o(.text+0x84): In function `main':
> : undefined reference to `snd_pcm_access_name'
> /tmp/ccY117TW.o(.text+0xc1): In function `main':
> : undefined reference to `snd_pcm_format_name'
> /tmp/ccY117TW.o(.text+0xd0): In function `main':
> : undefined reference to `snd_pcm_format_description'
> /tmp/ccY117TW.o(.text+0xdd): In function `main':
> : undefined reference to `snd_pcm_format_name'
> /tmp/ccY117TW.o(.text+0x11e): In function `main':
> : undefined reference to `snd_pcm_subformat_description'
> /tmp/ccY117TW.o(.text+0x12b): In function `main':
> : undefined reference to `snd_pcm_subformat_name'
> /tmp/ccY117TW.o(.text+0x16c): In function `main':

Re: problems compiling listing 1

Anonymous's picture

use -lasound

Re: Resources for Introduction to Sound Programming with ALSA

Anonymous's picture

I am using ALSA version 1.6a and seem to be having problems with listing2,3 and 4. I keep getting the error "unable to set hw parameters: Invalid argument -22" I added the -22 by printing the rc value. The error is caused by the snd_pcm_hw_params( handle, params) call to write the parameters to the driver. I looked at the ALSA documentation and can't seem to find a breakdown of the params struct. It would help if I knew what parameter are bad.

Re: Resources for Introduction to Sound Programming with ALSA

Anonymous's picture

the variable dir needs to be initialized to 0. This will make at least listing 2 work. I suspect that it will make listings 3 and 4 work as well.

d!

Re: Resources for Introduction to Sound Programming with ALSA

Anonymous's picture

I have a similar problem, with listing four only. It seems that may Soundblaster live does not accept a sampling rate of 44100. However, a smpling rate of 88200 is accepted. (I have not got any sound yet, but that may be due to other things.)

Re: Resources for Introduction to Sound Programming with ALSA

Anonymous's picture

I'm struggling with the same problem.

Help!

Philip

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState