Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sound] creation of multiple streams that are not destroyed #490

Closed
dorindabassey opened this issue Oct 19, 2023 · 0 comments · Fixed by #644
Closed

[sound] creation of multiple streams that are not destroyed #490

dorindabassey opened this issue Oct 19, 2023 · 0 comments · Fixed by #644
Labels
good first issue Good for newcomers

Comments

@dorindabassey
Copy link
Contributor

The regular PCM command lifecycle for playing a stream is SET_PARAMS -> PREPARE -> START -> STOP ->RELEASE -> SET_PARAMS-> PREPARE -> ..........
but there are some exceptional cases that do not follow the regular PCM command lifecycle, like in the case of using sox tool to play audio from the guest, to test this:
start the vhost-device-sound daemon on the host with pipewire backend option enabled and enable rust debug on the daemon
Install sox tool on the guest and run play /usr/share/sounds/alsa/Front_Left.wav from the guest.
The order of PCM commands using this tool is SET_PARAMS -> PREPARE -> SET_PARAMS -> PREPARE -> SET_PARAMS -> PREPARE -> START -> STOP ->RELEASE -> .........
This order of PCM commands is also valid sequence of commands however this scenario lead to multiple creation of pipewire streams that are not destroyed. We need to ensure that in a case like this, when the prepare fn() in the pipewire backend is called multiple times without the release fn(), there should be only one pipewire stream.

see virtio-sound#43

@stefano-garzarella stefano-garzarella added the good first issue Good for newcomers label Oct 19, 2023
dorindabassey pushed a commit to dorindabassey/vhost-device that referenced this issue Apr 2, 2024
The PCM command transition prepare->prepare or set_param->prepare
is allowed by the specification. however this type of transition
in pipewire lead to multiple creation of pipewire streams that are
not destroyed. This PR ensures that in a case like this,
when the prepare fn() in the pipewire backend is called multiple
times without the release fn(), there should be only one pipewire stream.

Close rust-vmm#490

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey pushed a commit to dorindabassey/vhost-device that referenced this issue Apr 2, 2024
The PCM command transition prepare->prepare or set_param->prepare
is allowed by the specification. Pipewire, however, creates multiple
streams which are not destroyed when this type of transition happens.
By using this PR, we can ensure that when the prepare function in the
pipewire backend is called multiple times without the release function,
only one pipewire stream is created.

Close rust-vmm#490

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey pushed a commit to dorindabassey/vhost-device that referenced this issue Apr 2, 2024
The PCM command transition prepare->prepare or set_param->prepare
is allowed by the specification. Pipewire, however, creates multiple
streams which are not destroyed when this type of transition happens.
By using this PR, we can ensure that when the prepare function in the
pipewire backend is called multiple times without the release function,
only one pipewire stream is created.

Close rust-vmm#490

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey pushed a commit to dorindabassey/vhost-device that referenced this issue Apr 4, 2024
The PCM command transition prepare->prepare or set_param->prepare
is allowed by the specification. Pipewire, however, creates multiple
streams which are not destroyed when this type of transition happens.
By using this PR, we can ensure that when the prepare function in the
pipewire backend is called multiple times without the release function,
only one pipewire stream is created.

Close rust-vmm#490

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey pushed a commit to dorindabassey/vhost-device that referenced this issue Apr 4, 2024
The PCM command transition prepare->prepare or set_param->prepare
is allowed by the specification. Pipewire, however, creates multiple
streams which are not destroyed when this type of transition happens.
By using this PR, we can ensure that when the prepare function in the
pipewire backend is called multiple times without the release function,
only one pipewire stream is created.

Close rust-vmm#490

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants