All of lore.kernel.org
 help / color / mirror / Atom feed
* Have multiple opens removed on one device?
@ 2011-08-22 10:13 Scott Jiang
  2011-08-22 10:15 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Jiang @ 2011-08-22 10:13 UTC (permalink / raw)
  To: Mark Brown, Takashi Iwai; +Cc: alsa-devel

Hi Mark and Takashi,

In kernel 2.6.34 I can use aplay to play audio at the same time, alsa
will mix the audio. Now the second open will return device busy.
So it seems this feature has been removed. What's the proper approach
for this operation at present?

Thanks.

Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Have multiple opens removed on one device?
  2011-08-22 10:13 Have multiple opens removed on one device? Scott Jiang
@ 2011-08-22 10:15 ` Takashi Iwai
  2011-08-22 11:21   ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2011-08-22 10:15 UTC (permalink / raw)
  To: Scott Jiang; +Cc: alsa-devel, Mark Brown

At Mon, 22 Aug 2011 18:13:03 +0800,
Scott Jiang wrote:
> 
> Hi Mark and Takashi,
> 
> In kernel 2.6.34 I can use aplay to play audio at the same time, alsa
> will mix the audio.

No, kernel part doesn't do such a thing.  If it's mixed, it must be
in the user-space (either dmix or a daemon like pulseaudio), unless
you hardware can do mixing by itself.

> Now the second open will return device busy.

So, something else must have been changed in your system...


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Have multiple opens removed on one device?
  2011-08-22 10:15 ` Takashi Iwai
@ 2011-08-22 11:21   ` Mark Brown
  2011-08-29 10:11     ` Scott Jiang
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-08-22 11:21 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Scott Jiang, alsa-devel

On Mon, Aug 22, 2011 at 12:15:58PM +0200, Takashi Iwai wrote:
> Scott Jiang wrote:

> > In kernel 2.6.34 I can use aplay to play audio at the same time, alsa
> > will mix the audio.

> No, kernel part doesn't do such a thing.  If it's mixed, it must be
> in the user-space (either dmix or a daemon like pulseaudio), unless
> you hardware can do mixing by itself.

There *are* some cards (mostly older ones like emu10k) that support
multiple streams transparently but this has never been supported in
ASoC due a lack of hardware that can do it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Have multiple opens removed on one device?
  2011-08-22 11:21   ` Mark Brown
@ 2011-08-29 10:11     ` Scott Jiang
  2011-09-01  3:43       ` Scott Jiang
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Jiang @ 2011-08-29 10:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel

2011/8/22 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Mon, Aug 22, 2011 at 12:15:58PM +0200, Takashi Iwai wrote:
>> Scott Jiang wrote:
>
>> > In kernel 2.6.34 I can use aplay to play audio at the same time, alsa
>> > will mix the audio.
>
>> No, kernel part doesn't do such a thing.  If it's mixed, it must be
>> in the user-space (either dmix or a daemon like pulseaudio), unless
>> you hardware can do mixing by itself.
>
> There *are* some cards (mostly older ones like emu10k) that support
> multiple streams transparently but this has never been supported in
> ASoC due a lack of hardware that can do it.
>

Hi Mark,

Indeed we use dmix. But now we can't open the same device twice.
Our alsa lib and utils version is 1.0.18.
The test command: aplay 1.wav &; aplay 1.wav
In 2.6.34, strace
open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 4
open("/dev/snd/pcmC0D0p", O_RDWR|O_APPEND|O_NONBLOCK) = 4

In 3.0, strace
open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 4
open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = -1 EBUSY (Device or
resource busy)

The O_APPEND flag missed in new kernel. But we use the same lib and
utils. It's strange.
And I found the prefer subdevice changes from 0 to -1. These two
changes cause kernel return device busy.

Mark, can you do this simple test on your board? I appreciate your
help. Thank you very much.

Regards,
Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Have multiple opens removed on one device?
  2011-08-29 10:11     ` Scott Jiang
@ 2011-09-01  3:43       ` Scott Jiang
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Jiang @ 2011-09-01  3:43 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel

2011/8/29 Scott Jiang <scott.jiang.linux@gmail.com>:
>
> Indeed we use dmix. But now we can't open the same device twice.
> Our alsa lib and utils version is 1.0.18.
> The test command: aplay 1.wav &; aplay 1.wav
> In 2.6.34, strace
> open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 4
> open("/dev/snd/pcmC0D0p", O_RDWR|O_APPEND|O_NONBLOCK) = 4
>
> In 3.0, strace
> open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 4
> open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = -1 EBUSY (Device or
> resource busy)
>
> The O_APPEND flag missed in new kernel. But we use the same lib and
> utils. It's strange.
> And I found the prefer subdevice changes from 0 to -1. These two
> changes cause kernel return device busy.
>
> Mark, can you do this simple test on your board? I appreciate your
> help. Thank you very much.
>

I know the reason. The card config file didn't read properly.
Asoc doesn't copy codec name to card->driver now. I guess it is
because multiple codecs are supported.
I add driver_name in my snd_soc_card to solve this bug. But I scan
other drivers in asoc, nobody did this.
Maybe nobody are aware of this. Are there any better way to solve this bug?

Regards,
Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-01  3:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22 10:13 Have multiple opens removed on one device? Scott Jiang
2011-08-22 10:15 ` Takashi Iwai
2011-08-22 11:21   ` Mark Brown
2011-08-29 10:11     ` Scott Jiang
2011-09-01  3:43       ` Scott Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.