Re: Some fixes for alsa_stream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 06/15/2011 04:25 PM, Mauro Carvalho Chehab wrote:
Em 15-06-2011 10:43, Hans de Goede escreveu:

<snip>

>> Right, because ConsoleKit ensures that devices like floppydrives, cdroms, audio cards,
>> webcams, etc. are only available to users sitting behind the console,
>
> This is a wrong assumption. There's no good reason why other users can't access those
> devices.

This is not an assumption, this is a policy decision. The policy is that devices like
audiocards and webcams should be only available to local console users / processes. To
avoid for example someone from spying upon someone else sitting behind the computer.

<snip>

3) console, with mmap disabled:

Alsa devices: cap: hw:1,0 (/dev/video0), out: default
Alsa stream started, capturing from hw:1,0, playing back on default at 1 Hz
write error: Input/output error
...
write error: Input/output error


This is a combination of the assumption there is a shared period size between
the input device and the output device + the broken error handling.

The code is doing a negotiation, in order to find a period that are acceptable
by both. Ok, there are other ways of doing it, but sharing the same period
probably means less overhead.


This is what we call a premature optimization, there is not all that much
overhead here, and demanding that both sizes will support a share period size
may not always fly, and may likely lead to unnecessary large period sizes
and thus too much latency in some cases.

<snip>

If you do some tests with mplayer and a few audio devices, you'll find that
the audio performance may degrade the video streaming up to some point where
you can't see the video stream. It is wise to offer a few options to the
user, in order to allow workaround on that.

Since we're doing the audio from a separate thread here, and do no syncing
that cannot happen here. Also the right thing to do is to fix the code
to work under all circumstances not offer a gazillion cmdline options
and let the user figure out which ones happen to work for him.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux