public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wallak <wallak@free.fr>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: OSS audio compatibility layer regression - Linux-3.x - unable to register OSS PCM device 0:0
Date: Mon, 12 Dec 2011 23:12:59 +0100	[thread overview]
Message-ID: <4EE67C6B.8000206@free.fr> (raw)
In-Reply-To: <s5h1usaw1ut.wl%tiwai@suse.de>


Takashi Iwai wrote:
> At Sat, 10 Dec 2011 20:32:54 +0100,
> wallak@free.fr wrote:
>> I've an issue, when I use the SND_OSSEMUL compatibility layer with the
>> snd_intel8x0 module. The devices can't be registered. Indeed, theses devices are
>> registered at the oss_init() stage, and are not available later. A patch to fix
>> this issue is available below. The patch uses the previous linux behavior.
> I guess you set CONFIG_SOUND_OSS=y?  This conflicts with the OSS
> emulation.  It looked as if both can co-exist in the former kernels,
> but it's just because we didn't check it strictly.  Both try to
> register the very same devices -- especially OSS does this at init
> even before needed.
> As a workaround, just disable CONFIG_SOUND_OSS unless you really need
> it.  Or, if this isn't the case, give your .config file.
>
> If this is the case, we can add a Kconfig rule to exclude the
> conflict in future...
>
>
> thanks,
>
> Takashi

Thanks; I will update the .config file.

Best Regards,
Wallak.

>>
>> Best Regards,
>> Wallak.
>>
>>
>> #log output
>> snd_intel8x0 0000:00:1f.5: PCI INT B ->  Link[LNKB] ->  GSI 10 (level, low) ->  IRQ
>> 10
>> intel8x0_measure_ac97_clock: measured 54899 usecs (2645 samples)
>> intel8x0: clocking to 48000
>> unable to register OSS PCM device 0:0
>> Bridge firewalling registered
>>
>> #patch fixing this issue: (commit 848669da3a92fa6ab815e0517af3294afb3ea928 adds
>> this issue)
>> --- linux-3.1.5-mdf/sound/oss/soundcard.c.orig    2011-12-09 17:57:05.000000000
>> +0100
>> +++ linux-3.1.5-mdf/sound/oss/soundcard.c    2011-12-10 15:18:02.000000000 +0100
>> @@ -526,21 +526,31 @@
>>   }
>>
>>
>> +/* These device names follow the official Linux device list,
>> + * Documentation/devices.txt.  Let us know if there are other
>> + * common names we should support for compatibility.
>> + * Only those devices not created by the generic code in sound_core.c are
>> + * registered here.
>> + */
>> +static const struct {
>> +    unsigned short minor;
>> +    char *name;
>> +    umode_t mode;
>> +    int *num;
>> +} dev_list[] = { /* list of minor devices */
>> +/* seems to be some confusion here -- this device is not in the device list */
>> +    {SND_DEV_DSP16,     "dspW",     S_IWUGO | S_IRUSR | S_IRGRP,
>> +&num_audiodevs},
>> +    {SND_DEV_AUDIO,     "audio",     S_IWUGO | S_IRUSR | S_IRGRP,
>> +&num_audiodevs},
>> +};
>> +
>>   static int dmabuf;
>>   static int dmabug;
>>
>>   module_param(dmabuf, int, 0444);
>>   module_param(dmabug, int, 0444);
>>
>> -/* additional minors for compatibility */
>> -struct oss_minor_dev {
>> -    unsigned short minor;
>> -    unsigned int enabled;
>> -} dev_list[] = {
>> -    { SND_DEV_DSP16 },
>> -    { SND_DEV_AUDIO },
>> -};
>> -
>>   static int __init oss_init(void)
>>   {
>>       int             err;
>> @@ -561,12 +571,18 @@
>>       sound_dmap_flag = (dmabuf>  0 ? 1 : 0);
>>
>>       for (i = 0; i<  ARRAY_SIZE(dev_list); i++) {
>> -        j = 0;
>> -        do {
>> -            unsigned short minor = dev_list[i].minor + j * 0x10;
>> -            if (!register_sound_special(&oss_sound_fops, minor))
>> -                dev_list[i].enabled = (1<<  j);
>> -        } while (++j<  num_audiodevs);
>> +        device_create(sound_class, NULL,
>> +                  MKDEV(SOUND_MAJOR, dev_list[i].minor), NULL,
>> +                  "%s", dev_list[i].name);
>> +
>> +        if (!dev_list[i].num)
>> +            continue;
>> +
>> +        for (j = 1; j<  *dev_list[i].num; j++)
>> +            device_create(sound_class, NULL,
>> +                      MKDEV(SOUND_MAJOR,
>> +                        dev_list[i].minor + (j*0x10)),
>> +                      NULL, "%s%d", dev_list[i].name, j);
>>       }
>>
>>       if (sound_nblocks>= MAX_MEM_BLOCKS - 1)
>> @@ -580,11 +596,11 @@
>>       int i, j;
>>
>>       for (i = 0; i<  ARRAY_SIZE(dev_list); i++) {
>> -        j = 0;
>> -        do {
>> -            if (dev_list[i].enabled&  (1<<  j))
>> -                unregister_sound_special(dev_list[i].minor);
>> -        } while (++j<  num_audiodevs);
>> +        device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
>> +        if (!dev_list[i].num)
>> +            continue;
>> +        for (j = 1; j<  *dev_list[i].num; j++)
>> +            device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor +
>> (j*0x10)));
>>       }
>>
>>       unregister_sound_special(1);
>>


      reply	other threads:[~2011-12-12 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10 19:32 OSS audio compatibility layer regression - Linux-3.x - unable to register OSS PCM device 0:0 wallak
2011-12-12  9:55 ` Takashi Iwai
2011-12-12 22:12   ` Wallak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE67C6B.8000206@free.fr \
    --to=wallak@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox