{"record":{"id":"764425f036862edd","repo":"AlexxIT/go2rtc","slug":"alsa-format-s16le-not-supported","errorCode":null,"errorMessage":"alsa: format S16LE not supported","messagePattern":"alsa: format S16LE not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/alsa/open_linux.go","lineNumber":32,"sourceCode":"\t// alsa:device?audio=/dev/snd/pcmC0D0p\n\t// TODO: ?audio=default\n\t// TODO: ?audio=hw:0,0\n\t// TODO: &sample_rate=48000&channels=2\n\t// TODO: &backchannel=1\n\tu, err := url.Parse(rawURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpath := u.Query().Get(\"audio\")\n\tdev, err := device.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !dev.CheckFormat(device.SNDRV_PCM_FORMAT_S16_LE) {\n\t\t_ = dev.Close()\n\t\treturn nil, errors.New(\"alsa: format S16LE not supported\")\n\t}\n\n\tswitch path[len(path)-1] {\n\tcase 'p': // playback\n\t\treturn newPlayback(dev)\n\tcase 'c': // capture\n\t\treturn newCapture(dev)\n\t}\n\n\t_ = dev.Close()\n\treturn nil, fmt.Errorf(\"alsa: unknown path: %s\", path)\n}\n","sourceCodeStart":14,"sourceCodeEnd":45,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/alsa/open_linux.go#L14-L45","documentation":"ALSA Open's capability guard: the device opened fine but does not support the hardcoded PCM format S16_LE which this implementation requires. The device is closed and Open fails — the hardware/driver simply cannot provide 16-bit little-endian samples.","triggerScenarios":"Thrown at pkg/alsa/open_linux.go:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick a device (pcm path) whose driver supports S16_LE","Configure the system to enable S16 conversion via an ALSA 'plug' device (e.g. plug:... instead of hw:...)","Feed audio through a format-converting producer instead of direct ALSA"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}