`USB-Audio`: Wrong S/PDIF (`iec958`) input and output

Đang mở
#292 5 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
c, linux

Hướng nghiên cứu

The behaviour sits in the card database at src/conf/cards/USB-Audio.conf, which decides how many iec958 (S/PDIF) inputs and outputs an unknown USB card gets. Reproduce by opening iec958:1 for playback and capture on a USB card that has no S/PDIF port, and read the thread for why the current default was chosen. Done would be a maintainer decision on the default, not a patch yet.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I am new to the Linux sound system. As I understand, USB sound cards doesn't directly tell the kernel or alsa-lib how many S/PDIF inputs and outputs they have. But they obviously tell their "brand name" like "Plantronics USB Headset" or "HP Digital Stereo Headset" for example.

To present the correct number of S/PDIF inputs and outputs to the rest of the userspace, alsa-lib seems to maintain a kind of known devices database in src/conf/cards/USB-Audio.conf.

If a USB card brand is not known in this file, alsa-lib always present a single S/PDIF input and a single S/PDIF output. If the index of this card is 1 for example, snd_pcm_open(&pcm, "iec958:1", SND_PCM_STREAM_PLAYBACK, 0) and snd_pcm_open(&pcm, "iec958:1", SND_PCM_STREAM_CAPTURE, 0) will always return 0 even if the USB device doesn't have a real S/PDIF input or output.

My question is why this is the default behavior? We are in a "every USB cards have S/PDIF, except those who are known in USB-Audio.conf" logic. I think it should be "None USB card has S/PDIF except those who are known for it in USB-Audio.conf" because USB devices without S/PDIF are much more common.

Cf https://bugs.launchpad.net/ubuntu/+source/alsa-lib/+bug/1002952

Thank you!

Ngôn ngữ chính
C
Star
501
Fork
227
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của alsa-project/alsa-lib

Tất cả issue của alsa-project/alsa-lib

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.