dh1tw / remoteAudio

Audio streaming application for Amateur Radio purposes
MIT License
166 stars 24 forks source link

Output volume at radio from server is very low #36

Closed pkubat closed 2 years ago

pkubat commented 2 years ago

Sorry to open another issue, but I did not want to hijack the other thread. Also, I am not 100% convinced this is an remote audio issue, but need a little help to diagnose it.

+--------+                           +-----------------+
|        |       audio cable         | raspberrypi     |
| radio  |  <- usb 'sound card' ->   |  w/ remoteAudio |
|        |                           |  server         |
+--------+                           +-----------------+

                                            ^
                                            |
                                            v

                                        +--------+
                                        |  nats  |
                                        | docker |
                                        +--------+

                                            ^
                                            |
                                            v

+-------+       +--------------+     +-------------+
|       |       |   virtual    |     |  macOS      |
| jtdx  |  <->  |   loopback   | <-> | remoteAudio |
|       |       | audio device |     |  client     |
+-------+       +--------------+     +-------------+

I am open to suggestions of what to try next. Do your use digital modes?

Thanks!

dh1tw commented 2 years ago

Hey @pkubat, makes sense to start a new thread. Have you already adjusted the audio levels on the raspberry Pi? Sounds like your line-in or microphone levels on the Pi are too low. You can use the Alsamixer to adjust the volume of each audio device. Try sudo alsamixer and then persist the settings with sudo alsactl store.

You could also record a sample on the raspi with arecord and then either replay them locally on the Raspi with headphones or via scp on your Mac. MacOS comes with a nifty commandline tool called afplay.

I'm not really a digital mode operator, but a few months ago I did the same tests (WSJT-X / FT8) with my Mac and a Windows PC. Both worked well and audio levels were fine.

Could the "static crashes" be audio dropouts? Try increasing the audio packet size.

audio samples are float32 values normalized to 1. Just before writing the samples to the sound card, remoteAudio only multiples the volume of the samples with a value from 0-1. This corresponds to the 0...100% you can set in the GUI or through the REST API. So actually no amplification happens, only attenuation. Normally the soundcards provide a sufficient level that amplification is not needed.

pkubat commented 2 years ago

@dh1tw Sorry my mistake! I did not save the volume settings, even worse in that you took the time to document the entire process in the wiki I need to learn to read!

So the good news is that it is "working", though the quality of the audio needs need work. I'll find time in the next day or so to tweak the settings and see if I can resolve.

I did have a few questions on the configuration.

  1. What are the best defaults? .remoteAudio.toml and remoteAudto -h have different defaults. So to have a good starting point.
  2. What settings apply to the "client" and which ones are for the "server"?
  3. Is there any document on what each setting does? (if not I can try to take a pass at creating some)

Again thanks!!!!!

dh1tw commented 2 years ago

Glad to hear that the wiki was of help. The easiest way to check the available parameters for a remoteAudio client and server is to execute ./remoteAudio server nats --help and ./remoteAudio client nats --help respectively. The priority is as follows:

  1. command line flags (highest)
  2. config file
  3. default values (lowest)

I just updated the default config file .remoteAudio.toml and added explanations to the parameters. I hope this gives you a better understanding of the individual parameters and where they are used.

In principle, the default values should work well and get you started out of the box. Once you feel comfortable, you can start tweaking the parameters.

I hope this helps!

73 Tobias

pkubat commented 2 years ago

Thanks for the updates. The biggest impact to sound quality (broke out the oscilloscope) was changing frame-length = 960 which I see you now have the recommended setting.

I am going to close this as it is much better now, thanks!