LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-28-2016, 12:37 PM   #1
Tasslehoff
LQ Newbie
 
Registered: Jun 2016
Posts: 4

Rep: Reputation: Disabled
No audio from console


Hi guys, I have a problem with audio output on a Dell Optiplex workstation which has an Intel soundcard "Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)".

I'm using Fedora 24 Mate and if I try to listen some audio files or streming content (for example Youtube) all seems to work perfectly.
The problem is that I need to play audio files (a simple wav or mp3 file) on console because I need to use this workstation as audio alert for other services (Nagios).

I tried aplay, sox (play) and mplayer, but none of them seems to work, the problem seems related to /dev/dsp missing device or some permission problem.

First things first, the devices seems ok (they works on gui, for example with xmms):
Code:
[root@drakaris ~]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD1983 Analog [AD1983 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[root@drakaris ~]# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=Intel
    HDA Intel, AD1983 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    Front speakers
surround21:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, AD1983 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
When I try to use aplay, play (sox) or mplayer this is the result:
Code:
[root@drakaris ~]# mplayer test.wav
MPlayer 1.3.0-6.1.1 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing test.wav.
libavformat version 57.25.100 (external)
Audio only file format detected.
Load subtitles in ./
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
[AO_ALSA] alsa-lib: pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

[AO_ALSA] Playback open error: Connection refused
Failed to initialize audio driver 'alsa'
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
[AO_ALSA] alsa-lib: pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

[AO_ALSA] Playback open error: Connection refused
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
AO: [pulse] Init failed: Connection refused
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16le
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
[AO_ALSA] alsa-lib: pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

[AO SDL] Unable to open audio: No available audio device
DVB card number must be between 1 and 4
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   2.0 (01.9) of 2.0 (02.0)  0.3%
Audio output truncated at end.
A:   2.0 (01.9) of 2.0 (02.0)  0.3%


Exiting... (End of file)
[root@drakaris ~]#
[root@drakaris ~]# aplay test.wav
X11 connection rejected because of wrong authentication.
xcb_connection_has_error() ha restituito VERO
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connessione rifiutata

aplay: main:786: audio open error: Connection refused
[root@drakaris ~]#
[root@drakaris ~]# play test.wav
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Floating point exception (core dump creato)
I already tried to use a different user inside the audio group and also to add the root user to audio group but nothing changed, I tried almost everything but I have no experience with linux audio stuff, is there someone who can give me some hints?

Thanks

Tasslehoff Burrfoot
 
Old 06-28-2016, 12:57 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Tasslehoff View Post
Hi guys, I have a problem with audio output on a Dell Optiplex workstation which has an Intel soundcard "Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)". I'm using Fedora 24 Mate and if I try to listen some audio files or streming content (for example Youtube) all seems to work perfectly. The problem is that I need to play audio files (a simple wav or mp3 file) on console because I need to use this workstation as audio alert for other services (Nagios). I tried aplay, sox (play) and mplayer, but none of them seems to work, the problem seems related to /dev/dsp missing device or some permission problem.

When I try to use aplay, play (sox) or mplayer this is the result:
Code:
[root@drakaris ~]# mplayer test.wav
I already tried to use a different user inside the audio group and also to add the root user to audio group but nothing changed, I tried almost everything but I have no experience with linux audio stuff, is there someone who can give me some hints?
Biggest 'hint' would be to NEVER, EVER log in through the GUI as root, and stop running as root. The root account should only really be used for troubleshooting and/or repairing things, and doing maintenance. There is ABSOLUTELY NO REASON to log in as root on a daily basis.

Since you've established that your audio hardware is working, you've ruled out 90%+ of your potential problems. Typically, you need codecs installed for various media types...did you install them? This is for F23, but should work for F24:
https://ask.fedoraproject.org/en/que...sten-to-music/

But you really, REALLY need to just create a 'standard' user, and don't log in to the console as root.
 
Old 06-28-2016, 01:02 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Quote:
X11 connection rejected because of wrong authentication.
You are running everything as root. Do your player work when run as user?
Stop running apps as root.
 
Old 06-29-2016, 05:32 AM   #4
Tasslehoff
LQ Newbie
 
Registered: Jun 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for reply guys, I know logging with root It's not right thing to do, you are absolutely right.
In this scenario I used it to speed up the problem solving avoiding any possible permission problem, but it seems that this was part of the problem itself.

I tried to create a new user with initial group audio (useradd -g audio user) and now it seems to work, with play, aplay and mplayer, It also works adding the user to audio group as secondary group (usemod -G audio user).
The strange thing is that with root it doesn't work at all by console, it works perfectly if I use the GUI (for example xmms also exporting display on another workstation), that's strange.

And you know another strange thing? I alredy tried to play that file with a regular user (inside the audio group)

Code:
[drako@drakaris ~]$ grep audio /etc/group
audio:x:63:root,drako
[drako@drakaris ~]$
[drako@drakaris ~]$
[drako@drakaris ~]$ mplayer /tmp/test.wav
MPlayer 1.3.0-6.1.1 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /tmp/test.wav.
libavformat version 57.25.100 (external)
Audio only file format detected.
Load subtitles in /tmp/
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   1.8 (01.7) of 2.0 (02.0)  0.0%


Exiting... (End of file)
[drako@drakaris ~]$
[drako@drakaris ~]$
[drako@drakaris ~]$ aplay /tmp/test.wav
Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
[drako@drakaris ~]$
[drako@drakaris ~]$
[drako@drakaris ~]$ play /tmp/test.wav

/tmp/test.wav:

 File Size: 355k      Bit Rate: 1.41M
  Encoding: Signed PCM
  Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
  Duration: 00:00:02.01

In:100%  00:00:02.01 [00:00:00.00] Out:88.7k [      |      ] Hd:0.4 Clip:0
Done.
[drako@drakaris ~]$
[drako@drakaris ~]$
[drako@drakaris ~]$ logout
[root@drakaris ~]# su - drako -c "aplay /tmp/test.wav"
Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
[root@drakaris ~]#
[root@drakaris ~]# aplay /tmp/test.wav
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connessione rifiutata

aplay: main:786: audio open error: Connection refused
 
Old 06-29-2016, 09:25 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Tasslehoff View Post
Thanks for reply guys, I know logging with root It's not right thing to do, you are absolutely right.
In this scenario I used it to speed up the problem solving avoiding any possible permission problem, but it seems that this was part of the problem itself.

I tried to create a new user with initial group audio (useradd -g audio user) and now it seems to work, with play, aplay and mplayer, It also works adding the user to audio group as secondary group (usemod -G audio user).
The strange thing is that with root it doesn't work at all by console, it works perfectly if I use the GUI (for example xmms also exporting display on another workstation), that's strange.

And you know another strange thing? I alredy tried to play that file with a regular user (inside the audio group)
It *LOOKS* like it's playing....obvious question: you've checked the mixer levels, to see if things are turned up/un-muted, right? Try running "alsamixer", then press F5 to see ALL your channels. See if the levels are very low and/or muted (look for the "MM" at the bottom of the bar). If so, arrow-over to the channel in question, and press M.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Console audio editor dobienick Linux - Software 1 08-10-2010 02:58 PM
mounting an audio CD from console? Hosiah Red Hat 2 01-18-2005 05:59 PM
Linux console Audio Recording schuelerj Mandriva 0 07-14-2004 11:11 AM
Console audio cd player? ivanatora Linux - Software 1 07-06-2004 10:42 AM
xmms no audio in console jang Linux - Software 2 12-19-2002 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration