Hooray! Hoorah! I have sound on the PiM2 (! at last !)

Well, while doing a few dozen hours of backups and other “essential uninterestings” including putting clones of my (now several) Raspberry Pi chips onto a backup disk, I made a clone of Raspbian Jessie (the newer release) onto an 8 GB card. Why? To make sure the backup, restore cycle worked end to end…

Just now, fooling around with it, I still had no sound. I had thought this would be fixed by this release…

So I did what all good folks do prior to taking on a chunk of work… I looked for “prior art”. And found it.

It looked very similar to what had been suggested for Wheezy (prior release that I never could get to have working sound), but I tried it anyway. This time it worked!

Here’s the “magic sauce”.

First off, the test case. I was at Iceagenow.info and they had a video of an airplane on snow. “Cutting a donut”.


Now you just know an airplane with a prop makes some noise…

Then the place with the magic sauce:


This guy had ported his own “Jessie” release prior to the formal one, so clearly “has clue”. Along with a lot of other tech talk, he has this from a comment down below, so clearly his ‘followers’ have clue as well:

 Comment by Anders — Wed Mar 11 22:04:43 2015
to get sound

There are some things still missing in this image.

First you need the alsa-utils:

apt-get install alsa-utils

Configure the output to go to 3,5mm jack:

amixer cset numid=3 1

Than load modprobe:

modprobe snd_bcm2835

If all is done you should have sound on 3,5mm jack.

If you want sound on hdmi outut:

amixer cset numid=3 2

This modprobe and others should be loaded already at boot. Configuration should be possible at ./etc/modprobe.d Maybe one can refer to the already existing settings at Rasbian.

For me, alsa was already installed:

root@Ra2PiM2_8:/home/pi# apt-get install alsa-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
alsa-utils is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

That means I really only needed to load the module and direct the sound where I wanted it.

Oh, and my monitor doesn’t seem to like HDMI sound in, so I need to use the headphone jack (that works to headphones or the monitor).

Testing on a YouTube video (Blondie – Heart of Glass) had good sound. The video did pause a bit (just the video, sound was steady) as often happens on small processors; but is overall OK. IF I really want that all-in theatre mode experience, I’ll use a bigger box… but at least now I don’t have to change machines to to look at some modest res video of some guy at a blackboard…

Unfortunately, after that one song, I’ve had 200% CPU use by IceWeasel (so it’s using 2 cores) and still have not gotten another video to load and start playing. Even a simple one on rocket stoves… (i.e. not a lot of fancy fade and pan and stuff that drives compression nuts and chews CPU…)

Don’t know if there’s some “other issue” or if it is just a bit TOO much to be posting while playing videos… So a comment on that once this posting is up and I can test it “solo” in the browser.

I’m just really glad to have sound that works now. Any sound.

Subscribe to feed

About E.M.Smith

A technical managerial sort interested in things from Stonehenge to computer science. My present "hot buttons' are the mythology of Climate Change and ancient metrology; but things change...
This entry was posted in Tech Bits and tagged , , , . Bookmark the permalink.

3 Responses to Hooray! Hoorah! I have sound on the PiM2 (! at last !)

  1. E.M.Smith says:

    Well, I think the odd behaviour is a browser bug…

    I just finished Lady Gaga, Marry The Night:

    It was fine, and the second in a row I watched / heard. CPU for the browser ran between about 75% and 120% mostly below 90%. CPU for Xorg (the thing that draws the screens) was about 65% to 80%, sometimes 90ish. Video was smooth at small and “theatre” mode sizes, but at full size got jerky. I suspect Xorg is not able to go multi-processor and with size comes more bits and more computes and at 100% (ish) it starts in with the jerky… But I’m fine with ‘theatre’ mode (about 1/3 screen) on a non-prime video watching machine. For the occasional “catch” in the middle of something else.


    You just knew they had to be a big But, didn’t you… ;-)

    Getting here was “interesting”. First off, the last run was using 200% CPU just for the IceWeasel Browser – and not giving me any video or sound. Exiting I.W. CPU use dropped to 100%, but that process kept on running…. I had to explicitly call out a “kill -HUP process-number” to kill it.

    Re-launched the browser “clean”, new video. Same thing. Kill -HUP… Wash and repeat…

    Re-launched and went back to Iceagenow.info… THAT video is from Facebook… Hmmmm….

    During the launch of the page I was clicking around a lot, and got a “Do you want to install pluging needed for media on this page?” question… After the video and ads finished loading, that “nag” went away. Played the video. Fine, with fine sound. Hmmmm…. Back to Youtube, Lady Gaga Edge Of Glory plays fine… Hmmmm….

    My Suspicion:

    I think there is a ‘glitch’ in the browser where it thinks it needs the Flash plugin even though it no longer does ( HTML5 I think) and goes off to “check on it”… this can give an erroneous “nag” banner, or send one CPU into a loop sucking 100% CPU forever and blocking the play of the video since “the plugin hasn’t loaded yet” and never will… BUT, if the Facebook video plays first, it ‘gets over it’ on that whole Flash thing and just does fine after that…

    That’s my debugging thesis anyway.

    For now that airplane video may end up getting a LOT of plays ;-)

    I’m going to do a bit of a search on how to tell Mozilla / Firefox / Iceape / IceWeasel / Name Du Jour -… To just STOP IT already with the shoving Flash Plugin at me. Perhaps just finding out how to kill that monster for good will be enough…

    In any case, it isn’t the fault of the sound system.

    And, with that, time for another “relaunch” and video to see if it is all consistently repeatable or a stochastic mess… and then for some sack time…

    BTW, to “clone” an SD card is dirt simple. Stick the card in an external reader. It will be mounted by the mounting daemon thing. Do a “df” and you will get a listing like:

    /dev/sdc1       10229992   2060232   8169760  21% /media/pi/PNYFAT32
    /dev/sdc3       10768640   2571608   7650012  26% /media/pi/PNYext2

    only the “PNYFAT32” and “PNYEXT2” will be more like C335t23 and some very long line of stuff. They don’t matter though. Just note that they are the right ones… What matters is that /dev/sdc1 or /dev/sdc3 at the front of the line. They tell you that the SD card is on /dev/sdc and with the partitions numbered 1 and 3. You can ignore the partitions as you are taking the whole card. The following command copies the whole card, block by block, into a file:

    dd bs=4M if=/dev/sdc of=/YourArchive/RPM2_backup_Chip_MyDailyDriver

    That’s it.

    Be prepared to wait a while if the chip is over about 8 GB… Note that there is no partition number used, just the whole device. The /path/filename you choose is up to you, but remember the file will be the size of the whole card, not just the data on it. A mostly empty 32 GB card will take 32 GB… To restore it, you just repeat the process (double check you have the drive name right! Don’t want to nuke your running system by accident!!) and swap if for of (input file for output file). They can be in any order in the dd command, so you could just swap the i for o, but I like to always list the input first and output second. Helps me not write things the wrong way…

    dd bs=4M if=/YourArchive/RPM2_backup_Chip_MyDailyDriver of=/dev/sdc

    The block size setting just makes it go faster. You could use 1M and have it work if for some reason 4M used too much memory on your system. (Or even 1k… but way slow). I’ve not tried 8M or 16M but they might work too. Note that it MUST be a capital M…

    So much of today was spent draining a dozen or so chips (some of them 64 GB) and testing that the process worked and the images were OK. I know, not a thrilling thing to do nor post about… but sometimes dull things need doing too…

    Once you have ‘library’ of such images, it’s very easy to “check one out of the library” onto a chip and use it as needed. I’ve got some that are just the “pristine” BerryBoot collection of OS offerings, and some that are fully configured for special purposes (like DNS server or with usr and /bin as squashfs for a bit more secure browsing). Somehow, even with chips being very cheap, I tend to run out ;-)

    Well, hopefully that bit of useful information makes up for the low content of the rest ;-)

  2. LG says:

    “Hooray !” Indeed.

  3. Paul Hanlon says:

    That’s interesting, not just getting the sound working but also the HDMI flag.

    As for the “glitch”, Flash has some security issues and is not even supported on Apple, so some videos still need Flash whereas Youtube et al, have been migrating all their videos to HTML5. You’re getting caught between the two.

    I’ve been pretty busy lately, so not commenting, but I’ve enjoyed the postings, particularly the exchange with Adrian Ashfield.

    That Gaga video is “interesting”. Song is a bit formulaic, but the precursor to it puts a different color to things.

Comments are closed.