[Bug 208678] Sound: analogue audio output on Raspberry pi

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Apr 10 18:13:12 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208678

            Bug ID: 208678
           Summary: Sound: analogue audio output on Raspberry pi
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: sylvain at sylvaingarrigues.com

The first point of this bug is a continuous flow of warnings when using sysctl
hw.snd.verbose=4 and playing sound (see "how to reproduce" below).

The second point is that since February, a new firmware option
(audio_pwm_mode=2) has been added which greatly improves the analogue audio
output:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445

With this option, there is almost no more white noise on analogue output,
making the RPI2 great again for music listening. Except that there are small
distortions in the sound and I believe they are related to our kernel driver
anyway (related to first point?) as 
1/ there are no distortions when using omxplayer to play the sound in userland
2/ I have no such problem using NetBSD. I looked at the difference in the
driver and they do some prefilling before playing and have a bigger VCHIQ audio
buffer size and send more audio messages at once if I am correct.


How to reproduce:
# pkg install mpg123
# sysctl hw.snd.verbose=4
# fetch http://www.noiseaddicts.com/samples_1w72b820/4190.mp3     
# mpg123 4190.mp3 ==> sound is distorted with audio_pwm_mode=2, it is not
without this option, but in both cases I have LOTS of warnings in dmesg

Check dmesg:
….
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=124000,
old=124000 delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=0, old=0
delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=0, old=0
delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=4000, old=4000
delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=8000, old=8000
delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=12000,
old=12000 delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=16000,
old=16000 delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=20000,
old=20000 delta=0 amt=0 ready=8192 free=119808
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=24000,
old=24000 delta=0 amt=0 ready=8192 free=119808
feed_root: (virtual) appending 3128 bytes (count=3364 l=236 feed=480)
pcm0: chn_sync(): timeout=4 count=51 hcount=51 resid=0 residp=0 minflush=0
ret=0
pcm0: WARNING: PCMDIR_PLAY DMA completion too fast/slow ! hwptr=28000,
old=28000 delta=0 amt=0 ready=8192 free=119808
pcm0: chn_trigger() pcm0:play:dsp0.p0: calling go=0xffffffff , prev=0x00000001
pcm0: chn_trigger() pcm0:virtual:dsp0.vp0: calling go=0xffffffff ,
prev=0x00000001
pcm0: chn_resizebuf(): PCMDIR_PLAY (hardware) timeout=4 b[128000/4000/2]
bs[8192/4096/2] limit=0
pcm0: chn_resizebuf(): PCMDIR_PLAY (virtual) timeout=4 b[0/0/0]
bs[65536/2048/32] limit=7526

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list