-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Running latest Raspbian Desktop on a Pi4 with docker-compose.
I want to play sound though the headphone jacks, but it does not work.
When accessing the Settings page, it looks as reported by #32 and the backend logs show:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 502, in dispatch
response = handler(request, *args, **kwargs)
File "/code/restapi/views/volume_views.py", line 23, in get
volume = Volume()
File "/code/restapi/models/volume.py", line 7, in init
self.volume = SoundManager.get_volume()
File "/code/utils/sound_manager.py", line 22, in get_volume
vol = cls._get_mixer().getvolume()
File "/code/utils/sound_manager.py", line 13, in _get_mixer
mixer = alsaaudio.Mixer("PCM")
alsaaudio.ALSAAudioError: Unable to find mixer control PCM,0 [default]
amixer on the pi gives me:
Simple mixer control 'Master',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 1 [0%] [on]
Front Right: Playback 1 [0%] [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]
I opened a shell inside of the backend container and verified /dev/snd/ is present.
I installed amixer in the container, and it gave me
Simple mixer control 'HDMI',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback 0 [96%] [0.00dB] [on]
I already ran amixer cset numid=3 1
Audio from desktop applications works fine.
I only found this related thread.