Author Topic: Feed with Raspberry Pi3 and USB sound card  (Read 3071 times)

Offline Aleto

  • Newbie
  • *
  • Posts: 3
Feed with Raspberry Pi3 and USB sound card
« on: August 23, 2020, 11:48:54 AM »
Hi there

I would like to move my feed from a Windows PC to a Raspberry Pi3. I tried to use the module "Darkice 1.3".

The connection to the Icecast2 server seems to work and my Pi3 is sending audio data. But when I try to listen the feed from the server, the audio is badly distorted. It isn't overmodulated - it's more a problem with encoding.

darkice.cfg

[general]
duration = 0
bufferSecs = 6

[input]
device = hw:2,0
sampleRate = 8000
bitsPerSample = 16
channel = 1

[icecast2-0]
bitrateMode = cbr
format = mp3
bitrate = 8
quality = 0.5
server = server
port = port
password = password
mountPoint = XXXX
name = name
description = description
url = http://www.liveatc.net
genre = ATC
public = no

Any help?
Thank you

PS: Wrote a email to support but I didn't got an answer yet.



Offline dave

  • Site Founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 4597
    • LiveATC.net
Re: Feed with Raspberry Pi3 and USB sound card
« Reply #1 on: August 23, 2020, 11:55:47 AM »
Change some of your parameters per this sample config:

[general]
duration        = 0
bufferSecs      = 5
reconnect       = yes

[input]
device          = plughw:1,0     # sound device
sampleRate      = 44100          # 22050 or 44100
bitsPerSample   = 16             # only use 16
channel         = 1              # use mono

[icecast2-0]
bitrateMode     = cbr
format          = mp3
bitrate         = 16             
server          = audio-in.liveatc.net
port            = 8010
sampleRate      = 22050
lowpass      = 3500
mountPoint      = ASSIGNED-BY-LIVEATC
password        = ASSIGNED-BY-LIVEATC
name            = FEED-DESCRIPTION
description     = FEED-DESCRIPTION
url             = http://www.liveatc.net
genre           = ATC
public          = no

Offline Aleto

  • Newbie
  • *
  • Posts: 3
Re: Feed with Raspberry Pi3 and USB sound card
« Reply #2 on: August 24, 2020, 04:25:22 AM »
Thanks for your information. Seems that it works now.

The only question is how to be sure that the audio is not overmodulated.

Offline dave

  • Site Founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 4597
    • LiveATC.net
Re: Feed with Raspberry Pi3 and USB sound card
« Reply #3 on: August 24, 2020, 07:39:29 AM »
Lower the scanner volume until there is no distortion. You should also keep the input volume relatively low as well. These instructions should help:

...Set the volume on the USB sound device...these instructions assume you are using the suggested sound device - if you are using a different device your mixer settings may be different):

sudo bash (you need to have a root shell for the step)
alsamixer -c 1 (this command brings up the sound mixer)

Use the right arrow key to get to the sound card selection - it will initially be on Mic but you will need to switch it with the up/down arrow keys to "Line In"

Now hit the TAB key to get over to the recording controls and adjust the Line In level to about 30%
Press the ESC key

alsactl store 1 (stores your new sound card settings)

Here is a video showing how to deal with the USB card input selection
and level setting...

<https://www.youtube.com/watch?v=mz-6HuZr7Ac>

Offline Aleto

  • Newbie
  • *
  • Posts: 3
Re: Feed with Raspberry Pi3 and USB sound card
« Reply #4 on: August 24, 2020, 08:33:43 AM »
Thanks – that's exactly what I did  :-)
In alsamixer I had to choose at first the right sound card and the sound seems to be ok with these settings.