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

Add detune and Stereo balance #51

Merged
merged 2 commits into from
Mar 20, 2022
Merged

Add detune and Stereo balance #51

merged 2 commits into from
Mar 20, 2022

Conversation

rsta2
Copy link
Contributor

@rsta2 rsta2 commented Mar 20, 2022

This adds Detune and Stereo balance (pan) items to the UI menu.

@probonopd
Copy link
Owner

@rsta2 this is so cool!

Can it be that left and right are reversed in the GUI?

@rsta2
Copy link
Contributor Author

rsta2 commented Mar 20, 2022

@probonopd Thanks! Normally not. But swapping the left and right channels did occur earlier, especially with PWM in Circle. With which RPi model and which sound device have you noticed this?

@probonopd
Copy link
Owner

RPi 2, HDMI. If useful I can test other combinations tomorrow.

@probonopd probonopd merged commit 8f8552f into probonopd:main Mar 20, 2022
@rsta2
Copy link
Contributor Author

rsta2 commented Mar 20, 2022

I tested RPi 3B with PWM and HDMI and the left/right seems to be OK there. I will test RPi 2 with HDMI tomorrow here.

@rsta2 rsta2 deleted the detune-stereo branch March 20, 2022 20:35
@probonopd
Copy link
Owner

probonopd commented Mar 20, 2022

I am going from the RPi 2 to a HDMI display then via its headphone jack to my headphones. Cannot exclude the possibility that the display is mixing it up. Will do systematic tests tomorrow. For now I am just enjoying this beautiful sound coming from multiple detuned and stereo-shifted tone generators 👍

@rsta2
Copy link
Contributor Author

rsta2 commented Mar 20, 2022

OK. Yes, it's fun! ;)

@rsta2
Copy link
Contributor Author

rsta2 commented Mar 21, 2022

I tested the Stereo balance on two TV sets, and you are right, my own TV set swaps the channels with HDMI. Because I used this TV set as a reference, now the Circle HDMI driver swaps the channels and all existing Stereo application probably have the wrong channel assignment. :( Maybe some developers have recognized this already and swapped the channels back in their software.

I think we need an option in minidexed.ini, which allows to assign the channels, as it is wanted. Perhaps there are other TV sets out there, which need this.

BTW. I think this problem exists only with HDMI. PWM and I2S should be OK.

@rsta2
Copy link
Contributor Author

rsta2 commented Mar 21, 2022

PR #52 fixes the problem.

@probonopd
Copy link
Owner

Confirmed. Thanks @rsta2.

One strange observation:

PWM is relatively noisy and in one of the Stereo positions it is even more grave than in all others. I wonder why this is. To reproduce:

  • Use a Rpi 2 with PWM (did not test this on other models so far) and ("good") headphones
  • Restart RPi for default settings
  • Bring the volume down to a useful level
  • Play one high-pitched note very lightly and keep it pressed. Notice that it is relatively noisy while the note is playing
  • While the note is still playing, via the GUI, change the stereo shifting and pay attention to the amount of noise. In the setting where the 9th dot from the left = 8th from the right is selected, the noise appears to be much more than in any other Stereo setting - can this be explained?

@rsta2
Copy link
Contributor Author

rsta2 commented Mar 21, 2022

I would guess, that this is caused by rounding errors. There are only 16 bits resolution of the audio samples and for PWM it has to be round down to 11 bits.

I cannot hear this noise. Maybe because I'm on the RPi 3B, because my headphones are not good enough, or my ears. ;) There is one thing, I can imagine. Maybe the TG mixer has to be protected by a spin lock, because when changing the Stereo balance, this may happen while the mixer is running and may influence the resulting signal.

@probonopd
Copy link
Owner

Thanks, will do more testing on other devices as well.

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