Message Boards Message Boards

2
|
33253 Views
|
12 Replies
|
10 Total Likes
View groups...
Share
Share this post:

Does sound work on the Raspberry Pi?

Posted 12 years ago
Simple question: is Mathematica supposed to be able to make sound on the Raspberry Pi?

it doesn't on mine, and I see a bunch of stuff on the web about alsa and oss.  Are we supposed to hack this to get it work?
POSTED BY: p h
12 Replies
There are no technical limitations with the Pi or Mathematica currently barring the Raspberry Pi from playing sound (through its analog audio port or HDMI). The functions Speak[] and EmitSound when applied to SoundNote[] objects (midi) work today. Sound is under very active development in Mathematica in general, so the playback of waveform audio is not currently functioning as documented in the Pi release due to the snapshot nature of our initial release. This should be addressed soon in an update. 

You're not expected to hack it but you certainly can if you wish to (it should be quite possible to override the sound functions in Mathematica and many have). 
POSTED BY: Alex Newman
I was not able to get sound to work from Mathematica on Raspberry Pi.
POSTED BY: Frank Kampas
Frank, did you try things like
Speak["test"]

and
EmitSound[Sound[SoundNote[]]]

- did these lines work? Could you also please let us know what your RPi model is.
POSTED BY: EDITORIAL BOARD
After doing an internet search, I think the reason I'm not hearing any sound from the audio output jack is that I'm using an HDMI monitor that doesn't have speakers in it.  It seems that the sound output only goes to the HDMI output if it is used.
POSTED BY: Frank Kampas
sudo amixer cset numid=3 1
forces the audio to the headphone jack, even with the HDMI video output plugged in.
If I do that, Speak["test"] works but EmitSound and Play do not.
I'm using Model B
POSTED BY: Frank Kampas
Another good thing worth looking at would be the Raspberry Pi config.txt read at boot.  

Specifically, the hdmi_ignore_edid_audio=1 option sems relevant as it should tell ALSA that the only available audio is analog, no matter what the display says. 
POSTED BY: Alex Newman
Posted 12 years ago
sorry, i should have been more specific - i'm trying to use the Play[] function. and other programs (eg. scratch) are able to play sound.
POSTED BY: p h
Sound objects produced by Play do not emit sound in the initial Pi release. This will be fixed in a future update. 
POSTED BY: Alex Newman
Hi,
I got my Raspi Model B yesterday, and installed MMA on it. As mentioned in the earlier discussions on this thread, none of Speak[], EmitSound[] produces sound. I connected an ear phone to the audio jack and set the "hdmi_ignore_edid_audio=1" in /boot/config.txt but that did not help either. Didn't this issue comeup during internal testing? 

Another question: Why is MMA (GUI app) not appearing in the Start menu under Education? Why only "Wolfram"?

-Rangarajan
OK, I continued my search for a solution, and found this page to be helpful:
http://www.raspberrypi-spy.co.uk/2013/06/raspberry-pi-command-line-audio/

I forced the audio port to be the analog jack. Now, Sound[], EmitSound[] and Speak[] work as expected.

Play[] does not work (this has been mentioned here before).

Regards,
Rangarajan
Posted 11 years ago
I would really appreciate it if someone coult explain specifically how to get Mathematica to send out MIDI data through the USB port of a Raspberry Pi.

Thanks
POSTED BY: David Jameson

Hello David! I apologize if this is a little late.

As others have said, the Sound, EmitSound, and Speak functions work on the Pi version of MMA. These functions, along with Import, can be used to edit and play MIDI tracks in MMA. To route the output of these functions or a MIDI file to a USB audio device, you need to edit the configuration files on the Pi to use your USB device rather than the HDMI port or headphone jack. This article gives a pretty good guide to doing exactly this. Note that you'll probably have to power-cycle your Pi after changing any config files and please back up everything you edit before making changes!

-Brett

POSTED BY: Brett Haines
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract