Inconsistent order of channels on C-Media 7.1 channel device
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- linux, python
- Ambito
- audio-video-rtc
Direzione di ricerca
The reproduction is the sine_wave/eightchan script that writes 8 channels to the surround71:CARD=ICUSBAUDIO7D,DEV=0 device; the attached alsa-info output holds the device's channel layout. Start by running the script several times and recording which jack carries which amplitude, then compare against the channel map ALSA reports for that card. Done means identifying whether the reordering comes from the USB driver or from alsa-lib's channel mapping, with a reproducible finding recorded in the issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have a USB sound device (Startech ICUSBAUDIO7D, which comes up as ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device through lsusb) which I'm trying to program the output of for 8 channels. The python code (outputs a 50Hz sine wave) I'm using is below (each channel gets a different amplitude so I can identify them with an oscilloscope).
The sound card has 4 stereo jacks, to which I have a scope connected.
The problem is that on different runs of the program, the output mappings are not consistent - each run of the program might have the order of the channels different to the previous. So running it one time might have amplitudes (0, 0.125) on the first jack, but the next run it might have those (0.75, 0.25) on the first jack (it doesn't appear to be 'paired' per jack)
I initially discovered this when using portaudio, and decided to try using alsa-only and the issue persists.
Is this likely to be a problem with the driver, alsa-lib, or is there something else going on here?
import numpy as np
import alsaaudio
def sine_wave(amplitude=1, freq=50, sample_rate=48000):
wave_len = sample_rate/freq
samples = (amplitude * 32767 * np.sin(2 * np.pi * np.arange(wave_len) * freq / sample_rate)).astype(np.int16)
return samples
def eightchan(freq=50, sample_rate=48000):
wave_len = sample_rate//freq
frames = np.zeros((wave_len, 8), dtype=np.int16)
samples = sine_wave()
for c in range(8):
frames[:wave_len,c] = samples[:wave_len]*(c/8)
return frames.tobytes()
if __name__ == '__main__':
pcm = alsaaudio.PCM(device='surround71:CARD=ICUSBAUDIO7D,DEV=0', format=alsaaudio.PCM_FORMAT_S16_LE, channels=8, rate=48000, type=alsaaudio.PCM_PLAYBACK, periodsize=960, periods=1)
frames = eightchan()
while True:
pcm.write(frames)
alsa-info output is attached
alsa-info.txt
- Lingua principale
- C
- Stelle
- 501
- Fork
- 227
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alsa-project/alsa-lib
-
USB-Audio: ASUS ROG Zenith II S/PDIF output mapped to wrong PCM deviceForse già presa @byrcolin l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
alsa-project/alsa-lib#532 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
alsa-project/alsa-lib#530 · 9 reazioni ·
-
kernel driver
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
alsa-project/alsa-lib#529 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
alsa-project/alsa-lib#522 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
alsa-project/alsa-lib#519 ·
Tutte le issue di alsa-project/alsa-lib
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
fastfetch-cli/fastfetch#2780 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elliotchance/vsql#2079 ·
I maintainer di solito rispondono entro 1 giorno
-
docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
I maintainer di solito rispondono entro 13 giorni
-
threadpool: a failed `pthread_cond_wait` makes Mlucas hang instead of stoppingForse già presa @leinardi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
primesearch/Mlucas#398 ·