Merge pull request #75 from jusa/jb41899
Add quirk output_make_writable.
This commit is contained in:
commit
296a4840ed
4 changed files with 11 additions and 0 deletions
6
README
6
README
|
|
@ -289,6 +289,12 @@ Currently there are following quirks:
|
|||
* Some broken implementations are incorrectly probed for supporting hw
|
||||
volume control. This is manifested by always full volume with volume
|
||||
control not affecting volume level. To fix this enable this quirk.
|
||||
* output_make_writable
|
||||
* Disabled by default.
|
||||
* Some implementations modify write buffer in-place when this should
|
||||
not be done. This can result in random segfaults when playing audio.
|
||||
As a workaround make the buffer memchunk writable before passing to
|
||||
audio HAL.
|
||||
|
||||
For example, to disable input_atoi and enable close_input quirks, use module
|
||||
argument
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ struct droid_quirk valid_quirks[] = {
|
|||
{ "close_input", QUIRK_CLOSE_INPUT },
|
||||
{ "unload_no_close", QUIRK_UNLOAD_NO_CLOSE },
|
||||
{ "no_hw_volume", QUIRK_NO_HW_VOLUME },
|
||||
{ "output_make_writable", QUIRK_OUTPUT_MAKE_WRITABLE },
|
||||
};
|
||||
|
||||
struct pa_droid_quirks {
|
||||
|
|
|
|||
|
|
@ -293,6 +293,7 @@ enum pa_droid_quirk_type {
|
|||
QUIRK_CLOSE_INPUT,
|
||||
QUIRK_UNLOAD_NO_CLOSE,
|
||||
QUIRK_NO_HW_VOLUME,
|
||||
QUIRK_OUTPUT_MAKE_WRITABLE,
|
||||
QUIRK_COUNT
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -276,6 +276,9 @@ static int thread_write(struct userdata *u) {
|
|||
u->write_time = pa_rtclock_now();
|
||||
|
||||
for (;;) {
|
||||
if (pa_droid_quirk(u->hw_module, QUIRK_OUTPUT_MAKE_WRITABLE))
|
||||
pa_memchunk_make_writable(&c, c.length);
|
||||
|
||||
p = pa_memblock_acquire_chunk(&c);
|
||||
wrote = pa_droid_stream_write(u->stream, p, c.length);
|
||||
pa_memblock_release(c.memblock);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue