LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   ALSA bizarre behavior with C-Media Electronics CMI9738. (https://www.linuxquestions.org/questions/slackware-14/alsa-bizarre-behavior-with-c-media-electronics-cmi9738-907071/)

stf92 10-08-2011 03:58 AM

ALSA bizarre behavior with C-Media Electronics CMI9738.
 
Hi: when I start any of the several audio players that come with slackware 12.0 (kernel 2.6.21.5), which is the version I am using, a curious thing happens: the PCM volume sets itself to 100% which, if the Master volume is set high enough, causes distortion.

This happens every time I do a slackware 12.0 installation, and I have never been able to fix it. I have just done this. I unloaded module snd_trident. This had the effect of automatically unloading all of the other sound modules. Then I ran alsaconf. Then I tested, with the hope of having fixed the problem. But the problem persists.

Card: SiS SI7018
Chip: C-Media Electronics CMI9738, Silicon Laboratory Si3036,8 rev 1

These data are reported by alsamixer. Any idea about what can be happening?

Keith Hedger 10-08-2011 10:15 AM

I had problems with alsa being to loud and no pcm control so I ran
Code:

alsactl init
alsamixer

Wich restored the pcm control to alsamixer and alowed me to adjust the volume down

Woodsman 10-08-2011 10:43 AM

Sound configurations with older Slackware releases such as 12.0 were not as automated as more recent releases. With those older releases ALSA had to be configured manually with every installation.

My basic routine for configuring sound on older systems:

As root:
Run alsaconf.
Run alsamixer: be sure to set any setting with "boost" in the name to zero..
Run alsactl store.
Run aplay to test any wave file.
Verify /etc/rc.d/rc.alsa is executable.

Those steps configure the system default settings only. The desktop mixer and various user settings with apps will override the default system settings.

As non-root:
Start the desktop.
Configure the desktop mixer.
Configure any apps that effect mixer settings.

stf92 10-08-2011 04:15 PM

It's no use. I followed your instructions but did not solve the problem. I have an OPL3 Yamaha sound card in another machine. Alsaconf configurated the card and I had not this problem, although the version installed on that machine is slack 9.1.

I do not understand, because the sound chip, C-Media CMI9738, which is a subset of SiS SI7018, is a very popular chip. I mean, it is or was widely known. And that linux does not have the proper driver for it seems to me an extremely improbable case.

Perhaps I did not describe the problem in much detail: I start play, let's say play though it could be any other audio media player, and have to go to the console that is running alsamixer to lower the volume, which I find at 100% (it is the PCM Front control). Now the volume is at, lets say, 68%. And there it stays until play ends execution. I now rerun play. And again alsamixer shows the PCM Front control at 100%.

That would be the description of the problem, but of course, there might be other things that could be pinpointed. Or some tests could be made, the results of which I could send to the forum.

allend 10-08-2011 09:48 PM

Apparently this is a known problem with your hardware. There is no PCM volume register on the chip. http://comments.gmane.org/gmane.linux.alsa.user/5587
From http://alsa.opensrc.org/Intel8x0_user_comments
Quote:

For everyone who's missing volume control with his CMedia 9739 onboard sound chip, here are the facts I found out so far. This chip is used at least on Epox 8RDA3+ and maybe in every newer nforce2 chipset. (Who knows where else it is used?) The general problem with the 9739 is that it doesn't have a volume control in hardware.
There are some suggested fixes under this quote.

ReaperX7 10-09-2011 04:41 AM

There's a package called "alsaequal" at SlackBuilds.org that might prove useful with the C-Media 9739 Codec. It adds the Equalizer module to alsamixer to adjust the channels for input and output. You might do well to adjust the channels with the audio maxed to see if maybe reducing channel I/O in certain ways will clear up your audio. It often will help with these types of audio codecs because they lack a dedicated hardware controller.

stf92 10-09-2011 03:00 PM

Quote:

Originally Posted by ReaperX7 (Post 4493678)
There's a package called "alsaequal" at SlackBuilds.org that might prove useful with the C-Media 9739 Codec. It adds the Equalizer module to alsamixer to adjust the channels for input and output. You might do well to adjust the channels with the audio maxed to see if maybe reducing channel I/O in certain ways will clear up your audio. It often will help with these types of audio codecs because they lack a dedicated hardware controller.

Thank you very much.

ReaperX7 10-09-2011 05:19 PM

Welcome. Let us know how it goes.

Gerard Lally 10-09-2011 06:27 PM

Is this sound card a PCI card? If so, have you disabled onboard audio?

stf92 10-09-2011 06:42 PM

Well, it is an onboard chipset.

allend 10-09-2011 08:37 PM

Apparently the ALSA Soft Volume plugin will help with this.
From http://www.sabi.co.uk/Notes/linuxSou...l#chipsCMI973x
Quote:

More importantly, the chip seems not to have the ability to change sound volume, and one needs a software volume control, like the newly introduced softvol plugin for /etc/asound.conf.
From http://www.alsa-project.org/alsa-doc...m_plugins.html
Code:

pcm.name {
        type softvol            # Soft Volume conversion PCM
        slave STR              # Slave name
        # or
        slave {                # Slave definition
                pcm STR        # Slave PCM name
                # or
                pcm { }        # Slave PCM definition
                [format STR]    # Slave format
        }
        control {
                name STR        # control element id string
                [card STR]      # control card index
                [iface STR]    # interface of the element
                [index INT]    # index of the element
                [device INT]    # device number of the element
                [subdevice INT] # subdevice number of the element
                [count INT]    # control channels 1 or 2 (default: 2)
        }
        [min_dB REAL]          # minimal dB value (default: -51.0)
        [max_dB REAL]          # maximal dB value (default:  0.0)
        [resolution INT]        # resolution (default: 256)
                                # resolution = 2 means a mute switch
}


stf92 10-10-2011 02:31 AM

Thank you. I will study these links. Meanwhile, I noticed I have no asound.conf. Then I ran alsaconf. It said:
Code:

Following cards are found on your system.
Choose a soundcard to configure.

Trident      SiS PCI audio accelerator
mpu401        snd-mpu401
legacy        Probe legacy ISA (non-PnP) chips

        <OK>        <Cancel>

As far as I know, I have no ISA cards in my machine. I picked Trident and pressed OK. Finally it said "Now ALSA is ready to use". But still no asound.conf.

allend 10-10-2011 07:44 AM

From http://alsa.opensrc.org/.asoundrc
Quote:

The .asoundrc file (in your home directory) and /etc/asound.conf (for system-wide settings) are the configuration files for ALSA drivers. Neither file is required for ALSA to work properly. Most applications will work without them. The main use of these two configuration files is to add functionality such as routing and sample-rate conversion. It allows you to create "virtual devices" that pre or post-process audio streams. Any properly written ALSA program can use these virtual devices as though they were normal devices.


All times are GMT -5. The time now is 01:10 AM.