Bug 13927

Summary: doesn't accept alsa device specification as per the manpage
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: mpg321Assignee: Anton Farygin <rider>
Status: CLOSED NOTABUG QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: rider
Version: unstable   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2008-01-07 20:21:34 MSK
mpg321-0.2.10.2-alt1.1
libao-0.8.8-alt1.13239

man mpg321 says:

       -a device, --audiodevice device
...
                 For -o alsa, specify card:device; defaults to 0:0.

Steps to Reproduce:
$ mpg321 -o alsa -a 0:0 04-vse-napominaet-o-tebe.mp3 
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
Version 0.59q (2002/03/23). Written and copyrights by Joe Drew.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Title  : бЯ╦ МЮОНЛХМЮЕР Н РЕАЕ           Artist: гЮУЮП лЮИ                     
Album  : Live in San Francisco           Year  : 2005
Comment: Recorded live at "Last Day Sal  Genre : BluesBlues                    

Playing MPEG stream from 04-vse-napominaet-o-tebe.mp3 ...
MPEG 1.0 layer III, 160 kbit/s, 44100 Hz stereo
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM 0
ALSA snd_pcm_open error: No such file or directory
Can't open libao driver with device 0 (is device in use?)
$ 

Although it works with no -a option:

$ mpg321 -o alsa 04-vse-napominaet-o-tebe.mp3 
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
Version 0.59q (2002/03/23). Written and copyrights by Joe Drew.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Title  : бЯ╦ МЮОНЛХМЮЕР Н РЕАЕ           Artist: гЮУЮП лЮИ                     
Album  : Live in San Francisco           Year  : 2005
Comment: Recorded live at "Last Day Sal  Genre : BluesBlues                    

Playing MPEG stream from 04-vse-napominaet-o-tebe.mp3 ...
MPEG 1.0 layer III, 160 kbit/s, 44100 Hz stereo

[0:03] Decoding of 04-vse-napominaet-o-tebe.mp3 finished.
$
Comment 1 Anton Farygin 2021-10-27 09:57:15 MSK
Это не ошибка - mpg321 отлично понимает спецификацию alsa из aplay -L.

например:
 mpg123 -o alsa -a front:CARD=Audio,DEV=0
Comment 2 Anton Farygin 2021-10-27 09:58:25 MSK
$ mpg123 --list-devices
Devices for output module alsa:
null    Discard all samples (playback) or generate zero samples (capture)
pulse   PulseAudio Sound Server
pipewire        PipeWire Sound Server
default Playback/recording through the PulseAudio sound server
sysdefault:CARD=sofhdadsp       sof-hda-dsp,  Default Audio Device
sysdefault:CARD=Audio   ThinkPad USB-C Dock Audio, USB Audio Default Audio Device
front:CARD=Audio,DEV=0  ThinkPad USB-C Dock Audio, USB Audio Front output / input
surround21:CARD=Audio,DEV=0     ThinkPad USB-C Dock Audio, USB Audio 2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audio,DEV=0     ThinkPad USB-C Dock Audio, USB Audio 4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0     ThinkPad USB-C Dock Audio, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0     ThinkPad USB-C Dock Audio, USB Audio 5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0     ThinkPad USB-C Dock Audio, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0     ThinkPad USB-C Dock Audio, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0 ThinkPad USB-C Dock Audio, USB Audio IEC958 (S/PDIF) Digital Audio Output