Cole1717
Posts: 29
Joined: Mon Mar 16, 2015 10:44 pm

How to get mic soundcard input to work.

Wed Sep 09, 2015 9:46 pm

Does anyone know how to setup the soundcard so that i can connect music to it and read it from my pi?

fruitoftheloom
Posts: 20735
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How to get mic soundcard input to work.

Thu Sep 10, 2015 4:27 am

Cole1717 wrote:Does anyone know how to setup the soundcard so that i can connect music to it and read it from my pi?
The Raspberry Pi has no Sound Input only Output ;)
Retired disgracefully.....

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: How to get mic soundcard input to work.

Thu Sep 10, 2015 4:35 am

You could add a USB soundcard. They are cheap, and have an audio input socket (and another audio output).

Cole1717
Posts: 29
Joined: Mon Mar 16, 2015 10:44 pm

Re: How to get mic soundcard input to work.

Thu Sep 10, 2015 11:56 am

Sorry, I should have been clearer. I have a USB soundcard that I know is compatible with the pi plugged in. I have gotten the pi to default its output through the card, now I want to know how to read input from the card.

Thanks!

User avatar
RaTTuS
Posts: 10459
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to get mic soundcard input to work.

Thu Sep 10, 2015 11:59 am

post a link to it and
what does
lsusb
say
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

fruitoftheloom
Posts: 20735
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How to get mic soundcard input to work.

Thu Sep 10, 2015 12:11 pm

Cole1717 wrote:Sorry, I should have been clearer. I have a USB soundcard that I know is compatible with the pi plugged in. I have gotten the pi to default its output through the card, now I want to know how to read input from the card.

Thanks!
https://c.getsatisfaction.com/plugable/ ... spberry-pi
Retired disgracefully.....

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: How to get mic soundcard input to work.

Sat Sep 12, 2015 1:08 pm

Cole1717 wrote:I have gotten the pi to default its output through the card
how you do that?

if i follow @fruitoftheloom link and edit
sudo nano /etc/modprobe.d/alsa-base.conf

Code: Select all

options snd-usb-audio index=0
options snd_bcm2835 index=1
i can record and play

Code: Select all

arecord -d 5 -f cd xfiles.wav
aplay xfiles.wav
but as soon i start the first time the desktop it not works anymore.

in the desktop is the audio tool xfce4-mixer
that only works for the internal sound, even
https://www.raspberrypi.org/blog/anothe ... ce-update/
states you can select source ( or select device and make default )
but i can not.

anyhow, as soon it starts the first time it writes a file
/home/pi/.asoundrc
with card 0 default
( if you have above change in /etc/modprobe.d/alsa-base.conf it makes card 1 default / so all no use )

you can make your own /home/pi/.asoundrc in 2 ways:
-a- you define your USB sound card ( what might be card 1 ) as default
-b- or leave the default to the useless desktop tool
and add your card.
while aplay -l gives me

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
i config in .asoundrc

Code: Select all

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

pcm.ALSA {
type hw
card 0
}

ctl.ALSA {
type hw
card 0
}

pcm.Device {
type plug slave {
pcm "hw:1,0"
}
}

ctl.Device {
type hw
card 1
}
i just use the same stupid word "Device" like i see it in "aplay -l"
but it works also with other names like "USB"...
anyhow that name can be used now with the -D switch
arecord -d 5 -DDevice -f cd xfiles.wav
Recording WAVE 'xfiles.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay -DDevice xfiles.wav
Playing WAVE 'xfiles.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
for adjust volume ... run
alsamixer [F6][F5]
so far about CLI record and play.

much better is
sudo apt-get install audacity
Image
where you can select input and output device / card as you wish.

i hope some specialist can help to get the desktop xfce4-mixer configured so the operation of USB sound card works again.
( or is it just my 3$ USB "Device" )

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: How to get mic soundcard input to work.

Tue Sep 15, 2015 8:21 am

sorry to bump this, but i would like to have some feedback,

is the desktop (xfce4-mixer) USB sound card selection and operation working? or are only some cards supported...?

Return to “Graphics, sound and multimedia”