Code Monkey home page Code Monkey logo

Comments (7)

Neustradamus avatar Neustradamus commented on May 29, 2024

@systemcrash, @LewdNeko: What do you think?

from airplay2-receiver.

Crazsped avatar Crazsped commented on May 29, 2024

Also getting this error, but on Raspbian

from airplay2-receiver.

TheSpookyCat avatar TheSpookyCat commented on May 29, 2024

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

from airplay2-receiver.

teh-hippo avatar teh-hippo commented on May 29, 2024

I also have this issue

from airplay2-receiver.

teh-hippo avatar teh-hippo commented on May 29, 2024

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:

from airplay2-receiver.

systemcrash avatar systemcrash commented on May 29, 2024

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

from airplay2-receiver.

teh-hippo avatar teh-hippo commented on May 29, 2024

from airplay2-receiver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.