WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Sound?  (Read 10043 times)

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Sound?
« on: February 11, 2015, 07:16:09 PM »
I'm having a lot of no luck getting sound working on a B+. I get a seq and timer, but no pcm. I do get dmesg errors when loading pcm512x: failed to reset device: -5 and probe 1-004d failed with error -5. Is this supposed to work?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Sound?
« Reply #1 on: February 12, 2015, 01:00:27 AM »
I'm having a lot of no luck getting sound working on a B+. I get a seq and timer, but no pcm. I do get dmesg errors when loading pcm512x: failed to reset device: -5 and probe 1-004d failed with error -5. Is this supposed to work?

What is you sound device (hardware)?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Sound?
« Reply #2 on: February 12, 2015, 06:09:03 AM »
Hi

I have no problems getting sound out of the new 3.18.6 piCore on a RPi B+
(analog, USB-DAC and I2S Audio-DACs are all working fine).

Regards
Steen

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Sound?
« Reply #3 on: February 12, 2015, 06:19:50 AM »
It's a Pi B+. Is there more than one hardware version? I can't seem to find an 'lspci' or equivalent command for this hardware. I'm attaching a listing of /sys if that helps. Could I need to load firmware? This happens on both the 6.0 release and 6.1 alpha 2.

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: Sound?
« Reply #4 on: February 12, 2015, 06:27:17 AM »
Hi: Sound on RASPI is complex and even more tricky on piCore. What are you trying to do?
1)Play sound from what application (extension) or from command line?
2) What sound files you are trying to play? (wav,mp3,ogg etc.)
3) Did you install all necessary sound software (alsa...etc)
4. Do you try to play from file or do you try to stream? - using which sound software?
4. Which sound output are you using? HDMI or analog jack?
5. Are you using an external sound card on USB?
6. Which piCore version are you using?

Before someone can help we need answers to he questions above
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Sound?
« Reply #5 on: February 12, 2015, 06:37:31 AM »
As far as I know I installed all the software, which so far is alsa and mpg123 and their dependencies. I just want to play a short .wav or .mpg from the onboard analog jack using mpg123 from an application I'm working on.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Sound?
« Reply #6 on: February 12, 2015, 06:51:53 AM »
I can't seem to find an 'lspci' or equivalent command for this hardware.

Because there are no PCI bus.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: Sound?
« Reply #7 on: February 12, 2015, 06:52:55 AM »
HI:
I am sure that  these two links may give you some more insights although they are  focusing  on raspian.
http://www.raspberrypi-spy.co.uk/2012/06/raspberry-pi-speakers-analog-sound-test/
http://www.raspberrypi-spy.co.uk/2013/06/raspberry-pi-command-line-audio/
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Sound?
« Reply #8 on: February 12, 2015, 06:37:03 PM »
I got it working. This seems unnecessarily complicated to have to figure out when there were only three things to do all along. The module won't be loaded just because the alsa-modules is loaded, and alsa won't work unless alsa-config is also loaded because it has the config files alsa needs to initialize (so why isn't it a dependency of alsa?). So:

To /mnt/mmcblk0p2/tce/onboot.lst add:
alsa-modules-KERNEL.tcz

In /opt/bootlocal.sh add:
/sbin/modprobe snd_bcm2835
sudo -u tc /usr/bin/tce-load -i alsa-config.tcz

A few other things. The alsa tce.installed script does a few things like create directories, but I don't see any files in there. Alsactl store wants to save asound.state in /var/lib/alsa, but while that directory is created by the alsa script the tc user doesn't have write permissions on it so it can't save the state out of the box. Seems like the permissions should be set especially since the script syntax is written such that it seems that additional commands are expected. But in the alsa script it's looking for asound.state in /usr/local/etc, so what's up with that? Where should it be saved, and what should be added to /opt/.filetool.lst?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1240
Re: Sound?
« Reply #9 on: February 12, 2015, 09:21:18 PM »
We dont load the bcm sound module by default, as it is not needed if you are using a usb or spi sound card.   So the module extension is not a dependency by design.  And loading the module in boot local is the right option

As for alsa config, I agree, that should be an automatic dependency.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Sound?
« Reply #10 on: February 12, 2015, 11:25:11 PM »
In 6.1a2, loading alsa-modules doesn't modprobe any modules. In 6.0, it loads a bunch that aren't needed, at least not by me:

snd_soc_wm8804
snd_soc_tas5713
snd_soc_pcm512x
snd_soc_bcm2708_i2s
snd_soc_core
snd_pcm_dmaengine
snd_compress
spi_bcm2708
i2c_bcm2708
regmap_i2c
regmap_spi
regmap_mmio

So, as you point out, 6.0 loads modules for USB and SPI sound, but not onboard sound. Isn't that a little backwards?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Sound?
« Reply #11 on: February 13, 2015, 03:41:31 AM »
piCore itself doesn't modprobe any alsa modules to give freedom for endusers. In the past the built-in audio was modprobed but is caused conflict for specific audio boards.

Non DT (Device Tree) kernels, aka all before 3.18.y load certain kernel modules as you see. DT kernel behaves differently.

Please consider, piCore (as Tiny Core) is a toolkit and not a turnkey shoot and forget type system. It requires a bit more customization and configuration at the beginning.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: Sound?
« Reply #12 on: February 13, 2015, 05:48:57 AM »
Hi
I have no problems getting sound out of the new 3.18.6 piCore on a RPi B+
(analog, USB-DAC and I2S Audio-DACs are all working fine).
Regards
Steen
So,  I assume you were able to get the sound working. Please post a short step by step "how to here". That would help me a lot.
Thank you so much in advance.
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Sound?
« Reply #13 on: February 13, 2015, 07:10:51 AM »
Bela, I didn't know about the new DT in the latest kernel. Is there a tool that we can use to enumerate like dmidecode or lspci on an x86 box? I'm fine with not loading anything, as at least then I know I need something. in 6.0 modules were loaded and I mistakenly believed that they were the right ones which is why I had so much trouble to begin with. I'm fine with the customization part. I thought it was the custom kernel that I made to get my USB display working that was keeping me from getting sound working which is why I tried the "stock" 6.1. So now I have sound and a USB display on my 6.0 system.

Beerstein, my fix is a few posts back. It works for both 6.0 and 6.1. You can leave all the extra modules loaded in 6.0 in if you want. They don't interfere with the onboard sound.

Andy

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Sound?
« Reply #14 on: February 13, 2015, 07:33:16 AM »
Hi
I have no problems getting sound out of the new 3.18.6 piCore on a RPi B+
(analog, USB-DAC and I2S Audio-DACs are all working fine).
Regards
Steen
So,  I assume you were able to get the sound working. Please post a short step by step "how to here". That would help me a lot.
Thank you so much in advance.

Hi beerstein

It depends on what hardware you need to use for sound. Analog, USB or I2S-audio DACs.

For analog just follow the advice provided by andyj - and modprobe the analog card: /sbin/modprobe snd_bcm2835

USB DACs seems to be working without any intervention and should work just as before DT.

I2S-Audio DACs needs special modules to be loaded, and that you define in the config.txt file
See here: http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=99401&sid=fac07f1b9df69c87e04a026599079d20

If you only need a specific I2S-DAC then you simply add something like:
Code: [Select]
dtoverlay=hifiberry-dac    to the config file in order to enable the hifiberry DAC. Bela already included all known DT overlay files so you just have to choose the right one for your card (have a look in the directory "overlay" on the boot partition.

Steen