Kit v4. No sound on headphones? [SOLVED!]

Hi! Think I see the problem! You have the same string to match in both blocks.

If you edit line 6 with this

grep ": bcm2835 ALSA"

This should match with the older headphones device name, and NOT with the 2 HDMI audio devices also listed.

I will set up git on this device soon so I can submit these properly :slight_smile:

root@zynthianv4:~# /usr/bin/aplay -l | grep ": bcm2835 ALSA"
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
2 Likes

Ups! Too many hours working on …
I already fixed it … update again and try :wink:

3 Likes

I’m still using my V3 and was curious about the headphone functionality since the Pi 3 has an output Jack as well. Not sure if you’re not supposed to try that with a V3 but after activation now im stuck in an error loop (Error screen, SSH and Webconf available). Here is the log except:

Aug 08 16:01:29 zynthian startx[409]: File "/home/pi/zynthian-ui/zyngine/zynthian_engine_mixer.py", line 156, in get_controllers_dict
Aug 08 16:01:29 zynthian startx[409]: zctrls["Headphone"] = zctrls_headphones["Headphone"]
Aug 08 16:01:29 zynthian startx[409]: KeyError: 'Headphone'

I was trying to find some sort of config file via SSH to reset that setting but could not find anything. Could not find the setting within Webconf as well.
Not the end of the world if I have to reflash the SD image but I wanted to let you know. In case it breaks for Zynthians older than V4 it might be cool to have that option for those Zynthian revisions disabled if possible (not sure if that’s even the cause of the error).

Updated and it works! Now I can make terrible music on my Zynthian without disturbing anyone in the same room :yum:

Great work!

2 Likes

It should work on v3 too. Please, send the output from:

 aplay -l

I just fixed the code for avoiding the error on v3, but the Headphones volume control has to fixed yet.

Please, update and test.

For fixing the volume control problem, send the output from:

amixer -c 0 scontrols

Thanks!

1 Like

I ran the update and the device is booting up again and I have working headphones as well! Thanks :slight_smile:

Here is the output of the commands you requested:

aplay:

root@zynthian:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 6/7
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_dacplusadc], device 0: HiFiBerry DAC+ADC HiFi multicodec-0 [HiFiBerry DAC+ADC HiFi multicodec-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0 

amixer:

root@zynthian:~# amixer -c 0 scontrols
Simple mixer control 'PCM',0

Except us… :face_with_monocle:

2 Likes

Hi @magge!

Could you update again and confirm if the ALSA mixer show the headphones volume control (and it works!) when enabled?

Thanks!

Not sure if there is something wrong with my setup in general but the only control I have available in the ALSA Mixer is Digital on the upper left. No signs of headphones. In the Wiki there are also ADC controls which I do not seem to have. Not sure if there is anything else I have to configure.

Yay! It works!!!

Thank you @jofemodo and all!

:grinning:

1 Like

Be warned that the rbpi headphones output is lower quality that the hifiberry output (RCA or Jack Phono)
Please, never use headphones output on stage or for recording

Regards

2 Likes

You should be capable of adding more controls from the webconf’s audio config tab.
Anyway, i see you have the Hifiberry DAC+ADC standard, that is more limited than the Pro and doesn’t allow to control the input gain by software.

In the other hand … have you update and still can’t see the headphones volume control when headphones is enabled?

Regards,

Even after updating I do not have a headphone volume control in die ALSA mixer. I looked into the mixer settings within the webconf and there is also no option regarding headphone volume control available.

Same here. Webconf shows:

Webconf doesn’t show the headphones controller and that is OK.
It should appear on UI’s when enabled. That’s all.

Regards,

OK! I found the problem. Please update and test …

Now it should work for Buster RC-2 and later SD-images, all zynthian kits with RBPi3 & RBPi4.

Regards!

2 Likes

I just updated and tested. Works like a charm on a V3 kit. Parameter shows up in the mixer and controls work as well. Nice addition!

1 Like

Yep! Headphones is good now. I would suggest that headphones are enabled by default on the stable build so that users with standard V4 kits will get expected behaviour. I would also suggest the option to disable be pushed down the admin menu. This does not seem like an option that is likely to be toggled often.

Note to users: Enabling headphones does increase CPU usage by a few percent. There may be use cases where this pushes you beyond the limit and causes xruns (clicks on all outputs). You may wish to disable headphones for such cases.

Note to technically minded users. The reason for the increase in CPU is that jack2 (the audio interface layer) binds to one physical audio interface and clocks at that interface’s samplerate. Any other audio interfaces will use their own hardware clocks which may drift hence there needs to be samplerate conversion (even at same samplerate) between jack2 and the extra audio interfaces. (There are ways to lock some (professional) audio interfaces, e.g. word clock but that does not exist for the RPi builtin audio interface used for headphones or most of the audio interfaces used by Zynthian for main output.)

There you go - more than you wanted to know but hopefully useful stuff.

2 Likes

Hi @riban!

I just added the “-q 0” to the “alsa_out” command, as you suggested, and it works OK. I can’t feel the difference and CPU usage was reduced by a 3%. Nice!!

Regarding the “default” for Headphones, i’m not convinced of enabling by default…

  1. The Zynthian’s headphones output is low quality. I’ve implemented the software part because we already had the hardware and it can be convenient, but … it should be avoided when possible. I mean, if you connect your zynthian to a Mixer/Amplfier that already have a Headphones output, then you should connect the Headphones to them and not use the zynthian’s low quality headphone output. In other words, zynthian’s headphones output can be used occasionally, but nobody should be using it as the main output. I hope that having disabled the headphones output by default will force new users to be more conscious of these facts and avoid missuse/abuse of this headphones output.
  2. I don’t like the idea of wasting “by default” a 3% of CPU (1 core) on a feature that should be used occasionally only.

So, i rather prefer to put the “enable/disable Headphones” as the first option on the Admin menu, and keep it disabled by default. Anyway, zynthian will remember the status among reboots, so if you enable the Headphones output, it will remain enabled until you explicitly disable it.

Regards,

3 Likes