Hello.�

I have a problem capturing sound from my sound card.� I am just capturing a buffer full of Zeros.� Have tried putting my audio input �into both line-in and mic inputs of my sound card but just get zeros.

 

I have installed ALSA drivers, libraries and utils 0.9.0rc6 �and am using Red Hat Linux 7.2.� My sound card is a Cirrus Logic CS46xx.�� Have run alsamixer and everything is now unmuted.

 

My /etc/modules.conf is included at the end of this message.� I have loaded the following modules - modprobe snd-cs46xx;modprobe snd-pcm-oss;modprobe snd-mixer-oss;modprobe snd

 

I have successfully compiled/linked two example programs which are supposed to demonstrate minimum capture, and minimum playback.� I found these on the Internet (“A tutorial on using the Alsa Audio Api”).� I use hw:0,0 as the device argument to both �programs.� The minimum playback example works ok and produces a buzzing sound from �the pc speaker.� However, I have examined the contents of the buffer after the minimum capture program and it is full of 0s!�

 

I have included the lines of code where the capture is implemented:

for (i = 0; i < 10; ++i) {
������� if ((err = snd_pcm_readi (capture_handle, buf, 128)) != 128) {
������������������������������ fprintf (stderr, "read from audio interface failed (%s)\n",
�������������������������������������  snd_strerror (err));
������������������������������ exit (1);
���������������������� }
 
Before capture, buf[128] contains 128 random values, after capture, buf[128] contains 128 zeros.� 
 
I can’t see think of anything that I’ve done anything wrong so any help/advice will greatly appreciated as I am attempting to write a sound server using ALSA but cannot progress until I have resolved this problem.

 

Regards,

 

Pete

 

#/etc/modules.conf

alias parport_lowlevel parport_pc

alias eth0 3c59x

alias usb-controller usb-uhci

alias char-major-10-135 usbcore

#alias sound-slot-0 cs46xx

#post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :

#pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :

# ALSA portion

alias char-major-116 snd

alias snd-card-0 snd-cs46xx

# module options should go here

 

# OSS/Free portion

alias char-major-14 soundcore

alias sound-slot-0 snd-card-0

 

# card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

 

# end of /etc/modules.conf

 

 

 

Reply via email to