Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distorted Audio When Using USB Audio Instead of 3.5mm Jack on RPI 3 #381

Closed
Gemba opened this issue Nov 21, 2018 · 4 comments
Closed

Distorted Audio When Using USB Audio Instead of 3.5mm Jack on RPI 3 #381

Gemba opened this issue Nov 21, 2018 · 4 comments
Assignees

Comments

@Gemba
Copy link

Gemba commented Nov 21, 2018

Expected behavior: Same (or better) audio experience with USB audio device instead of 3.5mm audio jack.

Actual behavior: Audio is noticable distorted when playing back audio with Amiberry.

Steps to reproduce the behavior

  1. Play any audio from a rom with Amiberry via the 3.5mm jack (works flawless).
  2. Attach and configure in ALSA an USB audio device, disable audio jack (dtparam=audio=off in /boot/config.txt) (followed setup at: https://github.com/retropie/RetroPie-Setup/wiki/Sound-Issues#usb-audio).
  3. Playback some files in console or in other emulators, works fine.
  4. Now, play back the same audio (from 1.) in amiberry but now via USB Audio
  5. Easily notice the distortion in audio in contrast to 3.5mm jack playback: The output is overlayed with periodic pops every few ms at constant rate.

Configuration

  • Amiberry 2.24b5 compiled from source (no crosscompile), SDL1
  • Rpi3B with full updated retropie 4.4 distribution
  • Quality switched-mode power supply, 5.05V, 4A max.
  • Some USB Audio device (see Audio Devices below)

Additional information

  • Other emulators show no differences in audio if playing via USB audio device instead of 3.5 audio jack
  • Moderate overclocking (to 1300 MHz CPU clock) of the rpi did not fix/reduce the distortion

Workaround

Reduce audio sampling from 44100 to 32000 in amiberry. Does not impact the audio quality at all but the distortion is gone.

  1. Edit sound_frequency parameter in each *.uae config file.
  2. And/Or to enforce sound frequency of 32000 Hz automagically with WHDLoad edit the amiberry.sh file. Do change the line 12 (currently), add -s sound_frequency=32000, save and exit. Make it read like:
 "$emulator" -autowhdload="$rom" -s sound_frequency=32000 -G

Tested USB Audio Devices:

  • ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
  • ID 040d:340a VIA Technologies, Inc.
  • ID 1b3f:2008 Generalplus Technology Inc.
@CypherXG
Copy link

Mhhhh
I use the SDL1 Version too. I can switch with my Version of Amiberry direct between HDMI or audio jack.
I tried it also with an USB Audio Card/Headset ( Logitech G430/Speedlink Medusa (C-Link USB) ) and i have no issues. All sounds are very good. Also when i change the sound frequency. No issues.
I noticed it in some forums that not all USB Audio Cards are perfect for the raspberry....
Try to search with google if there are some problems....

@midwan midwan self-assigned this Nov 23, 2018
@midwan
Copy link
Collaborator

midwan commented Nov 23, 2018

@Gemba
Thanks for reporting this.

I have a USB audio card that I can test with, and see if I can recreate it.

@Gemba
Copy link
Author

Gemba commented Nov 23, 2018

@midwan Thanks for paying attention very soon. I got some news.

I took a different angle on this issue the other day. It turns out that a GPIO kernel module imposes some latency. Without the kernel module Amiberry works fine with USB Audio at sound_frequency set to 44100.

@midwan
Copy link
Collaborator

midwan commented Nov 23, 2018

@Gemba
Thanks for the feedback, I'll add this in the FAQ for anyone else that might come across it.

@midwan midwan closed this as completed Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants