Changeset 2fbd49c in mainline for uspace/srv/audio/hound/hound.c


Ignore:
Timestamp:
2022-09-22T09:01:32Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2139676
Parents:
a76e76b
git-author:
Jiri Svoboda <jiri@…> (2022-09-21 18:01:20)
git-committer:
Jiri Svoboda <jiri@…> (2022-09-22 09:01:32)
Message:

Audio synk needs locking

Without locking the list of sink connections, we are exposed
to a race between removing a connection at the end of playback
(typically while destroying a hound context) and audio device
event PCM_EVENT_FRAMES_PLAYED which causes audio mixing to occur
via audio_sink_mix_inputs(), causing hound to crash often at
the end of playback.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/hound.c

    ra76e76b r2fbd49c  
    126126        assert(fibril_mutex_is_locked(&hound->list_guard));
    127127        log_verbose("Removing sink '%s'.", sink->name);
     128        fibril_mutex_lock(&sink->lock);
    128129        if (!list_empty(&sink->connections))
    129130                log_warning("Removing sink '%s' while still connected.", sink->name);
     
    135136        }
    136137        list_remove(&sink->link);
     138        fibril_mutex_unlock(&sink->lock);
    137139}
    138140
Note: See TracChangeset for help on using the changeset viewer.