Skip to content

set speaker and headphone volume levels during init. #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FoamyGuy
Copy link

I noticed by default that speaker_volume after DAC init is 63.1579 which is outside the range specified by the speaker_volume property.

I don't think this setting is actually taking effect because the sound output from the speaker is still fairly quiet.

However I think it's best to explicitly set both of these to a value we know is safe for the speakers that are stocked in the shop. Both to avoid any potential damage to hardware, and to make it less confusing if anyone happens to check the value of and assumes that the value it returns will be valid for passing back to it to be set.

@FoamyGuy FoamyGuy requested a review from dhalbert August 19, 2025 17:00
Copy link

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is something wrong with the speaker volume getter or setter:

>>> t = adafruit_tlv320.TLV320DAC3100(board.I2C())
>>> t.speaker_volume
63.1579
>>> t.speaker_volume = -15
>>> t.speaker_volume
-15.7895
>>> t.headphone_volume
-63.5
>>> t.headphone_volume = -15
>>> t.headphone_volume
-15.0                     # looks ok
>>> t.speaker_volume = 0
>>> t.speaker_volume
0.0
>>> t.speaker_volume = 63.1579
>>> t.speaker_volume
0.0                         # hunh?
>>> t.speaker_volume = 50
>>> t.speaker_volume
0.0
>>> t.speaker_volume = 20
>>> t.speaker_volume
0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants