Date   

Re: USB Audio on Raspberry Pi

Heiko DL1BZ
 

I re-check all. Here all works with my onboard-sound-device:
root@mmdvmpi:~# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: ALSA [bcm2835 ALSA], Gerät 0: bcm2835 ALSA [bcm2835 ALSA]
  Sub-Geräte: 7/7
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
  Sub-Gerät #3: subdevice #3
  Sub-Gerät #4: subdevice #4
  Sub-Gerät #5: subdevice #5
  Sub-Gerät #6: subdevice #6
Karte 0: ALSA [bcm2835 ALSA], Gerät 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
root@mmdvmpi:~#
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
                                                                                                          Start audio thread...
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818

                                                                                                                                        Unhandled exception in thread started by <function txAudioStream at 0x767804b0>
                           Traceback (most recent call last):
                                                               File "./USRPAudio.py", line 114, in txAudioStream
                                                                                                                    input_device_index=2,
                                                                                                                                           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 -9998] Invalid number of channels
                                     START:  10.03.19 17:05:57 DL1BZ Slot:2 TG:7

END:    10.03.19 17:05:57 DL1BZ Slot:2 TG:7 BER:0.00% 3.29s

The error message because "Invalid number of channels" you can ignore.
I can hear me if  I sent something in DMR as a monitor.
Maybe you need to check your system - I verify this on 3 different Pi (2x Pi3B+ and 1x Pi3B) - so I need to say it works like I wrote.

73 Heiko, DL1BZ


Re: USB Audio on Raspberry Pi

Heiko DL1BZ
 

give me a little time I will be re-check all. I‘m running rasbian-lite (debian stretch) with the last 4.14.98+ kernel.
All what I can say I had a running monitoring with the build-in sound output, and I had deinstall pulseaudio.
I will be back here later...

73 Heiko, DL1BZ


Re: USB Audio on Raspberry Pi

Mike AE4ML
 

My use for this setup is for monitoring only,  I'm really not interested in transmitting .
I have a radio for that..

Mike


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


Re: Analog audio streaming

sv1hep@...
 

Thank you Kevin for info.
I digging in python files for a treasure.

73' Chris SV1HEP


Re: USB Audio on Raspberry Pi

Heiko DL1BZ
 
Edited

Look in the python script, you see the sampling rate is 8000 (=8khz). I had the same problem with a cheap CM108 based usb soundcard, which only support 44,1 or 48khz. A "better" soundcard I used worked from 6khz-48 Khz. As I understand, for correct transcoding to dmr the sampling rate of soundcard need exact 8hkz (=8000), other values don't work. If the soundcard don't support this rate, you cannot use it with pyaudio in USRPAudio.py . For test you can (but only for output) use the buildin sound-output of a raspberry pi, whichs works too with the python-script.

For select an other sounddevice as the default, you need to extend the script:
def rxAudioStream():
...
stream = p.open(format=FORMAT,
                    channels = CHANNELS,
                    rate = RATE,
                    output = True,
                    frames_per_buffer = CHUNK,
                    output_device_index=0,
                    )

def txAudioStream():
...
stream = p.open(format=FORMAT,
                    channels = CHANNELS,
                    rate = RATE,
                    input = True,
                    frames_per_buffer = CHUNK,
                    input_device_index=2,
                    )    

For index info of sounddevices you can use:
$ python -m sounddevice
pi@PISHACK:~ $ python -m sounddevice
  0 bcm2835 ALSA: - (hw:0,0), ALSA (0 in, 2 out)
  1 Loopback: PCM (hw:1,0), ALSA (32 in, 32 out)
  2 Loopback: PCM (hw:1,1), ALSA (32 in, 1 out)
  3 sysdefault, ALSA (0 in, 128 out)
* 4 default, ALSA (32 in, 32 out)
pi@PISHACK:~ $

but you need to install the python-module sounddevice for do that.

73 Heiko, DL1BZ


Re: Analog audio streaming

Kevin N9OIG
 

I believe Steve N4IRS has that done north American P25 TG is on radio reference.

Kevin 
N9OIG 


Re: DVSwitch Mobile goes full release 1.50 (105)

Steve N4IRS
 

Thanks, Peter.
Yes, it is in the Play Store now.

Steve

On 3/9/19 12:39 PM, Peter M0NWI wrote:
Well done Steve and Mike!!

Do you get this from the Play store?

Sent from Outlook
From: main@DVSwitch.groups.io <main@DVSwitch.groups.io> on behalf of Steve N4IRS <szingman@...>
Sent: 09 March 2019 14:47:30
To: main@DVSwitch.groups.io
Subject: [DVSwitch] DVSwitch Mobile goes full release 1.50 (105)
 
After 4 months of living and sleeping Android, we have released the production version of DVSwitch Mobile. This is not beta test, this is the ready to run version. 
This version includes the ability to save configuration settings and macros. We have priced the fully functional version at $1.99 US. We think this is a fair price for ability to connect to ASL and Digital Voice networks from a mobile device. 
 
Let the fun continue!
If you are interested in learning more about the app, join us at <https://dvswitch.groups.io/g/Mobile>
For DVSwitch,
N4IRR and N4IRS



Re: DVSwitch Mobile goes full release 1.50 (105)

Peter M0NWI
 

Well done Steve and Mike!!

Do you get this from the Play store?

Sent from Outlook
From: main@DVSwitch.groups.io <main@DVSwitch.groups.io> on behalf of Steve N4IRS <szingman@...>
Sent: 09 March 2019 14:47:30
To: main@DVSwitch.groups.io
Subject: [DVSwitch] DVSwitch Mobile goes full release 1.50 (105)
 
After 4 months of living and sleeping Android, we have released the production version of DVSwitch Mobile. This is not beta test, this is the ready to run version. 
This version includes the ability to save configuration settings and macros. We have priced the fully functional version at $1.99 US. We think this is a fair price for ability to connect to ASL and Digital Voice networks from a mobile device. 
 
Let the fun continue!
If you are interested in learning more about the app, join us at <https://dvswitch.groups.io/g/Mobile>
For DVSwitch,
N4IRR and N4IRS


Re: USB Audio on Raspberry Pi

Apostolos Kefalas <sv1ljj@...>
 

Hello Mike,

I do not see any problem!!! This kind of output is usual. As far as I
can see "The audio thread is started", so you should be OK.

Check out with alsamixer if something is muted.


73 Apostolos

On Sat, 2019-03-09 at 05:48 -0800, Mike AE4ML wrote:
Apostolos, 
Progress, 
I replaced "hw:1,0" with "plughw:1,0" 
This is the new output
pi@raspberrypi:~ $ ./USRPAudio.py 
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer
returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such
file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer
returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such
file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1,
skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1,
skipping unlock
Start audio thread
--
... if you get into RF you’ll spend your days staring at test equipment
wondering why nothing works.


Re: USB Audio on Raspberry Pi

Mike AE4ML
 

It works but it doesn't I read the other write up on USB to DMR. .
I have tried three different USB audio devices. all have the same results. If I stop and restart the python script it works again


Re: DMR to YSF Bridge not working right.

nick@...
 

Anyone with more experience have any thoughts? I've been hitting my head trying to figure this out for the last week and am so close to getting this link working but having the issue going from DMR to YSF. If there is any other info I can provide, let me know. 


DVSwitch Mobile goes full release 1.50 (105)

Steve N4IRS
 

After 4 months of living and sleeping Android, we have released the production version of DVSwitch Mobile. This is not beta test, this is the ready to run version. 
This version includes the ability to save configuration settings and macros. We have priced the fully functional version at $1.99 US. We think this is a fair price for ability to connect to ASL and Digital Voice networks from a mobile device. 
 
Let the fun continue!
If you are interested in learning more about the app, join us at <https://dvswitch.groups.io/g/Mobile>
For DVSwitch,
N4IRR and N4IRS


Re: USB Audio on Raspberry Pi

Mike AE4ML
 

Apostolos,
Progress,
I replaced "hw:1,0" with "plughw:1,0"
This is the new output
pi@raspberrypi:~ $ ./USRPAudio.py
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Start audio thread


Re: USB Audio on Raspberry Pi

Apostolos Kefalas <sv1ljj@...>
 

Hello Mike,

I think the "rate" should be 44100 and not 44000

If that doesn't work,

replace "hw:1,0" with "plughw:1,0" and try again.


73
Apostolos - SV1LJJ

On Thu, 2019-03-07 at 16:08 -0800, Mike AE4ML wrote:
in the process of trouble shooting I have installed this and it
didn't help

sudo apt-get install python-pyaudio python3-pyaudio sox
pip install pyaudio


root@raspberrypi:~# cat .asoundrcfile 
pcm.!default {
  type asym
   playback.pcm {
     type plug
     slave.pcm "hw:1,0"
   }
   capture.pcm {
     type plug
     slave.pcm "hw:1,0"
   }
}
pcm.convert {
         type plug;
         slave {
               pcm default;
               rate 44000;
         }
}
--
... if you get into RF you’ll spend your days staring at test equipment
wondering why nothing works.


Re: USB Audio on Raspberry Pi

Apostolos Kefalas <sv1ljj@...>
 

Hello Mike,


IOError: [Errno -9997] Invalid sample rate
it seems to me that the usb audio device, can not work at the 8Khz
sampling rate.

Maybe try another usb audio dongle.


Apostolos




On Fri, 2019-03-08 at 13:28 -0800, Mike AE4ML wrote:
[Edited Message Follows]
I pulled out a new SD card , I haven't done anything with as far as
audio goes. 
I have the dvswitch  programs installed. 
tested aplay -l and arec -l and set the correct setting in
/etc/asound.conf
tested playing a wav file through the usb sound card
Both of these worked

aplay test.wav
and 
speaker-test -D sysdefault:CARD=1        

When I ran USRPAudio.py I go t one error and that was for pyaudio. 
So , I loaded python-pyaudio  and python3-pyaudio
now the screen is riddled with the error I reported earlier. 
--
... if you get into RF you’ll spend your days staring at test equipment
wondering why nothing works.


Re: Problem Description: No Audio @ P25 radio, No Audio DMR from Bridge P25 <<-->> DMR

Ray Harden
 

I have attached two folders to continue the diagnostic effort:

 

    -- P25_ALL.INI-Files_09MAR19: All relevant .ini files and the logs captured for MMDVM, P25Reflector, Analog_Bridge_DMR/P25, P25Gateway

 

    -- MMDVM_MSF5000_09MAR19:  MMDVM.ini, P25Gateway.ini and logs from the client P25 MSF5000 radio.

 

I hope this covers the information you requested.

 

Thanks very much for your assistance.

 

RayH   w0ray

 

From: main@DVSwitch.groups.io [mailto:main@DVSwitch.groups.io] On Behalf Of Steve N4IRS
Sent: Wednesday, March 6, 2019 2:01 PM
To: main@DVSwitch.groups.io
Subject: Re: [DVSwitch] Problem Description: No Audio @ P25 radio, No Audio DMR from Bridge P25 <<-->> DMR

 

All off

On 3/6/2019 3:00 PM, Ray Harden wrote:

Debug on or off, all or which ones?


From: main@DVSwitch.groups.io <main@DVSwitch.groups.io> on behalf of Steve N4IRS <szingman@...>
Sent: Wednesday, March 6, 2019 1:40:35 PM
To: main@DVSwitch.groups.io
Subject: Re: [DVSwitch] Problem Description: No Audio @ P25 radio, No Audio DMR from Bridge P25 <<-->> DMR

 

OK, here is what I need.
Run MMDVM_Bridge Analog_Bridge_DMR Analog_Bridge_P25 P25Gateway all at the same time. Let everything startup and settle. Give me one transmission from a user with a DMR radio. The give me one transmission with a P25 radio. Capture the output from each program in a file then zip it up and send it.

On 3/6/2019 2:32 PM, Ray Harden wrote:

Sorry for the delay … took some time to delete the unwanted lines  … both files are close in time segments … I was already in the process before I saw your  message about Debug Off

 

From: main@DVSwitch.groups.io [mailto:main@DVSwitch.groups.io] On Behalf Of Steve N4IRS
Sent: Wednesday, March 6, 2019 11:28 AM
To: main@DVSwitch.groups.io
Subject: Re: [DVSwitch] Problem Description: No Audio @ P25 radio, No Audio DMR from Bridge P25 <<-->> DMR

 

Turn off debug in each program.
Can you send actual text files?
I do see "No response from 31900, unlinking on the gateway.

 

 


Re: USB Audio on Raspberry Pi

Mike AE4ML
 
Edited

I pulled out a new SD card , I haven't done anything with as far as audio goes.
I have the dvswitch  programs installed.
tested aplay -l and arec -l and set the correct setting in /etc/asound.conf
tested playing a wav file through the usb sound card
Both of these worked

aplay test.wav
and
speaker-test -D sysdefault:CARD=1       

When I ran USRPAudio.py I go t one error and that was for pyaudio.
So , I loaded python-pyaudio  and python3-pyaudio
now the screen is riddled with the error I reported earlier.


Re: Iaxrpt/DVSwitch keypad missing

Steve N4IRS
 

Frank,
We are looking into your problem if you would like to revert to the last release version you can install it from <http://dvswitch.org/files/Mobile/DVM_144.apk> I will let you know when we have resolved your problem.

73, Steve N4IRS

On 3/8/2019 9:08 AM, Private via Groups.Io wrote:
Hello, I have been using IAXRPT/SVSwitch for over a year withhout any problems until this past week, (first wk of March) but now im experiencing no key (number pad ) when I open the program on my phone. Phone is a Samsung 7, Galaxy edge, Hardware Ver REV 0.7I have cleared the cache on phone and deleted program and deleted all files assciated with the program and reloaded but still same issue, NO Keypad when program starts, also program loads automatically to my node without any issues.
Frank KB2AYSNode 28201


Analog audio streaming

sv1hep@...
 

Hi
Thanks to the team here, I run successfully for my needs a main server HBLink with HBMonitor on line, connected to them (HotSpots)<=>(HotSpots)<=>(BM) also  (HBLink)<=>(IPSC2)<=>(NXDN)<=>( ALS)<=>(MMDVMBridge)<=>(AnalogBridge)<=>(Echolink) etc.
The next challenge i think will be the export analog audio for web streaming like BM hose.
Has anyone tries something like that ?

73' Chris SV1HEP

6041 - 6060 of 9518