Re: USB Audio on Raspberry Pi


Mike AE4ML
 

Heiko,
Sorry to say that idea didn't work. I was never able to get the script to work with the raspberry pi onboard audio at all. Only tracebacks and errors from the script.

Is there a list of known working USB audio  devices ?


sounddevice only installed as a python3 failed on install for python

pi@raspberrypi:~ $ python3 -m sounddevice
< 0 bcm2835 ALSA: - (hw:0,0), ALSA (0 in, 2 out)
  1 bcm2835 ALSA: IEC958/HDMI (hw:0,1), ALSA (0 in, 2 out)


pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/7
  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
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


 Traceback (most recent call last):
                                                                                                                                     File "USRPAudio.py", line 106, in txAudioStream
      frames_per_buffer = CHUNK,
                                 
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
                                                                                                          
stream = Stream(self, *args, **kwargs)
                                                                                                                                                   File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 441, in __init__
                                         
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
                                                                                                                                   Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2722
                                                                                                                                          Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
                                                                                                                                                                                     self._stream = pa.open(**arguments)
                                     
IOError: [Errno -9996] Invalid input device (no default output device)
                                                                                                           
Unhandled exception in thread started by <function rxAudioStream at 0x76765f70>
         Traceback (most recent call last):
                                            
File "USRPAudio.py", line 42, in rxAudioStream
                                                                                              
output_device_index=0,
                                                                                                                      
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
             
stream = Stream(self, *args, **kwargs)
                                                     
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 441, in __init__
                                                                                                                                   self._stream = pa.open(**arguments)
                                                                                                                                                                      IOError: [Errno -9997] Invalid sample rate

Join main@DVSwitch.groups.io to automatically receive all group messages.