No valid sound driver

Forums:

MOC version: 
2.6

I can't get moc to work.
I've tried putting everything in

~/.moc/config

but I always get some error.

this is my aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: D90 [D90], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

i have try

AlsaDevice = default

Running the server...
Trying ALSA...

FATAL_ERROR: No valid sound driver!

FATAL_ERROR: Server exited!

plughw:0,0

Running the server...
Trying ALSA...
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/control/control.c:1471:(snd_ctl_open_noupdate) Invalid CTL plughw:0,0

FATAL_ERROR: No valid sound driver!

FATAL_ERROR: Server exited!

plughw:0

Trying ALSA...
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/control/control.c:1471:(snd_ctl_open_noupdate) Invalid CTL plughw:0,0

FATAL_ERROR: No valid sound driver!

FATAL_ERROR: Server exited!

plughw:0,1

Trying ALSA...
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/control/control.c:1471:(snd_ctl_open_noupdate) Invalid CTL plughw:0,1

FATAL_ERROR: No valid sound driver!

FATAL_ERROR: Server exited!

also have cmus on my system and cmus works with both default:0 and plughw:0

This is : Music On Console
Version : 2.6-alpha3
Revision : 2933
Built : Mar 27 2021 00:34:07
Compiled with : ALSA
Running on : Linux 5.10.14-GentooPlayer-MIN-NOGRAPH+ aarch64
Author : Damian Pietras
Homepage : http://moc.daper.net/
E-Mail : mocmaint@daper.net
Copyright : (C) 2003-2016 Damian Pietras and others
License : GNU General Public License, version 2 or later

Yes, we have had this sort of problem in the past and even on my own machine I've found that something which works for aplay(1) doesn't necessarily work for MOC (and visa versa). When I compared the code in aplay(1) with that in MOC, I could see no significant differences except (IIRC) the order in which some of the calls to the ALSA library were made. But (again IIRC) the order could not be resequenced in MOC for some reason I can't immediately recall.

It's been some time since I looked into it and I'll have to take another look at it.

In the meantime, I apologise for the inconvenience.

It seems that hw:0 or hw:1 might work, but there is no software volume control. If you have a volume control on your speakers, this might work as a circumvention.

hw:0

Running the server...
Trying ALSA...

FATAL_ERROR: No valid sound driver!

FATAL_ERROR: Server exited!

hw:1

Running the server...
Trying ALSA...

FATAL_ERROR: No valid sound driver!

FATAL_ERROR: Server exited!

my config

My config

SoundDriver = ALSA
#ALSAMixer1 = PCM
#ALSAMixer2 = master
AlsaDevice = hw:0

Ok
I solved it by installing version 2.5.2.

so something is wrong with version 2.6

with version 2.5.2 i have a problem that it does not compile with ffmpeg

##################################
ffmpeg.c: In function ‘find_first_audio’:
ffmpeg.c:315:3: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
315 | if (ic->streams[result]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
| ^~
In file included from ffmpeg.c:67:
/usr/include/libavformat/avformat.h:880:21: note: declared here
880 | AVCodecContext *codec;
| ^~~~~
ffmpeg.c: In function ‘ffmpeg_init’:
ffmpeg.c:513:2: warning: ‘avcodec_register_all’ is deprecated [-Wdeprecated-declarations]
513 | avcodec_register_all ();
| ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/libavformat/avformat.h:312,
from ffmpeg.c:67:
/usr/include/libavcodec/avcodec.h:2751:6: note: declared here
2751 | void avcodec_register_all(void);
| ^~~~~~~~~~~~~~~~~~~~
ffmpeg.c:514:2: warning: ‘av_register_all’ is deprecated [-Wdeprecated-declarations]
514 | av_register_all ();
| ^~~~~~~~~~~~~~~
In file included from ffmpeg.c:67:
/usr/include/libavformat/avformat.h:2050:6: note: declared here
2050 | void av_register_all(void);
| ^~~~~~~~~~~~~~~
ffmpeg.c:521:2: warning: ‘av_lockmgr_register’ is deprecated [-Wdeprecated-declarations]
521 | rc = av_lockmgr_register (locking_cb);
| ^~
In file included from /usr/include/libavformat/avformat.h:312,
from ffmpeg.c:67:
/usr/include/libavcodec/avcodec.h:4118:5: note: declared here
4118 | int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
| ^~~~~~~~~~~~~~~~~~~
ffmpeg.c: In function ‘ffmpeg_destroy’:
ffmpeg.c:530:2: warning: ‘av_lockmgr_register’ is deprecated [-Wdeprecated-declarations]
530 | av_lockmgr_register (NULL);
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/libavformat/avformat.h:312,
from ffmpeg.c:67:
/usr/include/libavcodec/avcodec.h:4118:5: note: declared here
4118 | int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
| ^~~~~~~~~~~~~~~~~~~
ffmpeg.c: In function ‘ffmpeg_open’:
ffmpeg.c:968:2: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
968 | data->enc = data->stream->codec;
| ^~~~
In file included from ffmpeg.c:67:
/usr/include/libavformat/avformat.h:880:21: note: declared here
880 | AVCodecContext *codec;
| ^~~~~
ffmpeg.c:996:34: error: ‘CODEC_CAP_TRUNCATED’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_TRUNCATED’?
996 | if (data->codec->capabilities & CODEC_CAP_TRUNCATED)
| ^~~~~~~~~~~~~~~~~~~
| AV_CODEC_CAP_TRUNCATED
ffmpeg.c:996:34: note: each undeclared identifier is reported only once for each function it appears in
ffmpeg.c:997:23: error: ‘CODEC_FLAG_TRUNCATED’ undeclared (first use in this function); did you mean ‘AV_CODEC_FLAG_TRUNCATED’?
997 | data->enc->flags |= CODEC_FLAG_TRUNCATED;
| ^~~~~~~~~~~~~~~~~~~~
| AV_CODEC_FLAG_TRUNCATED
ffmpeg.c:1028:34: error: ‘CODEC_CAP_DELAY’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_DELAY’?
1028 | if (data->codec->capabilities & CODEC_CAP_DELAY)
| ^~~~~~~~~~~~~~~
| AV_CODEC_CAP_DELAY
ffmpeg.c: In function ‘decode_packet’:
ffmpeg.c:1294:3: warning: ‘avcodec_decode_audio4’ is deprecated [-Wdeprecated-declarations]
1294 | len = avcodec_decode_audio4 (data->enc, frame, &got_frame, pkt);
| ^~~
In file included from /usr/include/libavformat/avformat.h:312,
from ffmpeg.c:67:
/usr/include/libavcodec/avcodec.h:3024:5: note: declared here
3024 | int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
| ^~~~~~~~~~~~~~~~~~~~~
ffmpeg.c: In function ‘seek_in_stream’:
ffmpeg.c:1406:2: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
1406 | avcodec_flush_buffers (data->stream->codec);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from ffmpeg.c:67:
/usr/include/libavformat/avformat.h:880:21: note: declared here
880 | AVCodecContext *codec;
| ^~~~~
make[3]: *** [Makefile:416: libffmpeg_decoder_la-ffmpeg.lo] Error 1
#########################################

version 2.6, on the other hand, compiles without problems even with ffmpeg, but unfortunately does not work with alsa.....

I solved it by installing version 2.5.2.

so something is wrong with version 2.6

So it would appear. I shall add that to the pile of clues.

with version 2.5.2 i have a problem that it does not compile with ffmpeg

Those problems were addressed in the repository (r2969..r2975) but have not yet made it into a distribution tarball. If you wish I can e-mail you the necessary patches.

yes, thank you.

but by adding these patches, will the internet streams work?

antonellocaroli@gmail.com

ok I also solved with ffmpeg....

But I would like to solve the problem with version 2.6 :(

with version 2.5 i can't play internet radios...and it doesn't see dsf files
maybe it's a feature that was added in 2.6?

Yes, DSF support was added in MOC 2.6 (r2876).

If it's HTTPS support you're asking about, see the answer to the second question asked given here. If it's not HTTPS, could you explain the problem you're having in more detail, please?

So you no longer require the FFmpeg patches?

No, I solved it.

But with version 2.5 I can't play internet radio and it doesn't see dsf files...
:(

not https
ex.
http://icecast.radiofrance.fr/fipnantes-midfi.mp3

Could not open URL: No such file or directory

OK, also solved with the radios, it was necessary to activate the USE curl....

now we just need to understand why 2.6 doesn't work

do you have any idea?

activate the USE curl

What is the "USE curl"?

do you have any idea?

As mentioned previously, the only theory so far is that it has something to do with the sequence of calls to the ALSA library. In particular, MOC uses mixers whereas play and aplay do not. I will need to have a look at the cmus code.

But it's also interesting that you say it works with MOC 2.5.2. Again as an interim measure you could try backporting the applicable 2.6 patches to 2.5. (I'm assuming from what you've said thus far that you're capable of doing that.)

Again as an interim measure you could try backporting the applicable 2.6 patches to 2.5. (I'm assuming from what you've said thus far that you're capable of doing that.).

I don't know how to do this....

I tried to apply the changes to ffmpeg for dsd support to version 2.5

but i get this error if i play a dsf file:

(0) Unknown sample format: ittle-endian (native)

during compilation I have this, I don't know if it indicates anything useful:

checking neaacdec.h usability... yes checking neaacdec.h presence... yes checking for neaacdec.h... yes checking for ffmpeg... yes checking ffmpeg/avformat.h usability... no checking ffmpeg/avformat.h presence... no checking for ffmpeg/avformat.h... no checking libavformat/avformat.h usability... yes checking libavformat/avformat.h presence... yes checking for libavformat/avformat.h... yes checking for struct AVCodecContext.request_channels... no checking for ffmpeg/avformat.h... (cached) no checking for libavformat/avformat.h... (cached) yes checking libavutil/channel_layout.h usability... yes checking libavutil/channel_layout.h presence... yes checking for libavutil/channel_layout.h... yes checking for library containing avcodec_open2... none required checking for library containing avcodec_decode_audio2... no checking for library containing avcodec_decode_audio3... no checking for library containing avcodec_decode_audio4... none required checking for library containing av_packet_unref... none required checking for library containing avformat_open_input... none required checking for library containing avformat_close_input... none required checking for library containing avformat_find_stream_info... none required checking for library containing avio_size... none required checking for AVIOContext.seekable... yes checking for library containing av_metadata_get... no checking for library containing av_dict_get... none required checking for library containing av_get_channel_layout_nb_channels... none required checking whether CODEC_ID_MP2 is declared... no checking whether AV_CODEC_ID_MP2 is declared... yes checking whether CODEC_ID_OPUS is declared... no checking whether AV_CODEC_ID_OPUS is declared... yes checking whether CODEC_ID_SPEEX is declared... no checking whether AV_CODEC_ID_SPEEX is declared... yes checking whether CODEC_ID_THEORA is declared... no checking whether AV_CODEC_ID_THEORA is declared... yes checking whether CODEC_ID_VORBIS is declared... no checking whether AV_CODEC_ID_VORBIS is declared... yes checking for library containing av_frame_alloc... none required checking for library containing av_frame_unref... none required checking for library containing av_frame_free... none required checking for library containing avcodec_free_frame... no checking whether CODEC_ID_PCM_S8 is declared... no checking whether CODEC_ID_PCM_S8_PLANAR is declared... no checking whether AV_CODEC_ID_PCM_S8_PLANAR is declared... yes checking whether CODEC_ID_PCM_U8 is declared... no checking whether CODEC_ID_PCM_S16LE is declared... no checking whether CODEC_ID_PCM_S16LE_PLANAR is declared... no checking whether AV_CODEC_ID_PCM_S16LE_PLANAR is declared... yes checking whether CODEC_ID_PCM_S16BE is declared... no checking whether CODEC_ID_PCM_U16LE is declared... no checking whether CODEC_ID_PCM_U16BE is declared... no checking whether CODEC_ID_PCM_S24LE is declared... no checking whether CODEC_ID_PCM_S24BE is declared... no checking whether CODEC_ID_PCM_U24LE is declared... no checking whether CODEC_ID_PCM_U24BE is declared... no checking whether CODEC_ID_PCM_S32LE is declared... no checking whether CODEC_ID_PCM_S32BE is declared... no checking whether CODEC_ID_PCM_U32LE is declared... no checking whether CODEC_ID_PCM_U32BE is declared... no checking whether AV_SAMPLE_FMT_U8 is declared... yes checking whether AV_SAMPLE_FMT_U8P is declared... yes checking whether AV_SAMPLE_FMT_S16P is declared... yes checking whether AV_SAMPLE_FMT_U16LE is declared... no checking whether AV_SAMPLE_FMT_U16BE is declared... no checking whether AV_SAMPLE_FMT_U24LE is declared... no checking whether AV_SAMPLE_FMT_U24BE is declared... no checking whether AV_SAMPLE_FMT_S32P is declared... yes checking whether AV_SAMPLE_FMT_U32LE is declared... no checking whether AV_SAMPLE_FMT_U32BE is declared... no checking whether AV_SAMPLE_FMT_FLTP is declared... yes checking whether CODEC_CAP_EXPERIMENTAL is declared... no checking for library containing av_get_sample_fmt_name... none required checking for library containing av_lockmgr_register... none required checking for LIBFLAC... yes checking for mad_stream_init in -lmad... yes

It's actually ALSA saying it doesn't support the sample format supplied by FFmpeg when decoding a DSF file. From what I see here, you were successful in backporting the patch and the actual decoding succeeds.

But there's obviously something still wrong and I can't determine it from this.

Could you run mocp with the -D option, attempt to play the DSF audio which failed and e-mail me the compressed mocp_server_log file produced, please.

What versions of FFmpeg and ALSA are you using?

I sent an email to
mocmaint@daper.net

I hope it is right...

I did yet another experiment to try to understand why version 2.6 does not work.

I replaced the alsa.c file in version 2.6 with the one from 2.5 and it works.

I don't understand the C language but it seems that the problem is to be found in this diff

https://github.com/antonellocaroli/mocp1/commit/ed73fb31b251abc97ac48702a6fd7b827e2403e7

###############################################
with regard to native dsd and dop maybe this can help to implement it:

https://github.com/marcoc1712/squeezelite-R2/blob/Release/dsd.c

https://github.com/marcoc1712/squeezelite-R2/blob/Release/dop.c

https://github.com/marcoc1712/squeezelite-R2/tree/Release/dsd2pcm