Skip to content
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

tts vol command does not work when using headphone jack (audio device 0) #35

Open
SkyeOfBreeze opened this issue Nov 1, 2020 · 3 comments

Comments

@SkyeOfBreeze
Copy link

Describe the bug
When controlling the audio via the headphone jack. Audio volume control does not appear to work. Running .tts vol 50 does not do anything. However, entering amixer cset numid=1 80% or 50% in the terminal will change the volume

To Reproduce
Steps to reproduce the behavior:

  1. Set the speaker_num in the controller.conf to 0,0.
  2. Plug in speakers to the headphone jack
  3. Run the .tts vol 50, then .tts vol 80. Notice no change

Expected behavior
Volume level is adjustable

Screenshots
n/a

Logs
n/a

Configurations

  • Raspberry Pi 3a+
# ALSA HW number for your playback device
# For Tellys this is 2.
# If you have trouble with the playback device changing hardware numbers,
# use the audio device name. Otherwise, leave it blank.
speaker_num=0,0
speaker_device=

Not quite sure how we should implement this in the code, as the alsa HW number is 0, but the command id is 1 for amixer cset numid=1 80%. Not sure how USB speakers handle this, or what they appear as.

@Nocturnal42
Copy link
Collaborator

Yeah, one command fits all volume control has proven to be a constant issue.

ALSA device number, subdevice number and card control number are all different things. Your amixer command is running against the default ALSA device, which is probably 0.

Out of curiosity, what does the output of amixer content show?

@SkyeOfBreeze
Copy link
Author

amixer gives

Simple mixer control 'Headphone',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback -663 [90%] [-6.63dB] [on]

amixer content gives

amixer: Unknown command 'content'...

amixer contents gives

numid=2,iface=MIXER,name='Headphone Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=-663
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

@Nocturnal42
Copy link
Collaborator

Try running this amixer -c 0 set PCM 50% Headphone 50% which should set your tts to 50% without breaking the existing supported hardware command... in theory.... since amixer seems to ignore channels it can't find.

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

No branches or pull requests

2 participants