Start a new topic

Pi Top Speaker without X

 Hi there,


I have a Pi-Top with a Pi-Top Speaker add-on, and I'm unable to make it sound.

I understand it uses i2c to output HDMI audio. In fact, my system has the needed modules loaded:


pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
evdev                  12423  0
snd_bcm2835            24427  0
snd_pcm                98501  1 snd_bcm2835
snd_timer              23904  1 snd_pcm
snd                    70032  3 snd_timer,snd_bcm2835,snd_pcm
i2c_bcm2835             7167  0
fixed                   3285  0
i2c_dev                 6913  0


I can see the device on i2c bus also:


pi@raspberrypi:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- 0b -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- 73 -- -- -- --                        


However, "omxplayer -o hdmi <video_file>" does not produce any audio.

There's a final step I must me missing, that's not present on the github info.

I DON'T have an X enviroment or it's dependencies and never will, so please help me configure it on TTY console.

Alsamixer audio meter is at 100% too.


Thanks


Hi Peter,


did you get this to work in the end? If, as Alan suggests, you download and install their Python library (pi-topSPEAKER) from GitHub, and then follow the "Manual Initialisation" page's instructions on the associated wiki, that will almost get you there. Two additional points though:


1) the wiki instructions are not quite correct; they say to use:

from ptspeaker import configuration as ptspeakercfg

if ptspeakercfg.enable():
    print("Successfully enabled pi-topSPEAKER")
else:
    print("Failed to enable pi-topSPEAKER")

but that call to enable() requires a parameter. From your i2cdetect trace, you have a single speaker set to mono mode, so use:

from ptspeaker import configuration as ptspeakercfg

if ptspeakercfg.enable("m"):
    print("Successfully enabled pi-topSPEAKER")
else:
    print("Failed to enable pi-topSPEAKER")

 to set it up.


Then, you need to make sure audio is routed via HDMI. The call ptspeakercfg.set_audio_output_hdmi() should do this, but if that returns an error (as it does on my system when running baseline Raspbian), you can just call (from a shell):

/usr/bin/amixer -c 0 cset numid=3 2

to do this.


Once the above two things are done speaker output should work until you power cycle.


hth, sakaki

Hi,


For more information please feel free to visit our official pi-top GitHub repository: https://github.com/pi-top


Thank you.


All the best,


Alan 

Rene: I don't have the pt-speaker command. The package containing it depends on X libraries that my system does not have and won't have.
So, what does that command do and how can I do it manually instead?
I just need the speaker to work without any X dependencies.

 

Try the command pt-speaker before using the speaker. The scripts set this up to run automatically when xwindows is started.
Login or Signup to post a comment