jdb wrote:A workaround is to capture at 48kHz and resample using Alsa to 44.1kHz. Libresample has a range of conversion filters for this purpose. In fact, 96kHz stereo capture should even be useable.
I have no idea what you would need to add to ~/.asoundrc to get it to work, though.
I have an idea
My .asoundrc for the Wolfson sound card might work with only small changes.
You would have to change the card name:
to whatever the C-Media card is (probably "Device", check with "aplay -l")
and possibly the card number. I have my Wolfson set up as card 0.
Code: Select all
#######################################################################
#
# Use libsamplerate instead of internal resampler.
# You might have to: sudo apt-get install libasound2-plugins
# Or just comment out the next line if the internal one is good enough for your needs.
defaults.pcm.rate_converter "samplerate"
######################################################################
#
# Wolfson Audio Card for Raspberry Pi
#
pcm.my_virtual_sound_card {
type hw
# CHANGE TO YOUR DRIVER NAME BELOW
card sndrpiwsp
device 0
}
# Create a Master volume control
pcm.softvol {
type softvol
slave {
pcm "pduplex"
}
control {
name "Master"
card 0
}
}
pcm.!default {
type asym
playback.pcm "plug:softvol"
capture.pcm "pduplex"
}
#####################################################################
#
# Mixing and resampling goodness :-)
#
# Several clients can record and play back simultaneously.
# The dmix and dsnoop plugins operate at 48kHz by default, i.e. the sound card will be kept at 48kHz at all times.
# All playback streams are converted to 2 channels/48kHz/16bit.
# All recording streams are converted from the card's 2 channels/48kHz/16bit
# to the requested number of channels, sample rate and bit depth.
# We define one pcm device called "playmixer" for playback.
pcm.playmixer {
ipc_key 140324 # Any number will do, as long as it's unique in the system.
ipc_key_add_uid true
type dmix
slave.pcm "my_virtual_sound_card"
}
# Define another one called "recmixer" for capture.
# The sound card will run at 48kHz and input is resampled to the requested rate.
pcm.recmixer {
ipc_key 140325
ipc_key_add_uid true
type dsnoop
slave.pcm "my_virtual_sound_card"
}
# Define a duplex device, with both in- and outputs.
pcm.duplex {
type asym
playback.pcm "playmixer"
capture.pcm "recmixer"
}
# Add a "plug" plugin for the above "duplex" device.
# This is where all the converting takes place.
# Sample rate, number of channels, bit depth.
# By the way, who thought that "plug" was a good name for a plugin?
#
pcm.pduplex {
type plug
slave.pcm "duplex"
}
# A ctl device to keep xmms happy
ctl.pduplex {
type hw
card 0
}
# A DSP to keep the alsa-oss layer happy:
pcm.dsp0 {
type plug
slave.pcm "duplex"
}
ctl.mixer0 {
type hw
card 0
}
--
Ragnar