[Solved] Distorted audio when recording

Moderator: flatmax

Post Reply
matt
Posts: 5
Joined: Thu Sep 22, 2016 3:38 pm

[Solved] Distorted audio when recording

Post by matt » Thu Sep 22, 2016 3:54 pm

Hello, I'm setting up the AIH v1.5 on my Raspberry Pi 3. I've followed the automatic installation instructions in viewtopic.php?f=5&t=3. To enable the RCA inputs and outputs, I ran alsactl --file /usr/share/doc/audioInjector/asound.state.RCA.thru.test restore. When I try and record, I see the VU meter while recording which looks correct. When I try and play back that recording on my Windows computer, I hear high pitched distortion and static, without any audio. When I try and play back that recording on the Pi through the Audio Injector's output, 9 times out of 10 I won't hear anything, but 1 time out of 10 I hear a somewhat noisy, but clearly audible copy of my recording.

The commands I'm using are:
arecord -vv -f S16_LE -c 2 -r 44100 -t wav foo.wav
aplay foo.wav

When I run audioInjector-test.sh I don't see the waveforms in the attachment - possibly because I'm using the Raspian Jessie Lite image? Any help is appreciated, thank you.
Last edited by matt on Tue Sep 27, 2016 5:38 pm, edited 1 time in total.

matt
Posts: 5
Joined: Thu Sep 22, 2016 3:38 pm

Re: Distorted audio when recording

Post by matt » Sun Sep 25, 2016 7:06 am

Hi,
I've tried a second one of the audio injector cards, and many different formats with the same result. Any pointers on a next troubleshooting step? Thank you.
Matt

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Distorted audio when recording

Post by flatmax » Sun Sep 25, 2016 12:34 pm

Hi there,

I just did a test following the same steps which you used and the RCA input recording is working well when I playback using audacity on a Linux computer. So lets try to see what is different between your system and mine...

Can you run "aplay foo.wav" on the Audio injector sound card and see if it sounds correct when played on the same card that you recorded with ? You can use the headphones to monitor if you don't want to plug in output RCAs.

Can you use audacity to open the recorded file ? On the raspberry pi : sudo apt-get install audacity
On your desktop you can download from here : http://www.audacityteam.org/

On some systems you need to use the ALSA plughw device to reformat audio data to the requested format, however this shouldn't be necessary with the audio injector sound card for the rate and format you have chosen :
arecord -vv -D plughw -f S16_LE -c 2 -r 44100 -t wav foo.wav

Just to be sure, can you also please reply back with the output of the following commands :
cat /proc/version
arecord -l
arecord -L

thanks
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

matt
Posts: 5
Joined: Thu Sep 22, 2016 3:38 pm

Re: Distorted audio when recording

Post by matt » Tue Sep 27, 2016 6:21 am

Thanks Matt. When I try to use aplay foo.wav on the Pi and monitor through the Audio Injector's RCA outputs, 9 times out of 10 when I run that command, I hear nothing. 1 time out of 10 when I run that same command against the same *.wav file, I will be able to hear the original recording with some small/moderate amount of noise.

I emailed a representative audio file to you to what I think is your email address (music@...) and also posted it here: https://www.sendspace.com/file/ikii8e

I hear the same thing in Audacity and Adobe Audition. Additionally, Adobe Audition shows the following pattern in the frequency domain:
foo.gif
foo.gif (119.42 KiB) Viewed 5892 times
/cat/version:
Linux version 4.4.13-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #894 SMP Mon Jun 13 13:13:27 BST 2016

arecord -l:
**** List of CAPTURE Hardware Devices ****
card 0: audioinjectorpi [audioinjector-pi-soundcard], device 0: AudioInjector audio wm8731-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

arecord -L:
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=audioinjectorpi
audioinjector-pi-soundcard,
Default Audio Device
sysdefault:CARD=audioinjectorpi
audioinjector-pi-soundcard,
Default Audio Device
dmix:CARD=audioinjectorpi,DEV=0
audioinjector-pi-soundcard,
Direct sample mixing device
dsnoop:CARD=audioinjectorpi,DEV=0
audioinjector-pi-soundcard,
Direct sample snooping device
hw:CARD=audioinjectorpi,DEV=0
audioinjector-pi-soundcard,
Direct hardware device without any conversions
plughw:CARD=audioinjectorpi,DEV=0
audioinjector-pi-soundcard,
Hardware device with all software conversions

Thank you,
Matt

matt
Posts: 5
Joined: Thu Sep 22, 2016 3:38 pm

Re: Distorted audio when recording

Post by matt » Tue Sep 27, 2016 9:27 am

I've also just tried this on a brand new Pi (using the existing SD card) with the same results.

When playing back using aplay, it seemed like most times I would get silence, some times I would hear the original recording at either different volume levels or with different amounts of noise.

Thank you,
Matt

matt
Posts: 5
Joined: Thu Sep 22, 2016 3:38 pm

Re: Distorted audio when recording

Post by matt » Tue Sep 27, 2016 3:43 pm

Hi,

Good news :) I tried a new image and reinstall/config from scratch, which is working on both Pis with both audioinjector cards.

Edit 2:
Here's what seems to have happened. Originally I used the Raspian Jessie Lite image. That image apparently doesn't come with rpi-update. Although I ran apt-get update, and apt-get dist-upgrade, and verified that my "raspberrypi-bootloader" package was up to date (as documented here https://www.raspberrypi.org/documentati ... pdating.md) apparently the latest published package comes with kernel version 4.4.13 whereas the rpi-update command brings down kernel version 4.4.22.

After running apt-get install rpi-update and running that, I now have:
Linux version 4.4.22-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #912 SMP Mon Sep 23 19:04:59 BST 2016

And no more problems with the cards.

Thanks again for the help,
Matt

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: [Solved] Distorted audio when recording

Post by flatmax » Thu Sep 29, 2016 8:31 am

OK - that makes sens now. Yes earlier kernels had an older Audio injector driver with them and the latest driver is the correct one to use. As you mention, that one is pulled down with "rpi-update".

Have fun with the audio card !

Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

Mareake
Posts: 1
Joined: Thu Feb 21, 2019 3:06 pm

Re: Distorted audio when recording

Post by Mareake » Thu Feb 21, 2019 5:23 pm

flatmax wrote:
Sun Sep 25, 2016 12:34 pm
Hi there,

I just did a test following the same steps which you used and the RCA input recording is working well when I playback using audacity on a Linux computer. So lets try to see what is different between your system and mine...

Can you run "aplay foo.wav" on the Audio injector sound card and see if it sounds correct when played on the same card that you recorded with ? You can use the headphones to monitor if you don't want to plug in output RCAs.

Can you use audacity to open the recorded file ? On the raspberry pi : sudo apt-get install audacity
On your desktop you can download from here : http://www.audacityteam.org/

On some systems you need to use the ALSA plughw device to reformat audio data to the requested format, however this shouldn't be necessary with the audio injector sound card for the rate and format you have chosen :
arecord -vv -D plughw -f S16_LE -c 2 -r 44100 -t wav foo.wav

Just to be sure, can you also please reply back with the output of the following commands :
cat /proc/version
arecord -l
arecord -L

thanks
Matt
One of the software you mention I used lately and yeah it's looking good on my computer so I continue using that software till it's not working since I try to upgrade it. It's audacity, I check on audacity guides but I can't manage it. If you suggest of how to fix it I will try to do. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests