openairplay / airplay2-receiver

AirPlay 2 Receiver - Python implementation
2.12k stars 131 forks source link

RPI4 - Bullseye 64bit Issue or Container Issue (ver: Master) #75

Open NickJLange opened 1 year ago

NickJLange commented 1 year ago

The problem

So having done a fresh clone/build with buildah using the Dockerfile on bullseye 64-bit (light) - I get the below error. After a bit of googling, there seems to be some major breakage in raspian between buster and bullseye releases which might be the issue? At any rate, I wanted to raise the issue in case someone else stumbles across it - if I get some time I might dig deeper.

What commit exhibits the issue?

master

Was there a last known working commit?

nope

What type of installation are you running?

Docker

With which python3 version do you run Receiver?

Docker version

OS the receiver runs on

bullseye

OS the sender runs

OSX

Which sender client was used

Photos

Command invocation

same as README.md

Please include --debug output which helps to illustrate the problem

[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[Receiver]: Name: ap2
[Receiver]: Enabled features: 0001c300405f4200
[Receiver]: FeatureFlags.Ft48TransientPairing|Ft47PeerManagement|Ft46HomeKitPairing|Ft41_PTPClock|Ft40BufferedAudio|Ft30UnifiedAdvertisingInfo|Ft22AudioUnencrypted|Ft20ReceiveAudioAAC_LC|Ft19ReceiveAudioALAC|Ft18ReceiveAudioPCM|Ft17AudioMetaTxtDAAP|Ft16AudioMetaProgress|Ft14MFiSoft_FairPlay|Ft09AirPlayAudio
amixer: Mixer attach default error: No such file or directory
Traceback (most recent call last):
  File "ap2-receiver.py", line 1426, in <module>
    setup_global_structs(args, isDebug=DEBUG)
  File "ap2-receiver.py", line 202, in setup_global_structs
    volume = get_volume()
  File "/airplay2/ap2/utils.py", line 224, in get_volume
    line_pct = subprocess.check_output(["amixer", "get", "PCM"]).splitlines()[-1]
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['amixer', 'get', 'PCM']' returned non-zero exit status 1.

Additional information

No response

Neustradamus commented 1 year ago

@systemcrash, @LewdNeko: What do you think?

Crazsped commented 1 year ago

Also getting this error, but on Raspbian

TheSpookyCat commented 1 year ago

@Neustradamus I only have a Windows machine right now & am not experiencing issues. I won't be much help here 😅

teh-hippo commented 1 year ago

I also have this issue

teh-hippo commented 1 year ago

I've worked out the issue. It's caused by the device name in amixer. The below modification worked for me.

diff --git a/ap2/utils.py b/ap2/utils.py
index 7bfcf12..bf4dee5 100644
--- a/ap2/utils.py
+++ b/ap2/utils.py
@@ -221,7 +221,7 @@ def get_volume():
                 pct = 0
         vol = interpolate(pct, 0, 100, -30, 0)
     elif subsys == "Linux":
-        line_pct = subprocess.check_output(["amixer", "get", "PCM"]).splitlines()[-1]
+        line_pct = subprocess.check_output(["amixer", "get", "Headphone"]).splitlines()[-1]
         m = re.search(b"\[([0-9]+)%\]", line_pct)
         if m:
             pct = int(m.group(1))
@@ -255,7 +255,7 @@ def set_volume(vol):
     elif subsys == "Linux":
         pct = int(interpolate(vol, -30, 0, 45, 100))

-        subprocess.run(["amixer", "set", "PCM", f"{pct}%%"])
+        subprocess.run(["amixer", "set", "Headphone", f"{pct}%%"])
     elif subsys == "Windows":
         volume_session = get_pycaw_volume_session()
         if volume_session:
systemcrash commented 1 year ago

is "headphone" a local modification for you, or one that applies globally for everyone on Linux?

teh-hippo commented 1 year ago

I don't believe so. It's probably not globally for Linux. I was running on Rasbian, on a Pi 4. I am away from the device at the moment but I believe it was my only output option.

On Wed, 7 Sept 2022 at 23:19, Paul Dee @.***> wrote:

is "headphone" a local modification for you, or one that applies globally for everyone on Linux?

— Reply to this email directly, view it on GitHub https://github.com/openairplay/airplay2-receiver/issues/75#issuecomment-1239380695, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXWRP4XXP5C62OAED3MB3V5CI7HANCNFSM55A52SQA . You are receiving this because you commented.Message ID: @.***>