07-26-2016, 05:18 AM
(This post was last modified: 07-26-2016, 07:07 AM by pfeerick.
Edit Reason: Possible resolution
)
(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
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