lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Aug 2017 16:38:06 +0300
From:   Oleksandr Andrushchenko <andr2000@...il.com>
To:     Clemens Ladisch <clemens@...isch.de>
Cc:     alsa-devel@...a-project.org, xen-devel@...ts.xen.org,
        linux-kernel@...r.kernel.org,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>,
        tiwai@...e.com
Subject: Re: [alsa-devel] [PATCH 08/11] ALSA: vsnd: Add timer for period
 interrupt emulation

On 08/07/2017 04:11 PM, Clemens Ladisch wrote:
> Oleksandr Andrushchenko wrote:
>> On 08/07/2017 01:27 PM, Clemens Ladisch wrote:
>>> You have to implement period interrupts (and the .pointer callback)
>>> based on when the samples are actually moved from/to the backend.
>> Do you think I can implement this in a slightly different way,
>> without a timer at all, by updating
>> substream->runtime->hw_ptr_base explicitly in the frontend driver?
> As far as I am aware, hw_ptr_base is an internal field that drivers
> are not supposed to change.
I know that and always considered not a good solution,
this is why I have timer to emulate things
> Just use your own variable, and return it from the .pointer callback.
this can work, but see below
>> So, that way, whenever I get an ack/response from the backend that it has
>> successfully played the buffer
> That response should come after every period.

> How does that interface work?
For the buffer received in .copy_user/.copy_kernel we send
a request to the backend and get response back (async) when it has copied
the bytes into HW/mixer/etc, so the buffer at frontend side can be reused.
So, the amount of bytes in this exchange is not necessarily
a multiply of the period. Also, there is no way to synchronize period
sizes in the front driver and backend to make those equal.
There is also no event from the backend in the
protocol to tell that the period has elapsed, so
sending data in period's size buffers will not probably
help because of possible underruns
>   Is it possible to change the period size,
> or at least to detect what it is?

Unfortunately no, this is not in the protocol.

>
>
> Regards,
> Clemens
you can see the protocol at [1]

Thank you,
Oleksandr

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/include/xen/interface/io/sndif.h?h=for-next

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ