2000-11-24 14:19:27

by Dick Streefland

[permalink] [raw]
Subject: 2.4.0-test11: es1371 mixer problems

2.4.0-test11 introduced a problem with the mixer device of my SB128
soundcard (es1371 driver). When I start a mixer application like
xmixer or aumix, only a small subset of the mixer devices are available.
With 2.4.0-test10, using the same .config, all devices are available.

I've looked through the test11 patch and noticed that it contains
a lot of changes like:

_IOC_DIR --> _SIOC_DIR
_IOC_READ --> _SIOC_READ
_IOC_WRITE --> _SIOC_WRITE
_IOC_SIZE --> _SIOC_SIZE

These changes are not yet applied to ac97.c and ac97_codec.c, but that
does not seem to be the problem, because after making these changes
(see patch below), the problem persists.

--
Dick Streefland //// TASKING Software BV
[email protected] (@ @) http://www.tasking.com
--------------------------------oOO--(_)--OOo---------------------------

--- linux-2.4.0-test11/drivers/sound/ac97.c.orig Fri Jan 7 00:01:56 2000
+++ linux-2.4.0-test11/drivers/sound/ac97.c Thu Nov 23 00:02:31 2000
@@ -407,19 +407,19 @@
/* Read or write request. */
ret = -EINVAL;
if (_IOC_TYPE (cmd) == 'M') {
- int dir = _IOC_DIR (cmd);
+ int dir = _SIOC_DIR (cmd);
int channel = _IOC_NR (cmd);

if (channel >= 0 && channel < SOUND_MIXER_NRDEVICES) {
ret = 0;
- if (dir & _IOC_WRITE) {
+ if (dir & _SIOC_WRITE) {
int val;
if (get_user (val, (int *) arg) == 0)
ret = ac97_set_mixer (dev, channel, val);
else
ret = -EFAULT;
}
- if (ret >= 0 && (dir & _IOC_READ)) {
+ if (ret >= 0 && (dir & _SIOC_READ)) {
if (dev->last_written_OSS_values[channel]
== AC97_REGVAL_UNKNOWN)
dev->last_written_OSS_values[channel]
--- linux-2.4.0-test11/drivers/sound/ac97_codec.c.orig Tue Nov 21 21:41:02 2000
+++ linux-2.4.0-test11/drivers/sound/ac97_codec.c Thu Nov 23 00:02:45 2000
@@ -405,13 +405,13 @@
return 0;
}

- if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+ if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
return -EINVAL;

if (cmd == OSS_GETVERSION)
return put_user(SOUND_VERSION, (int *)arg);

- if (_IOC_DIR(cmd) == _IOC_READ) {
+ if (_SIOC_DIR(cmd) == _SIOC_READ) {
switch (_IOC_NR(cmd)) {
case SOUND_MIXER_RECSRC: /* give them the current record source */
if (!codec->recmask_io) {
@@ -451,7 +451,7 @@
return put_user(val, (int *)arg);
}

- if (_IOC_DIR(cmd) == (_IOC_WRITE|_IOC_READ)) {
+ if (_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) {
codec->modcnt++;
if (get_user(val, (int *)arg))
return -EFAULT;


2000-11-30 13:19:55

by Dick Streefland

[permalink] [raw]
Subject: Re: 2.4.0-test11: es1371 mixer problems

Dick Streefland <[email protected]> wrote:
| 2.4.0-test11 introduced a problem with the mixer device of my SB128
| soundcard (es1371 driver). When I start a mixer application like
| xmixer or aumix, only a small subset of the mixer devices are available.
| With 2.4.0-test10, using the same .config, all devices are available.

This is a followup to my own message to report that the mixer is
working again after I disabled the CONFIG_SOUND_TVMIXER option. I
don't know what exactly this option does (no help text), but since I
have a Hauppauge (BT878) TV-card, I did enable this option. In
test11, drivers/media/video/tvmixer.c was modified so that it now
looks for tvmixer devices, and it actually finds one:

tvmixer: debug: MSP3415D-A2
tvmixer: MSP3415D-A2 (bt848 #0) registered with minor 0
tvmixer: debug: (unset)

This mixer probably replaces the normal AC97 mixer device. So, in
what situations do you need CONFIG_SOUND_TVMIXER? It would be nice if
someone could come up with an entry for Documentation/Configure.help.

--
Dick Streefland //// TASKING Software BV
[email protected] (@ @) http://www.tasking.com
--------------------------------oOO--(_)--OOo---------------------------

2000-11-30 18:14:57

by Dick Streefland

[permalink] [raw]
Subject: Re: 2.4.0-test11: es1371 mixer problems

On Thursday 2000-11-30 18:24, Robert Schiele wrote:
| On Thu, Nov 30, 2000 at 01:47:25PM +0100, Dick Streefland wrote:
| > This mixer probably replaces the normal AC97 mixer device. So, in
| > what situations do you need CONFIG_SOUND_TVMIXER? It would be nice if
| > someone could come up with an entry for Documentation/Configure.help.
|
| In fact it does not 'replace' the other mixer device, but it adds
| another one. The problem on your system is, that you load the new
| module before your sound card module.
| This means with only your sound card module, the mixer for your sound
| card is major 14/minor 0. With tvmixer module loaded before your sound
| card module, major 14/minor 0 is assigned to tvmixer and your sound
| card mixer gets major 14/minor 16. This is a problem for some mixer
| applications, because they always control the first mixer device.
| So you should just make sure, your sound card module is loaded
| _before_ the tvmixer module.

OK, that makes it somewhat clearer to me. However, I don't use modules
and have everything compiled in, so I can't control the order in which
the mixer devices get loaded. Perhaps the initialization order in the
kernel should be changed?

Excuse my ignorance, but what exactly is the purpose of the tvmixer?
I'm currently controlling the TV audio volume with the ac97 mixer,
using an external cable between the TV card and sound card.

--
Dick Streefland //// TASKING Software BV
[email protected] (@ @) http://www.tasking.com
--------------------------------oOO--(_)--OOo---------------------------

2000-11-30 20:11:24

by Robert Schiele

[permalink] [raw]
Subject: Re: 2.4.0-test11: es1371 mixer problems

On Thu, Nov 30, 2000 at 01:47:25PM +0100, Dick Streefland wrote:
> Dick Streefland <[email protected]> wrote:
> | 2.4.0-test11 introduced a problem with the mixer device of my SB128
> | soundcard (es1371 driver). When I start a mixer application like
> | xmixer or aumix, only a small subset of the mixer devices are available.
> | With 2.4.0-test10, using the same .config, all devices are available.
>
> This is a followup to my own message to report that the mixer is
> working again after I disabled the CONFIG_SOUND_TVMIXER option. I
> don't know what exactly this option does (no help text), but since I
> have a Hauppauge (BT878) TV-card, I did enable this option. In
> test11, drivers/media/video/tvmixer.c was modified so that it now
> looks for tvmixer devices, and it actually finds one:
>
> tvmixer: debug: MSP3415D-A2
> tvmixer: MSP3415D-A2 (bt848 #0) registered with minor 0
> tvmixer: debug: (unset)
>
> This mixer probably replaces the normal AC97 mixer device. So, in
> what situations do you need CONFIG_SOUND_TVMIXER? It would be nice if
> someone could come up with an entry for Documentation/Configure.help.

In fact it does not 'replace' the other mixer device, but it adds
another one. The problem on your system is, that you load the new
module before your sound card module.
This means with only your sound card module, the mixer for your sound
card is major 14/minor 0. With tvmixer module loaded before your sound
card module, major 14/minor 0 is assigned to tvmixer and your sound
card mixer gets major 14/minor 16. This is a problem for some mixer
applications, because they always control the first mixer device.
So you should just make sure, your sound card module is loaded
_before_ the tvmixer module.

Robert

--
Robert Schiele mailto:[email protected]
Tel./Fax: +49-621-10059 http://webrum.uni-mannheim.de/math/rschiele/


Attachments:
(No filename) (1.84 kB)
(No filename) (524.00 B)
Download all attachments

2000-11-30 20:55:57

by Gerd Knorr

[permalink] [raw]
Subject: Re: 2.4.0-test11: es1371 mixer problems

> OK, that makes it somewhat clearer to me. However, I don't use modules
> and have everything compiled in, so I can't control the order in which
> the mixer devices get loaded.

Exactly that's why I compile nearly everything as modules :-)
The other reason is that the turn-around times for driver hacking
are *much* smaller (until you managed to code a bug which kills
your box...).

> Perhaps the initialization order in the
> kernel should be changed?

Just because you don't like it? No. Get real. Most newer gui mixer's
I've seen allow you to switch between mixer devices with tab's. Even
the other ones allow you to specify the device you want to use. And if
you will never ever use tvmixer just disable it.

> Excuse my ignorance, but what exactly is the purpose of the tvmixer?

Control volume/bass/treble of the TV card (assuming the hardware allows
this, doesn't work with all cards).

> I'm currently controlling the TV audio volume with the ac97 mixer,
> using an external cable between the TV card and sound card.

That's why most people don't need it. If you would have connected your
speakers directly to the TV card without the soundcard (+ assorted mixer)
inbetween you would probably love tvmixer...

Gerd

--
Wirtschaftsinformatiker == Leute, die zwar die aktuellen Aktienkurse
jedes Softwareherstellers kennen, aber keines der Produkte auch nur
ansatzweise bedienen k?nnen. -- Benedict Mangelsdorff

2000-11-30 21:19:10

by Brian McGroarty

[permalink] [raw]
Subject: Re: 2.4.0-test11: es1371 mixer problems

On Thu, Nov 30, 2000 at 06:42:09PM +0100, Dick Streefland wrote:
> On Thursday 2000-11-30 18:24, Robert Schiele wrote:
> | On Thu, Nov 30, 2000 at 01:47:25PM +0100, Dick Streefland wrote:
> | > This mixer probably replaces the normal AC97 mixer device. So, in
> | > what situations do you need CONFIG_SOUND_TVMIXER? It would be nice if
> | > someone could come up with an entry for Documentation/Configure.help.
> |
> | In fact it does not 'replace' the other mixer device, but it adds
> | another one. The problem on your system is, that you load the new
> | module before your sound card module.
> | This means with only your sound card module, the mixer for your sound
> | card is major 14/minor 0. With tvmixer module loaded before your sound
> | card module, major 14/minor 0 is assigned to tvmixer and your sound
> | card mixer gets major 14/minor 16. This is a problem for some mixer
> | applications, because they always control the first mixer device.
> | So you should just make sure, your sound card module is loaded
> | _before_ the tvmixer module.
>
> OK, that makes it somewhat clearer to me. However, I don't use modules
> and have everything compiled in, so I can't control the order in which
> the mixer devices get loaded. Perhaps the initialization order in the
> kernel should be changed?

Ditto this problem with via82c686a audio - likely all sound cards with
tvmixer linked in.

If initialization order in the kernel is not changed and you don't
want modules, you can swap /dev/mixer0 and /dev/mixer1 as an inelegant
workaround.


> Excuse my ignorance, but what exactly is the purpose of the tvmixer?
> I'm currently controlling the TV audio volume with the ac97 mixer,
> using an external cable between the TV card and sound card.

There exists a mixer for the pass-through on the WinTV bt848 cards at
least, as well as treble/bass control. Many stations broadcast with
obscene amounts of bass, and so access to this is nice as you don't
have to spoil your main EQ.