Commit Graph

664 Commits

Author SHA1 Message Date
dorindabassey
35fa83aa85
Merge pull request #31 from dorindabassey/safeq
pipewire.rs: use safe queue API
2023-09-18 12:40:24 +02:00
Dorinda Bassey
5984715806 audio_backends/pipewire.rs: use safe queue API
use safe queue API

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-09-14 14:52:09 +02:00
dorindabassey
62575fa25c
Merge pull request #28 from dorindabassey/rebasepw
crates/sound: Rebase pipewire backend
2023-09-13 10:56:52 +02:00
Dorinda Bassey
917d24c7fa crates/sound: Rebase pipewire backend
Rebase pipewire Backend

Co-authored-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
Co-authored-by: Dorinda Bassey <dbassey@redhat.com>

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-09-11 16:47:08 +02:00
Stefano Garzarella
428d349516
Merge pull request #27 from aesteve-rh/sound-null-unconditional
sound: always compile null backend
2023-09-04 15:54:26 +02:00
Albert Esteve
bf18c3ee62 sound: always compile null backend
Make Null backend compiled unconditionally,
removing the null-backend feature. That
allows having the other backend choices in
the BackendType enum to be conditional, and
make them not available if their features is
opted out at compile time.

For example, compiled with no backend features,
there is only choice (i.e., null) for --backend:

```
$ target/debug/vhost-user-sound --help

Usage: vhost-user-sound --socket <SOCKET> --backend <BACKEND>

Options:
      --socket <SOCKET>    vhost-user Unix domain socket path
      --backend <BACKEND>  audio backend to be used [possible values: null]
  -h, --help               Print help
  -V, --version            Print version
```

Fixes: #26
Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-09-04 11:26:31 +02:00
Stefano Garzarella
15516ccea4
Merge pull request #24 from aesteve-rh/virtio-sound-cli-backend
Change CLI backend option to ValueEnum
2023-09-04 09:54:31 +02:00
Albert Esteve
cd955a7132 sound: introduce rstest crate
Introduce 'rstest'[1] crate dependency to allow
run multiple parametrized tests (and fixtures).

[1] - https://docs.rs/rstest/latest/rstest/

Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-08-31 11:43:57 +02:00
Albert Esteve
4867edc009 sound: test cli backend argument
Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-08-31 11:43:17 +02:00
Albert Esteve
6c5b2db7db sound: audio backend allow unused
When compiled with no features, the `streams`
parameter of the alloc_audio_backend() function
is not used. Mark it as allowed to avoid the
compilation warning.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-08-31 11:41:47 +02:00
Albert Esteve
a48bff27b1 sound: cli backend selector
Change the CLI backend option to receive values
listed in a ValueEnum.

Current '--help' output:
```
A virtio-sound device using the vhost-user protocol.

Usage: vhost-user-sound --socket <SOCKET> --backend <BACKEND>

Options:
      --socket <SOCKET>  vhost-user Unix domain socket path
      --backend <BACKEND>  audio backend to be used [possible values:
      null, pipewire, alsa]
  -h, --help             Print help
  -V, --version          Print version
```

If a wrong backend is given, it give hints:
```
$ cargo run -- --socket /tmp/sound.sock --backend nul
error: invalid value 'nul' for '<BACKEND>'
  [possible values: null, pipewire, alsa]

  tip: a similar value exists: 'null'
```

Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-08-31 11:40:40 +02:00
Manos Pitsidianakis
855eefb380
sound: add ALSA backend
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-08-23 23:01:34 +03:00
Manos Pitsidianakis
b7122e66af
sound: Add TX queue handler
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-08-23 23:01:32 +03:00
Manos Pitsidianakis
ecf88fb602
sound: Add CTRL queue handler
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-08-23 23:00:19 +03:00
Manos Pitsidianakis
d385dcd1b2
sound: add Stream, ControlMessage and other types
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-08-23 23:00:17 +03:00
Manos Pitsidianakis
91a5259cce
Add vhost-user-sound crate
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-08-23 22:12:35 +03:00
Stefano Garzarella
583d15433b
Merge pull request #15 from dorindabassey/cargofmt
cargo fmt
2023-07-12 09:07:13 +02:00
Dorinda Bassey
e49e8117d7 cargo fmt
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-07-11 18:23:33 +02:00
Matias Ezequiel Vara Larsen
508508afaf
Merge pull request #9 from MatiasVara/vsound-set-param
Vsound set param
2023-07-11 17:56:33 +02:00
Matias Ezequiel Vara Larsen
03241612a7 Sound: Add set_param()
This commit adds the set_param() method. This method can only be called
if the stream is in the "set parameters", "prepare" or "release" state.
For the pw backend, this method only updates the internal values for the
given stream.

Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2023-07-11 12:08:30 +02:00
dorindabassey
4027f61d92
Merge pull request #14 from dorindabassey/pwnew
instantiate new backend with PW thread loop functions
2023-07-11 11:39:00 +02:00
Dorinda Bassey
08078b752c instantiate new backend with PW thread loop functions
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-07-10 18:58:06 +02:00
Matias Ezequiel Vara Larsen
3a0f49d279
Merge pull request #7 from MatiasVara/vsound-init-streamsinfo
Sound: initialize StreamInfo
2023-07-06 15:44:01 +02:00
Matias Ezequiel Vara Larsen
b3b83c1f41 Sound: initialize StreamInfo
This commit adds a vector named StreamInfo that contains the supported
configuration for the audio backends, e.g., rate, format. This
information is stored in the context of VhostUserSoundBackend. The
device reponses this information when getting the VIRTIO_SND_R_PCM_INFO
msg. The number of streams that are exposed in the device configuration
is got from this table.

Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2023-07-05 17:02:13 +02:00
dorindabassey
4cf4e675ff
Merge pull request #6 from dorindabassey/vsound_newtx
instantiate new backend
2023-07-03 16:57:26 +02:00
Dorinda Bassey
110ccd736c instantiate new backend
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-07-03 16:02:37 +02:00
Matias Ezequiel Vara Larsen
e77e32646d
Merge pull request #5 from MatiasVara/vsound-tx-queue
Vsound tx queue
2023-06-30 17:26:58 +02:00
Matias Ezequiel Vara Larsen
e3d5071246 Sound: add audio_backend parameter
Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2023-06-30 10:33:13 +02:00
Matias Ezequiel Vara Larsen
c4b253c433 Sound: Handle tx queue
This commit handles the pcm i/o messages to the tx transmission queue.
These msgs contains three descriptors: hdr, data and status. The data
descriptor shall be processed by the audio backend. The data may be
split in multiples descriptors.

Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2023-06-30 10:31:48 +02:00
dorindabassey
170933506c
Merge pull request #3 from dorindabassey/vsound_test
Sound: Handle control Queue
2023-06-21 13:14:23 +02:00
Dorinda Bassey
582a66ff07 Sound: Handle control queue
Handle ctrl msgs from the control Queue in method for handling control queue

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-06-21 13:02:58 +02:00
Stefano Garzarella
9f20f6502f
Merge pull request #4 from epilys/fix/chmaps-typo
rename typo virtio_snd_config.chmpas -> chmaps
2023-06-06 13:49:55 +02:00
Manos Pitsidianakis
d39140f82a
sound: rename typo virtio_snd_config.chmpas -> chmaps 2023-06-05 13:53:37 +03:00
Stefano Garzarella
63db2e8b41
Merge pull request #2 from dorindabassey/v_sound
sound: add PipeWire backend skeleton
2023-05-26 17:49:10 +02:00
Dorinda Bassey
05a959d703 sound: add PipeWire backend skeleton
to enable the pipewire backend feature, build with `--features pw-backend`

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-05-26 17:44:05 +02:00
Stefano Garzarella
a198f48cde sound: rename alloc_audio_backend 2023-05-19 18:19:47 +02:00
Stefano Garzarella
65f7c78dbd sound: support --backend option 2023-05-19 18:16:21 +02:00
Stefano Garzarella
82660840ca sound: add NullBackend skeleton 2023-05-19 18:11:14 +02:00
Stefano Garzarella
5e8fd650e9 sound: add AudioBackend trait 2023-05-19 18:11:14 +02:00
Stefano Garzarella
c3e2f6a4bc
Merge pull request #1 from dorindabassey/d_sound
virtio_sound.rs: Added device configuration and common definitions
2023-04-28 10:06:49 +02:00
Dorinda Bassey
16e927e10e virtio_sound.rs: Added device configuration and common definitions
Added device configuration and common definitions from the
virtio sound specifications to the header file

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-04-27 08:39:15 +02:00
Stefano Garzarella
2366b76718 sound: add missing files 2023-04-03 14:33:53 +02:00
Stefano Garzarella
b81c55fbe2 sound: code refactoring 2023-03-31 17:16:21 +02:00
Stefano Garzarella
8d3ebf35e1 sound: support multiple threads 2023-03-31 15:49:46 +02:00
Stefano Garzarella
72c31053ff Revert "sound: use thread trait"
This reverts commit 3ac6c160c1.
2023-03-31 12:05:58 +02:00
Stefano Garzarella
3ac6c160c1 sound: use thread trait 2023-03-30 20:56:42 +02:00
Stefano Garzarella
a1b49a76a7 sound: use interior mutability 2023-03-30 20:23:51 +02:00
Stefano Garzarella
0a78103b41 sound: initial commit 2023-03-30 18:47:15 +02:00
dependabot[bot]
a3427f5c34 build(deps): bump windows_aarch64_msvc from 0.42.1 to 0.42.2
Bumps [windows_aarch64_msvc](https://github.com/microsoft/windows-rs) from 0.42.1 to 0.42.2.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/commits)

---
updated-dependencies:
- dependency-name: windows_aarch64_msvc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 13:29:48 +05:30
dependabot[bot]
54f29fa041 build(deps): bump windows_x86_64_gnullvm from 0.42.1 to 0.42.2
Bumps [windows_x86_64_gnullvm](https://github.com/microsoft/windows-rs) from 0.42.1 to 0.42.2.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/commits)

---
updated-dependencies:
- dependency-name: windows_x86_64_gnullvm
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 13:29:40 +05:30