Harvey71 / emdr

Firmware and controller app for DIY EMDR equipment (lightbar, buzzers and headphones)
MIT License
26 stars 9 forks source link

Audio #9

Closed deestruct closed 1 year ago

deestruct commented 1 year ago

After struggling to get the setup to function from the tutorials, I was finally able to get it working using the final instructions provided by ooktown #3 which closed that issue. I am still awaiting some components to arrive so have not completed the fabricating the buzzers and lightbar hardware devices, but did get the RPi 4 and TFT 3.5" screen working now.

I am not getting audio though from the device on my headset connected to the 3.5mm jack when I test the sound via the GUI. I can confirm that the audio is working in the RPi as when I connect to it via SSH and perform a basic audio test with the code speaker-test -c2 -twav -l7, I can hear the test functioning properly in my headset. Immediately after the audio test is complete, I try the audio again using the GUI on the TFT screen and I cannot hear any sounds.

However, if I connect the RPi to my monitor using an HDMI cable and try testing the audio on the EMDR GUI I can hear the tones properly.

Can you please assist me in resolving this issue? I am stumped why the only element not working in the audio output is the headphone jack via the EMDR GUI audio test.

Harvey71 commented 1 year ago

Hi deestruct, please try to configure default audio output to jack. One way to do so is via command line: sudo amixer cset numid=3 1

deestruct commented 1 year ago

I tried the suggested command via SSH and it did not work either.

deestruct commented 1 year ago

Perhaps I am doing something wrong in testing the audio via headphones. Below are the steps I am performing to test the headphone jack for audible tones; I performed the steps below today after entering the command line you suggested and rebooting the system.

1) Press the EAR icon to enter the sound menu: 20230704_192646

2) Try the vertical bar icon and then press the '?' to test the sound: 20230704_192652

3) Try the circular icon and then press the '?' to test the sound: 20230704_192657

Harvey71 commented 1 year ago

I found something else in rhe PiBakery recipy that may help:

echo "dtparam=audio=on"|cat - /boot/config.txt >/boot/config.tmp&&mv /boot/config.tmp /boot/config.txt

You would have to execute this as root and do a reboot.

deestruct commented 1 year ago

I didn't initially execute that command as when I checked the config file it already had the following lines active: image

I did execute the command though and it added the same line at the top of the config file as shown below: image

After rebooting, it still behaves the same.

deestruct commented 1 year ago

I have solved the problem!!!

After many hours of Google searches, forum surfing, and trial & error attempts, I managed to figure out what the problem was. I've listed a few steps below for others who may experience a similar issue, in how to check and possibly resolve it.

  1. Check to make sure that 'Playback Master Switch' is ON: amixer cget numid=4 where 'numid =' is the 'Playback Master Switch'.

    image

    To check which 'numid' is for 'Playback Master Switch' on your own setup, enter the following command. amixer controls

    You should see something like this:

    image

    in my case it was 4, however most help responses I've seen online use a 'numid' of 3.

  2. Next, check the volume level. amixer sget 'Master' | grep 'Left:' you can check 'Right' as well, although it doesn't really matter as the volume level will be changed by a modification to the Master which affects both channels.

    image

    in my case the volume level was set at 0%. If you need to change the volume level, enter the following command and change the % level to whatever you would like. amixer sset 'Master' 80%

    image

  3. Finally, test with headphones and a sound file as follows. aplay /usr/share/sounds/alsa/Front_Center.wav

    You can continue to adjust the volume as needed in Step 2 and check the effects in Step 3.

    Once the changes are made they will stay after a reboot, so there is no need to keep redoing the procedure each time the device boots up.

    This is what my issue was and I hope that this helps somebody else struggling with a similar problem.