Skip to contentSkip to conversation

Alsa-OSS - Pop at start of song update (rc2)

DISCUSSION Mark Knecht 5 participants 8 messages Dec 7, 2003 – Dec 8, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
This is a small update on the problem I've seen with loud pops and
crackles at the start of audio when using Alsa's OSS emulation. As background, using xmms I am unable to play about 99% of the mp3, ogg and wave files I have without getting a very loud noise when first starting the playback. The noise also happens every time I pause and restart the playback. It also happens with pretty much every audio or video viewed and played by Mozilla. mplayer, xine, plugger-5.0 all have default setups that cuase this on my system.

However, an interesting aspect was that this does not ever happen
when playing any of these files with an Alsa application instead. Using that as a clue, I tried using alsaplayer through the oss layer instead of directly into Alsa, using

alsaplayer -o oss

It turns out that this NEVER causes the noise. All mp3, ogg and wave files play correctly using alsaplayer through the OSS layer.

I'm not sure what this says, really. If alsaplayer can talk to the
OSS layer correctly, then you could say that every other app I've tried is bad and all those apps need to be recoded. On the other hand, if so many apps fail in my system, then is the problem with the OSS emulation interface and that needs to be looked at?

I also tried building the alsa-xmms plugin, but it fails with
Alsa-1.0.0rc2, so I'll file bug reports on that elsewhere.

Thanks,
Mark

Postscript:

Without support from a developer somewhere who is interested in
solving this I understand that this is not going to go much further than this message. The problem has been there, and I have been reporting it in one form or another for over 8 months. No one has stepped up to solve it specifically, and not being a developer this is about as much as I can do. I don't know what else I can do to muster some interest in solving it. This is an RME product, which is one of the 'preferred' hardware manufacturers for Linux audio. It's burning me today. It will burn others later.

Clearly I get that this problem occurs on very few systems, so I get
that it's not high priority. Maybe there's nothing that can get done about it. That would be disappointing.

From a practical point of view, this one problem pretty much causes
me to have to drop using Linux at all for browsing the web and is forcing me back to Windows. I cannot handle super loud ugly noises at the start of playing a simple 2-second wave file. A lot of what I do is on the web, and every one plays badly on my system. Bummer...

The only practical idea I can offer is that someone in the Alsa camp
should take up the task of developing a set of instructions for configuring Mozilla. et. all, in such away as to make OSS not be used. I think Alsa should support, but not depend on, OSS at all. Today it depends on OSS by not providing clear info on how to use Alsa inside of browsers.

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#1 lore raw
Quoted 9 lines · Mark Knecht

Hi,

The only practical idea I can offer is that someone in the Alsa camp
should take up the task of developing a set of instructions for configuring Mozilla. et. all, in such away as to make OSS not be used. I think Alsa should support, but not depend on, OSS at all. Today it depends on OSS by not providing clear info on how to use Alsa inside of browsers.

This is probably useful but the main problem I see is you are using a few apps that could be running alsa native but you are using the oss drivers instead.

mplayer will use whatever driver you specify in the config file. I assume xine is the same. Thats pretty much the best fix AFAICT. Then you only have to find a way to make sure you're java plugins don't make noise and stop using xmms until they fix the alsa driver.

Anything that xmms can stream mplayer can do too. Anything that doesn't require streaming alsaplayer can do.

Have you had major problems with java plugins? In this case you should look into ways to get around that. (Some people have been known to invest in a second $10 card just for browsing).

Signature · 22 lines
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================


 Apparently upon the beginning of the barrage, the donkey broke 
discipline and panicked, toppling the cart. At that point, the rockets disconnected from the timer, leaving them strewn around the street. Tethered to the now toppled cart, the donkey was unable to escape before the arrival of U.S. troops.

United Press International
Rockets on donkeys hit major Baghdad sites

By P. MITCHELL PROTHERO
Published 11/21/2003 11:13 AM



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
#2 lore raw
Quoted 2 lines · Patrick Shirkey

(Some people have been known to
invest in a second $10 card just for browsing).

Sure. I've got an on-board sound chip of some type. I used to have it enabled. Sounds like I probably need to do something like that and patch it with a cable back into the RME which would get the audio sent to speakers and headphones. I think this problem is unlikely to ever get addressed seriously.

However, as I remember it, there were conflicts having both the on-board chip and the RME both on at the same time. MIDI stuff or something like that.

Cheers,
Mark

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#7 lore raw
In reply to Mark Knecht
Quoted 8 lines · Mark Knecht

This is a small update on the problem I've seen with loud pops and
crackles at the start of audio when using Alsa's OSS emulation. As background, using xmms I am unable to play about 99% of the mp3, ogg and wave files I have without getting a very loud noise when first starting the playback. The noise also happens every time I pause and restart the playback. It also happens with pretty much every audio or video viewed and played by Mozilla. mplayer, xine, plugger-5.0 all have default setups that cuase this on my system.

Hi Mark,

Are you by chance using a sound server of some kind that keeps
the device open and mapped? For example, esd keep the device open and when it's not in use, it's writing zeroes to the sound device.

If there was a bug in esd and it wasn't actually writing
zeroes, but some other constant value, things would be silent while nothing is playing. When actual sound starts, this could have an actual zero at the beginning, causing a pop!

Of course, you say you're using oss, so probably no esd is
involved. Maybe dmix is being used and doing something like this?

Quoted 6 lines

However, an interesting aspect was that this does not ever happen
when playing any of these files with an Alsa application instead. Using that as a clue, I tried using alsaplayer through the oss layer instead of directly into Alsa, using

alsaplayer -o oss

This difference is kind of telling - if it were a problem in the ALSA OSS emulation layer, this should almost certainly exhibit the problem. Of course, it could be a subtle API compatibility issue, but that seems unlikely to me - people should see it on other hardware and it should be common.

If you're using something like dmix, I'd try cutting it out of the picture.

Signature · 17 lines
Ross Vandegrift
[email protected]

A Pope has a Water Cannon.                               It is a Water Cannon.
He fires Holy-Water from it.                        It is a Holy-Water Cannon.
He Blesses it.                                 It is a Holy Holy-Water Cannon.
He Blesses the Hell out of it.          It is a Wholly Holy Holy-Water Cannon.
He has it pierced.                It is a Holey Wholly Holy Holy-Water Cannon.
He makes it official.       It is a Canon Holey Wholly Holy Holy-Water Cannon.
Batman and Robin arrive.                                       He shoots them.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
#3 lore raw

rc2 - snd-via82xx - really sounds bad - distorted, resampled, phasey

In reply to Patrick Shirkey
Quoted 3 lines · Patrick Shirkey

(Some people have been known to
invest in a second $10 card just for browsing).

Patrick,
Hi. Ok, since you suggested it I set up this Via 8235 sound chip on
my system as the primary sound chip. However, it's sounding amazingly bad! It's terribly distorted and even at the best of times sounds very, very,phasey. I can pretty much hear what sound like terrible resampling noise, maybe like it's going from 44.1K up to 48K or something.

Any idea why? I hope it's just a configuration mistake.

I've tried both alsaplayer and xmms playing a few mp3's and the results are always the same going through the 8235.

The 8235 output is cabled to an input on the AI-3 A/D, inputs 3/4. I've also got Pro Tools coming in on inputs 1/2. Audio from Pro Tools is fine, while audio from the 8235 is dirty, resampled and phasey. The AI-3 does not show any clipping on the signal coming from the 8235, so I don't think it's really a levels issue.

Is the 8235 a 44.1K only type device? I don't think so since I see 44.1K number in /proc/asound/card0/

I haven't figured out how to run alsaplayer directly though Alsa when the HDSP is the second card, but using Jack I can run alsaplayer and the sound is much better.

I think there have been similar comments since rc1 about this sort of thing on the Intel sound chips possibly? Are others using rc2 successfully with this chip or could this be a similar problem?

The sound is so bad as to be unlistenable.

Current .asoundrc and modules.conf below...

Thanks,
Mark

pcm.via82xx {
           type hw
           card 0
         }
ctl.via82xx {
           type hw
           card 0
         }
pcm.hdsp {
           type hw
           card 1
         }
ctl.hdsp {
           type hw
           card 1
         }
pcm_slave.hdsp {
          pcm "hw:0"
          channels 26
        }
pcm.playback_5_6 {
          type dshare
          slave hdsp
          ipc_key 314159265    # some unique number
          ipc_key_add_uid yes   # "no" to let multiple users share it
          bindings {
                0 5
                1 6
          }
        }
pcm.dsp {
          type plug
          slave.pcm playback_5_6
        }

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s) ## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info. ##

## ALSA portion
alias snd-card-0 snd-via82xx
alias snd-card-1 snd-hdsp
alias snd-card-2 snd-usb-audio

## OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1
alias sound-slot-2 snd-card-2
##

# OSS/Free portion - card #0 (Via8233)
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

# OSS/Free portion - card #1 (HDSP9652)
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
options snd cards_limit=3
add options -k snd-card-0
add options -k snd-card-1
add options -k snd-card-2

### modules-update: end processing /etc/modules.d/alsa

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#4 lore raw

Re: rc2 - snd-via82xx - really sounds bad - distorted, resampled, phasey

Quoted 5 lines · Mark Knecht

Hi. Ok, since you suggested it I set up this Via 8235 sound chip on
my system as the primary sound chip. However, it's sounding amazingly bad! It's terribly distorted and even at the best of times sounds very, very,phasey. I can pretty much hear what sound like terrible resampling noise, maybe like it's going from 44.1K up to 48K or something.

have you played around with the via82xx 'dxs_support' module parameter yet? your modules.conf suggests you haven't. the driver didn't guess the value right on this box fwiw, i had to set it manually.

add 'options snd-via82xx dxs_support=X' to modules.conf where 0 < X <= 4. there's some comments at the head of alsa-kernel/pci/via82xx.c that shed some more light on the issue.

hth,

tim

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#5 lore raw

Re: rc2 - snd-via82xx - really sounds bad - distorted, resampled, phasey

In reply to Mark Knecht

Hi, I have that exact same problem with a via8235 chip, and the only way I have found to fix it was to change 48000 to 44100 on Line 83 in alsa-kernel/pci/via82xx.c:
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000}; I actuially wrote a mail earlier today on the same subject (called viasomehting8235 clock problems or something). It seems to work fine after I make this change, btw.

784 - Michael C. Piantedosi - [email protected]

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#6 lore raw

Re: rc2 - snd-via82xx - really sounds bad - distorted, resampled, phasey

Quoted 9 lines · On Sun, 2003-12-07 at 20:53, [email protected] wrote:

Hi, I have that exact same problem with a via8235 chip, and the only way I have found to fix it was to change 48000 to 44100 on Line 83 in alsa-kernel/pci/via82xx.c:
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000}; I actuially wrote a mail earlier today on the same subject (called viasomehting8235 clock problems or something). It seems to work fine after I make this change, btw.

784 - Michael C. Piantedosi - [email protected]

Interesting info. Thanks.

- Mark

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/