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

sndio backend fails unless sndiod (daemon) is started on FreeBSD #746

Open
jbeich opened this issue Apr 12, 2023 · 2 comments
Open

sndio backend fails unless sndiod (daemon) is started on FreeBSD #746

jbeich opened this issue Apr 12, 2023 · 2 comments

Comments

@jbeich
Copy link
Contributor

jbeich commented Apr 12, 2023

Regressed by #743. Affects cubeb-test but not test_audio. CC @ratchov
Found via RPCS3/Yuzu/Citra which unlike Firefox (see media.cubeb.backend) don't expose a way to force a specific cubeb backend.

$ pkg install cmake ninja googletest sndio
$ export CFLAGS="-isystem/usr/local/include" CXXFLAGS="-isystem/usr/local/include" LDFLAGS="-L/usr/local/lib"
$ cmake -G Ninja -B /tmp/cubeb_build
$ cmake --build /tmp/cubeb_build

$ /tmp/cubeb_build/cubeb-test
Log level is DISABLED
Init cubeb backend: sndio
collection device type is UNKNOWN
cubeb.c:625:DeviceID: "default" (PREFERRED)
        Name:   "default"
        Group:  "default"
        Vendor: "(null)"
        Type:   output
        State:  enabled
        Maximum channels:       8
        Format: S16LE (0x10) (default: S16LE)
        Rate:   [4000, 192000] (default: 48000)
        Latency: lo 480 frames, hi 9600 frames
Found 1 output devices. Choose one:
# 0
        name: system default device
# 1  (PREFERRED)
        name: default
        device id: default
        max channels: 8
        state: enabled
Enter device number: 0
Could not open the stream
stream_init failed
Abort trap
@ratchov
Copy link
Contributor

ratchov commented Apr 13, 2023

It seems that FreeBSD doesn't support LSB-aligned samples. FWIW, the current cubeb_sndio encoding is the native sndiod one, which avoids conversions on the sndiod side. Here's a quick diff to use the more common MSB-aligned encoding:

ratchov@8ec312d

Does it work for you?

@jbeich
Copy link
Contributor Author

jbeich commented Apr 13, 2023

ratchov@8ec312d doesn't help:

$ git fetch https://github.com/ratchov/cubeb sndio_s24_msb
$ git merge FETCH_HEAD
$ cmake --build /tmp/cubeb_build
$ /tmp/cubeb_build/cubeb-test
Log level is DISABLED
Init cubeb backend: sndio
collection device type is UNKNOWN
cubeb.c:625:DeviceID: "default" (PREFERRED)
        Name:   "default"
        Group:  "default"
        Vendor: "(null)"
        Type:   output
        State:  enabled
        Maximum channels:       8
        Format: S16LE (0x10) (default: S16LE)
        Rate:   [4000, 192000] (default: 48000)
        Latency: lo 480 frames, hi 9600 frames
Found 1 output devices. Choose one:
# 0
        name: system default device
# 1  (PREFERRED)
        name: default
        device id: default
        max channels: 8
        state: enabled
Enter device number: 0
Could not open the stream
stream_init failed
Abort trap

vishwin pushed a commit to vishwin/freebsd-ports that referenced this issue Apr 18, 2023
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants