2

I had to hard-reboot my Raspberry Pi (unplug the power) running Ubuntu Server 20.04 and since then I cannot run the console music playermocp anymore. The program runs through the initialization of OSS and ALSA drivers, then fails with the message FATAL_ERROR: No valid sound driver!

I have tried purging the package (via apt-get purge mocp) and reinstalling it, but the error message remains. Googling around this question brings up a few very old threads (here and here) on MOC's own discussion boards, suggesting this to be either an ALSA issue or with the sound card, but I'm not sure about this since when I run alsamixer it starts and I can do things like change the volume of it. Plus, if run other programs that use audio like mpg123 the audio is fine.

Detailed error log extracted with mocp -F is shown below, sorry if it's a little verbose. Does anybody know what might be causing this?

Many thanks!

Aug 31 15:34:23.139072: main.c:1191 main(): This is Music On Console (version 2.6-alpha3)
Aug 31 15:34:23.139216: main.c:1195 main(): Configured: '--build=arm-linux-gnueabihf' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/arm-linux-gnueabihf' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' 'build_alias=arm-linux-gnueabihf' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/moc-NiZ4Xl/moc-2.6.0~svn-r2994=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/moc-NiZ4Xl/moc-2.6.0~svn-r2994=. -fstack-protector-strong -Wformat -Werror=format-security'
Aug 31 15:34:23.139240: main.c:1205 main(): Running on: Linux 5.4.0-1015-raspi armv7l
Aug 31 15:34:23.140180: main.c:1157 log_command_line(): mocp -F 
Aug 31 15:34:23.140265: main.c:1171 log_popt_command_line(): mocp --foreground 
Aug 31 15:34:23.159074: decoder.c:700 load_plugins(): Loaded 11 decoders: aac flac modplug mp3 musepack opus sidplay2 sndfile speex vorbis wavpack
Aug 31 15:34:23.159160: server.c:360 server_init(): Starting MOC Server
Aug 31 15:34:23.159210: log.c:233 log_init_stream(): Writing log to: stdout
Aug 31 15:34:23.159384: server.c:300 log_process_stack_size(): Process's stack size: 8388608
Aug 31 15:34:23.159402: server.c:317 log_pthread_stack_size(): PThread's stack size: 8388608
Trying JACK...
Aug 31 15:34:23.160789: jack.c:121 error_cb(): ERROR: JACK: Cannot connect to server socket err = No such file or directory
Aug 31 15:34:23.160809: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.160847: jack.c:121 error_cb(): ERROR: JACK: Cannot connect to server request channel
Aug 31 15:34:23.160861: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.163010: jack.c:121 error_cb(): ERROR: JACK: jack server is not running or cannot be started
Aug 31 15:34:23.163028: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.163298: jack.c:121 error_cb(): ERROR: JACK: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Aug 31 15:34:23.163317: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.163332: jack.c:121 error_cb(): ERROR: JACK: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Aug 31 15:34:23.163344: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.163369: jack.c:148 moc_jack_init(): ERROR: jack_client_open() failed, status = 0x11
Aug 31 15:34:23.163381: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.163393: jack.c:150 moc_jack_init(): ERROR: Unable to connect to JACK server
Aug 31 15:34:23.163404: server.c:672 add_event_all(): No events have been added because there are no clients
Trying ALSA...
Aug 31 15:34:23.163423: alsa.c:477 alsa_init(): Initialising ALSA device: default
Aug 31 15:34:23.165678: alsa.c:365 alsa_init_mixer_channel(): ERROR: Can't find mixer PCM
Aug 31 15:34:23.165710: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.165733: alsa.c:365 alsa_init_mixer_channel(): ERROR: Can't find mixer Master
Aug 31 15:34:23.165751: server.c:672 add_event_all(): No events have been added because there are no clients
Trying OSS...
Aug 31 15:34:23.165829: oss.c:206 oss_init(): ERROR: Can't open mixer device /dev/mixer: No such file or directory
Aug 31 15:34:23.165851: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.165899: oss.c:71 open_dev(): ERROR: Can't open /dev/dsp: No such file or directory
Aug 31 15:34:23.165918: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.165939: oss.c:87 set_capabilities(): ERROR: Can't open the device.
Aug 31 15:34:23.165956: server.c:672 add_event_all(): No events have been added because there are no clients
Aug 31 15:34:23.166034: audio.c:926 find_working_driver(): FATAL ERROR: No valid sound driver!

1 Answer 1

0

I had issues getting mocp running on my RPi, too.

There were several issues:

  • my user wasn't in the audio group, thus I had to use sudo to run amixer. Adding my user to that group solved that problem.
  • in my config (~/.moc/config, which was a copy from /usr/share/doc/moc/examples/config.example) the ALSA settings were PCM and Master.
  • when running with sudo, this settings file in my user-folder was ignored
  • when using -C or --config the config-file was "insecure" because I ran as sudo and the config file belonged to my user and not to root.
  • when I ran amixer it showed Simple mixer control 'Headphone',0
  • once I set the ALSA Settings in the moc config to use Headphone instead of Master or PCM, it started to work
1
  • Hey thanks for the insight. I checked again actually after so long without using mocp and it looks like the issue solved itself. Strangely, I am already in the audio group, and it's root that can't run the command now (go figure!). But this gave me good insights for what to try next time.
    – palimaar
    Mar 19, 2021 at 9:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .