0

I have two problems with my usb soundcard.

  1. It shows only single input channel (even though it is stereo capable , tested in Windows OS which correctly identifies as stereo )
  2. Shows only supports 48000 sample rate. I need 44100 sample rate

I have no idea whether supported sample rate has anything to do with hardware compatibility but when i plug it in to windows, it shows 44100 to the list of compatible sample rates.

I believe these settings should be software configurable or at the worst i need to re-configure the driver to make it accept two channels and 44.1k sample rate.

I've been trying many different approaches since several weeks but haven't been able to get any closer.

The device I am using: http://www.ebay.com/itm/USB-2-0-Video-Audio-VHS-RCA-to-DVD-Grabber-Capture-Card-Adapter-For-WIN7-8-10-XP-/351984239268?hash=item51f3e542a4:g:nzgAAOSwWxNYpWo5

I'm trying to use this device to record the audio from the audio in port. I'm using python.

$ lusub
Bus 001 Device 005: ID 18ec:5850 Arkmicro Technologies Inc.

By using python soundevice module to list the device

$ python -m sounddevice
USB2.0 PC CAMERA: Audio (hw:1,0), ALSA (1 in, 0 out)

When I use pyaudio (python module) to get the device detail

$  pa = pyaudio.PyAudio()
$  pa.get_device_info_by_index(2)

This shows device default sample rate as 48000 and no of channels = 1

I am using pyaudio to record the sound

self.stream = self.audio.open(
                format=self.FORMAT,
                channels=self.CHANNELS,
                rate=AUDIO_SAMPLING_RATE,
                input=True,
                frames_per_buffer=AUDIO_BUFFER_SIZE,
                input_device_index=self.device_index
            )

And when I set AUDIO_SAMPLING_RATE=44100 it throws error saying the device doesn't support 44100 sample rate

When I run the same python code in windows everything works fine.

  • How have you been testing the card's capabilities on the Pi? Can you edit your question to include the commands you used, and the output from those commands? – goobering Apr 7 '17 at 10:36
  • @goobering i've added python code samples – Dipesh KC Apr 7 '17 at 10:50
1

You can investigate more about the capabilities of the sound card by investigating the proc directory :

cat /proc/asound/cards

Choosing an available card and looking at its capabilities :

cat /proc/asound/card0/codec#0 

Assuming that your card only supports 44100 Hz sample rates, then you can purchase a better sound card or use an ALSA plugin to do rate conversion for you in software.

To get a higher quality sound card which plugs into the GPIO connector, check this incomplete list here.

Regarding plugins :

You can see the available plugins using arecord -L. For example in your .asoundrc file your can convert rate on the fly using the following setup :

pcm_slave.usb441 {
    pcm "hw:1,0"
    rate 44100
}

pcm.rate_convert {
    type rate
    slave usb441
}

Now you should be able to aplay and arecord using that device :

arecord -Drate_convert

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.