Audio not detected
#1
Hey there,

So I installed longsleep's Debian Base (3.10.102 BSP 2) image, and try to install Mopidy on it (music server). But the fact is that I can't get the audio working. I have my headphones plugged in and I can't get any sound.

I looked around a bit and found this post. I followed the instructions, but couldn't manage to get any sound. Plus it seems like the audio channel isn't even detected: 

Code:
root@pine64:/home/mopidy/media# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
root@pine64:/home/mopidy/media# pactl list cards
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
root@pine64:/home/mopidy/media#

Is there a way to get the audio working with this image or should I switch to the 3.10.65 BSP one?
  Reply
#2
Headjack audio out works with the latest Debian/Ubuntu images and the 102-2 kernel, did you follow all of those:

sudo apt-get install alsa-base alsa-utils
sudo apt-get install pulseaudio

sudo su

cat <<EOF >/etc/modules-load.d/pine64-audiojack.conf
sunxi_codec
sunxi_i2s
sunxi_sndcodec
EOF

exit

wget https://raw.githubusercontent.com/longsl...ound.state

sudo mv asound.state /var/lib/alsa/asound.state

sudo usermod -a -G audio username

sudo reboot now
Come have a chat in the Pine IRC channel >>
  Reply
#3
I didn't followed from the wget.

Just did the whole procedure then rebooted. 

Now I have another soundcard in alsamixer, which has many channels. When I go to the very right, and edit the volume of the track just before the last one (so the "headphon" track) I hear some clicking in my headphone's left side. But nothing else, and playing something with mplayer still doesn't get me any sound.

Also I'm now able to see the card in aplay -l (but pactl list cards still fails):

Code:
root@pine64:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: audiocodec [audiocodec], device 0: SUNXI-CODEC codec-aif1-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: audiocodec [audiocodec], device 1: bb Voice codec-aif2-1 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: audiocodec [audiocodec], device 2: bb-bt-clk codec-aif2-2 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: audiocodec [audiocodec], device 3: bt Voice codec-aif3-3 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
root@pine64:~# pactl list cards
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
root@pine64:~#

Tried to play some stuff with Mopidy, still got the same error (that I forgot to paste earlier):

Code:
WARNING  GStreamer warning: gst-resource-error-quark: Could not open audio device for playback. (6)
WARNING  GStreamer warning: gst-stream-error-quark: No volume control found (3)
  Reply
#4
The asound.state file from longsleep's git has sane default mixer settings, combined with pulseaudio in Mate Desktop, sound just works for me so far, using the Pine to play BBC world service radio stream atm :-)

If you use mplayer or any other player, make sure it is pointing to the correct ALSA output card and device... card 1: audiocodec [audiocodec], device 0: SUNXI-CODEC codec-aif1-0 [] is the correct one, the other ones on card 1 are either for the cellphone baseband modem (which we dont have :-) ) or for the bluetooth audio PCM channels ...
Come have a chat in the Pine IRC channel >>
  Reply
#5
Still doesn't do the job here :/

I managed to chaneg the soundcard mplayer is pointing to with the ALSA_CARD environment variable, but all I hear is a click on both side of my headphones when I play a track, and a click on the left side when I stop. Not sure how to specify the Alsa device (SUNXI-CODEC) though.

I also got this error which I think might be related.
Code:
[AO_ALSA] Unable to find simple control 'Master',0.

I don't see a Master control in alsamixer, so I think that's where the error comes from. However, I don't know how to tell mplay which control I want to use (and I'm not even sure that would resolve the issue).
  Reply
#6
(07-23-2016, 11:43 AM)babolivier Wrote: Still doesn't do the job here :/

I managed to chaneg the soundcard mplayer is pointing to with the ALSA_CARD environment variable, but all I hear is a click on both side of my headphones when I play a track, and a click on the left side when I stop. Not sure how to specify the Alsa device (SUNXI-CODEC) though.

I also got this error which I think might be related.
Code:
[AO_ALSA] Unable to find simple control 'Master',0.

I don't see a Master control in alsamixer, so I think that's where the error comes from. However, I don't know how to tell mplay which control I want to use (and I'm not even sure that would resolve the issue).

EDIT: After some more fiddling, as I liked the look of the Mopidy server so tried it out myself, I came to realise the issue wasn't with sound as that was working just fine with mplayer, but instead something to do with gsteamer. An hour later, and I came across a reference to no audio from autoaudiosink but working pulseaudio, and someone said to run sudo aptitude install gstreamer1.0-alsa and it works! I have mopidy running on the pine64 playing some local files. So it is doable. I also installed Mopidy from source as I was otherwise stuck with v0.19 as opposed to v2.0.0.

I'm not sure you need to specify which audio device mplayer uses if things are set up properly. I know I certainly don't in my case, as pulseaudio works as is.

If you run mplayer -playlist http://www.radiofeeds.co.uk/bbcradio4fm.pls   what do you get? I'm specifically wondering what the A0 line under AUDIO says - the below snipped is the last few lines of output before the sound comes out, showing that it is outputting to pulse(audio). btw, the playlist file is for what it says it is... BBCs Radio4 Wink


Code:
Detected file format: Audio only
Selected audio codec: MPEG 1.0/2.0/2.5 layers I, II, III [mpg123]
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...


If that line comes up for you, and it seems like mplayer is playing but there is no sound, next thing to check is alsamixer. You said you got some clicks. Do you get clicks if you move the volume for the headphones channel above say around 60? If so, next thing to double check is the user groups. That 'sudo usermod -a -G audio username' line is important - if you're not in the audio group, you won't get sound. Nada. Zilch. and make sure the username is your logged in username - ie my prompt is pfeerick@pine64 - meaning my username is pfeerick (and the hostname is pine64). The default for a lot of images is pine64user. After you set the group, you need to reboot - merely logging in and out didn't work for me, a reboot is needed. 

Interestingly enough, I also get the connection refused message from pulseaudio if I issue the command via sudo (when logged in as a user), but it works fine when run normally as a user (ie without sudo). So perhaps some of your problem with pactl not working is from being logged in as the root user?


Code:
pfeerick@pine64:~$ sudo pactl list cards
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

pfeerick@pine64:~$ pactl list cards
Card #0
        Name: alsa_card.platform-sound.6
        Driver: module-alsa-card.c
        Owner Module: 6
        Properties:
                alsa.card = "1"
                alsa.card_name = "audiocodec"
                alsa.long_card_name = "audiocodec"
                alsa.driver_name = "sunxi_sndcodec"
                device.bus_path = "platform-sound.6"
                sysfs.path = "/devices/soc.0/sound.6/sound/card1"
                device.string = "1"
                device.description = "audiocodec"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card"
        Profiles:
                input:analog-mono: Analog Mono Input (sinks: 0, sources: 1, priority: 1, available: yes)
                input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 60, available: yes)
                output:analog-mono: Analog Mono Output (sinks: 1, sources: 0, priority: 100, available: yes)
                output:analog-mono+input:analog-mono: Analog Mono Duplex (sinks: 1, sources: 1, priority: 101, available: yes)
                output:analog-mono+input:analog-stereo: Analog Mono Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
                output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
                output:analog-stereo+input:analog-mono: Analog Stereo Output + Analog Mono Input (sinks: 1, sources: 1, priority: 6001, available: yes)
                output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: output:analog-stereo+input:analog-stereo
        Ports:
                analog-input: Analog Input (priority: 10000, latency offset: 0 usec)
                        Part of profile(s): input:analog-mono, input:analog-stereo, output:analog-mono+input:analog-mono, output:analog-mono+input:analog-stereo, output:analog-stereo+input:analog-mono, output:analog-stereo+input:analog-stereo
                analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec)
                        Properties:
                                device.icon_name = "audio-headphones"
                        Part of profile(s): output:analog-mono, output:analog-mono+input:analog-mono, output:analog-mono+input:analog-stereo, output:analog-stereo, output:analog-stereo+input:analog-mono, output:analog-stereo+input:analog-stereo

Card #1
        Name: alsa_card.platform-sound.7
        Driver: module-alsa-card.c
        Owner Module: 7
        Properties:
                alsa.card = "0"
                alsa.card_name = "sndhdmi"
                alsa.long_card_name = "sndhdmi"
                device.bus_path = "platform-sound.7"
                sysfs.path = "/devices/soc.0/sound.7/sound/card0"
                device.string = "0"
                device.description = "sndhdmi"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card"
        Profiles:
                output:analog-mono: Analog Mono Output (sinks: 1, sources: 0, priority: 100, available: yes)
                output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: output:analog-stereo
        Ports:
                analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
                        Part of profile(s): output:analog-mono, output:analog-stereo
  Reply
#7
Thanks pfeerick for figuring that out, I want to use the 32-bit version of Mopidy together with libspotify for armhf to make a Spotify streaming receiver ...
Come have a chat in the Pine IRC channel >>
  Reply
#8
Hey there,

Sorry for the lack of reply.
I just wanted to let you guys know that my setup now works correctly, the problem came from the fact that the jack output doesn't seen supported by the Debian image. Switching to the Ubuntu image literally fixed my problem (on Debian I wasn't even able to play anything through mplayer).
  Reply
#9
My audio jack works just fine in debian.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#10
(07-26-2016, 09:34 AM)xalius Wrote: Thanks pfeerick for figuring that out, I want to use the 32-bit version of Mopidy together with libspotify for armhf to make a Spotify streaming receiver ...

I'm trying to do this right now but struggling to install python-spotify, because apparently it doesn't work in arm64 and I cannot figure out how to coax my Ubuntu install to use the armhf version.

Here's what I've done so far:
  • Install Xenial, all good
  • apt-get install mopidy works out well too
  • apt-get install mopidy-spotify fails because python-spotify fails to install
  • that fails because python-cffi:armhf is not installable
I tried adding armhf as an architecture to dpkg, added mopidy's apt repositories as they instruct, but I still can't get it to work.

Any ideas?

Thanks!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Music Getting analog audio/sound to work (headphones socket) on debian pfeerick 7 27,445 12-30-2016, 07:37 AM
Last Post: Birneklub9
  Bluetooth Adapter not detected anakratis 3 7,489 09-19-2016, 11:38 PM
Last Post: rookieone
  Audio igna09 4 6,368 06-28-2016, 01:28 AM
Last Post: igna09

Forum Jump:


Users browsing this thread: 1 Guest(s)