# MOC player doesn't recognize Ogg files



## BSDBernd (Jan 26, 2014)

Hello to all!

I installed mocp on my 10-RELEASE FreeBSD as a binary and found out that it doesn't even recognize ogg-files, although it should
(ogg support should be a default because when you install mocp using ports (which i tried first), ogg-file support is a default option).

It could be that there has to be some configuration to be done and i didn't see this. Has anybody a clue what has to be added to the installation or what went wrong?

Thank you very much for any help.


----------



## trh411 (Jan 26, 2014)

Did you set up your user configuration file? IIRC the example config file at /usr/share/doc/moc/ has to be copied to ~/.moc/config. You can then make your local edits to the configuration.


----------



## BSDBernd (Jan 26, 2014)

Thank you for your answer. 



> Did you set up your user configuration file?



I have no config file set up yet, so at the moment the default configuration is used. Is there an option that has to be set there for ogg-support? 
It seems that my assumption that ogg works out of the box was false.


----------



## BSDBernd (Jan 26, 2014)

It seems that I have no example file. There is no directory
/usr/share/doc/moc/ .
May be this belongs not to the default installation.


----------



## trh411 (Jan 26, 2014)

BSDBernd said:
			
		

> Is there an option that has to be set there for ogg-support?


I would not think so if Vorbis support was an installation default. Does `pkg info -x vorbis` show libvorbis is installed? It's been a while since I've used audio/moc ... can you post the default config file it is using?


----------



## trh411 (Jan 26, 2014)

BSDBernd said:
			
		

> It seems that I have no example file. There is no directory /usr/share/doc/moc/. May be this belongs not to the default installation.


My bad. That should have been /usr/local/share/doc/moc/. According to the pkg-plist for audio/moc, it should be installed:

```
# cat pkg-plist
...
share/doc/moc/config.example
...
```


----------



## BSDBernd (Jan 26, 2014)

Thank you for your answers.
This is the file in question. 


```
# This is a configuration file for the MOC player. It should be named 'config'
# and placed in directory ~/.moc/
# Comments begins with '#'.
# You can use quotes and escape ('\') in parameters


# Show file titles (title, author, album) instead of file names.
ReadTags		= yes

# Directory in which you store music files, if you specify it, you will be able
# to quickly go to this directory with the '-m' parameter or the 'm' command.
# This can also point to a playlist.
#MusicDir		= "/home/joe/music"

# How to sort? FileName is the only option for now.
Sort			= FileName

# Show errors in the streams, for example CRC errors or broken frames in mp3
# files
ShowStreamErrors	= no

# Ignore CRC errors in MP3 files. Most players do that, so the default value is
# set to yes.
Mp3IgnoreCRCErrors	= yes

# Turn on repeat.
Repeat			= no

# Turn on shuffle.
Shuffle			= no

# Turn on AutoNext
AutoNext		= yes

# Default FormatString
# %n - Track number
# %a - Artist
# %A - Album
# %t - Title
# %(X:TRUE:FALSE) - ternary expression - if X exists, do TRUE, otherwaise
#                   FALSE. '\' - escape character (must be double, because of 
#                   config interpreter). man zshmisc for more info.
FormatString		= "%(n:%n :)%(a:%a - :)%(t:%t:)%(A: \(%A\):)"

# Output buffer size in kilobytes. Minimum value is 128KB. */
OutputBuffer		= 2048

# Input buffer size in kilobytes. Minimum value is 32KB. */
InputBuffer		= 512

# How much to fill the input buffer before playing (in kilobytes)?
# This can't be more than InputBuffer value.
# Remember that for network streams beside the positive effect this also causes
# delay between what you can hear and what is broadcasted.
Prebuffering		= 64

# Use this HTTP proxy server for internet streams. If not set, the
# environmential variables http_proxy and ALL_PROXY will be used if present.
#HTTPProxy		= my_proxy:port

# Sound driver - OSS, ALSA, JACK, or null (only for debugging)
# You can enter more than one driver separated by a coma. The first working
# driver will be used.
SoundDriver		= JACK, ALSA, OSS

# Jack output settings
JackOutLeft		= "alsa_pcm:playback_1"
JackOutRight		= "alsa_pcm:playback_2"

# OSS output device
OSSDevice		= /dev/dsp

# OSS Mixer device
OSSMixerDevice		= /dev/mixer

# OSS Mixer channel: pcm or master
OSSMixerChannel		= pcm

# Second OSS Mixer channel: pcm or master
OSSMixerChannel2	= master

# ALSA mixer device
AlsaMixer 		= PCM

# Second ALSA mixer device
AlsaMixer2		= Master

# ALSA output device
AlsaDevice		= default

# Show files with dot at the beginning?
ShowHiddenFiles		= no

# Start in the music directory if no arguments are given. If set to no, start
# in the current directory.
StartInMusicDir		= no

# Hide file name extensions
HideFileExtension	= no

# Show file format in menu.
ShowFormat		= yes

# Show file time in menu. Possible options: yes, no, IfAvailable - show the
# time only when it was read before (often works faster)
ShowTime		= IfAvailable

# Theme file. This can be absolute path or relative to
# /usr/share/moc/themes/ (depends on installation prefix) or ~/.moc/themes/
# Theme			= example_theme

# The theme used when running on on xterm
# XTermTheme		= transparent-background

# MOC directory - where pid file, socket, and state files are stored.
# You can use ~ at the begining
# MOCDir		= ~/.moc

# Use mmap() to read files. mmap() is much slower on NFS.
UseMmap			= no

# Assume this encoding for ID3 version 1/1.1 tags (mp3 files). Unlike ID3v2
# UTF-8 is not used here and MOC can't guess how tags are encoded. Another
# solution is using librcc (see the next option). This option is ignored
# if UseRCC is set to yes.
#ID3v1TagsEncoding		= WINDOWS-1250

# Use librcc to fix ID3 version 1/1.1 tags encoding.
#UseRCC				= yes

# Remember the playlist after exit?
SavePlaylist		= yes

# When using more than one client (interface) at a time, do the share the
# playlist?
SyncPlaylist		= yes

# Choose a keymap file (relative to ~/.moc/ or absolute path)
# Example keymap with description is included (keymap.example).
#Keymap			= my_keymap

# Use ASCII characters instead of graphic for drawing lines. This helps on
# some terminals.
ASCIILines		= no

# FastDirs, these allow you jump directly to a directory, the key bindings are
# in the keymap file.
#Fastdir1 = /mp3/rock
#Fastdir2 = /mp3/electronic
#Fastdir3 = /mp3/rap
#Fastdir4 = /mp3/etc
#Fastdir5 = 
#Fastdir6 = 
#Fastdir7 = 
#Fastdir8 = 
#Fastdir9 = 
#Fastdir10 =

# How fast to seek? Number of seconds per key stroke.
#SeekTime		= 1

# How fast to seek (when using silent seeking)? Number of seconds per key
# stroke.
#SilentSeekTime		= 5

# Resample method to use. There are few methods of resampling sound supported
# by libresamplerate. The default is the fastest (linear). Better description
# is here: http://www.mega-nerd.com/libsamplerate/api_misc.html#Converters
#
# High quality (based on bandlimited interpolation), but slow methods:
#
# SincBestQuality - really slow (I know you probably have an xx GHz processor,
#			but it's not enough to not see this in the top output :)
#			The worst case Signal-to-Noise Ratio is 97dB.
# SincMediumQuality - much faster
# SincFastest - the fastest bandlimited interpolation
#
# Poor quality, but much faster methods:
#
# ZeroOrderHold - really poor quality, but it's really fast
# Linear - a bit better and a bit slower
#
#ResampleMethod		= Linear

# Always use this sample rate when opening the audio device (and resample the
# sound is necessary). When set to 0 the device is opened with the file's rate.
#ForceSampleRate	= 48000

# By default even if the sound card reports that it can output 24bit samples
# MOC converts 24bit PCM to 16bit. This option set to yes allows MOC to use
# 24bit output (for example MP3 decoder uses this format). This is disabled
# in the default configuration because there were reports that it prevents
# from playing MP3 files on some soundcards.
#Allow24bitOutput	= no

# Use realtime priority for output buffer thread. This will prevent gaps while
# playing even with heavy load. The user which runs MOC must have permissions
# to set such a priority. This could be dangerous, because it is possible that
# a bug in MOC will freeze your computer.
#UseRealtimePriority	= no

# Size of the in-memory cache for file tags in KB.
TagsCacheSize		= 256

# Number items in the playlist.
#PlaylistNumbering	= yes

# Main window layoutis can be configured. You can change the position and the
# size of the menus (directory and playlist). You have 3 layouts ant switch
# between then using the 'l' key (standard mapping). By default only 2 layouts
# are configured.
#
# The format is as folows:
# Each menu is described in format NAME:POSITION_X,POSITION_Y,WIDTH,HEIGHT
# NAME is directory or playlist
# Other parameters define position and size of the menu. They can be absolute
# numbers (like 10) or a percent value of the screen size (like 45%).
# WIDTH and HEIGHT can have value of FILL which means fill the screen from
# the menu's position to the border.
# Separate menu descriptions using a space.
# Menus may overlap.
# You must describe at least one menu (default is to fill the whole window).
# There must be at least one layout (Layout1) defined. Other can be empty ("").
#
# Examples:
#
# Just one layout, the directory will occupy the whole screen, the playlist
# will have 1/4 of the screen size and be positioned at lower right corner.
# Layout1 = "playlist:50%,50%,50%,50%"
# Layout2 = ""
# Layout3 = ""
#
# The scrren is split into two parts: playlist at the top and the directory
# menu at the bottom. Playlist will occupy 10 lines and the directory menu
# the rest.
# Layout1 = "playlist:0,0,100%,10 directory:0,10,100%,FILL"
#
# Default configuration:
# Layout1		= "directory:0,0,50%,100% playlist:50%,0,50%,100%"
# Layout2		= "directory:0,0,100%,100% playlist:0,0,100%,100%"
# Layout3		= ""

# When the song changes, should the menu be scrolled so that the currently
# played file is visible?
FollowPlayedFile	= yes

# What to do if the interface was started and something from the playlist is
# playing? If CanStartInPlaylist is set to "yes", the interface will switch to
# the playlist. When set to "no" it will start from the last directory.
CanStartInPlaylist	= yes

# Executing external commands (1 - 10) invoked with key commands (F1 - F10 by
# default).
# Some arguments are substituted befor executing:
# %f - file path
# %i - title made from tags
#
# Data from tags:
# %t - title
# %a - album
# %r - artist
# %n - track
# %m - time of the file (in seconds)
#
# Parameters above applys to the currently selected file. If you change them to
# capital letters, they are taken from the currently played file.
#
# Programms are run using execv(), not a shell, so you can't do things like
# redirecting the output to a file. The command string is split using blank
# characters as separators, the first element is the command to be executed
# and the rest are parameters, so if you use "echo Playing: %i" we run program
# echo (from $PATH) with 2 parameters: 'Playing:' string and the title. Even
# if the title contains spaces it's still one parameter and it's safe if it
# contains `rm -rf /`.
#
# Examples:
# ExecCommand1		= "cp %f /mnt/usb_drive"
# ExecCommand2		= "/home/joe/now_playing %i"

# Display the cursor in the line with the selected file. This can be usefu with
# a braille display.
# UseCursorSelection	= no

# Set the terminal title when running under xterm.
#SetXtermTitle		= yes

# Display full paths instead of just file names in the playlist.
#PlaylistFullPaths	= yes
```


----------



## trh411 (Jan 26, 2014)

Are libogg and libvorbis installed? You can check using the commands `pkg info -x ogg` and `pkg info -x vorbis`.


----------



## BSDBernd (Jan 26, 2014)

They are both installed.


----------



## trh411 (Jan 26, 2014)

I can't recollect, does audio/moc have a log file that might provide some clues as to what is going wrong?


----------



## BSDBernd (Jan 26, 2014)

I will look for it.


----------



## trh411 (Jan 26, 2014)

~/.moc/ would be a good place to start. I did not see any reference to a log file in the default config file.

EDIT: Just found this on the web site http://moc.daper.net/node/96:

```
MOC can create logs which are sometimes useful when reporting a bug. Just run MOC with --debug (or -D) option and two files will be created: mocp_server_log and mocp_server_log. Remember to shut down the server before doing this to get the server log (SHIFT-Q command or mocp -x).
```


----------



## BSDBernd (Jan 26, 2014)

Thank you so much for your reply. 
Here are the results of playing a test file, named test.ogg, which did not even display in mocp:

mocp_client_log:

```
Jan 26 18:47:03.400480: interface.c:1383 init_interface(): Starting MOC interface...
Jan 26 18:47:03.404861: utf8.c:302 utf8_init(): Using UTF8 output
Jan 26 18:47:03.420628: interface.c:439 update_mixer_name(): Mixer name: pcm
Jan 26 18:47:03.430814: interface.c:1259 get_server_playlist(): Getting the playlist...
Jan 26 18:47:03.432794: interface.c:857 recv_server_plist(): Asking server for the playlist from other client.
Jan 26 18:47:03.434383: interface.c:859 recv_server_plist(): Waiting for response
Jan 26 18:47:03.439083: interface.c:863 recv_server_plist(): There is no playlist
Jan 26 18:47:03.444240: interface.c:3196 dequeue_events(): Dequeuing events...
Jan 26 18:47:03.445710: interface.c:3203 dequeue_events(): done
Jan 26 18:47:04.481395: interface.c:3196 dequeue_events(): Dequeuing events...
Jan 26 18:47:04.483230: interface.c:3203 dequeue_events(): done
Jan 26 18:47:05.162152: interface.c:3312 interface_end(): Interface exited
```

mocp_server_log:
(there are some errors)


```
Jan 26 18:47:03.375483: oss.c:58 open_dev(): Audio device opened
Jan 26 18:47:03.377708: oss.c:58 open_dev(): Audio device opened
Jan 26 18:47:03.379363: audio.c:850 print_output_capabilities(): Sound driver capabilities: channels 1 - 2, formats: 8-bit signed, 8-bit unsigned, 16-bit signed little-endian (native)
Jan 26 18:47:03.381415: tags_cache.c:538 tags_cache_load(): Loading tags cache from /home/bernd/.moc/tags_cache...
Jan 26 18:47:03.383350: tags_cache.c:653 tags_cache_load(): Loaded 0 items to the cache
Jan 26 18:47:03.386848: server.c:1215 server_loop(): MOC server started, pid: 1078
Jan 26 18:47:03.388486: server.c:1241 server_loop(): accept()ing connection...
Jan 26 18:47:03.389828: server.c:1249 server_loop(): Incoming connection
Jan 26 18:47:03.391399: tags_cache.c:453 tags_cache_clear_queue(): Cleared requests queue for client 0
Jan 26 18:47:03.381505: out_buf.c:66 read_thread(): entering output buffer thread
Jan 26 18:47:03.381524: tags_cache.c:297 reader_thread(): tags reader thread started
Jan 26 18:47:03.399620: tags_cache.c:319 reader_thread(): all queues empty, waiting
Jan 26 18:47:03.403214: server.c:848 gen_serial(): Generated serial 0 for client with fd 3
Jan 26 18:47:03.434346: server.c:639 get_client_plist(): Client with fd 3 requests the playlist.
Jan 26 18:47:03.436945: server.c:649 get_client_plist(): No clients with the playlist.
Jan 26 18:47:03.440975: server.c:1067 handle_command(): Request for events
Jan 26 18:47:05.161911: server.c:978 handle_command(): Exit request from the client
Jan 26 18:47:05.164606: server.c:1269 server_loop(): Exiting...
Jan 26 18:47:05.169416: protocol.c:103 send_int(): send() failed: Broken pipe
Jan 26 18:47:05.170785: tags_cache.c:453 tags_cache_clear_queue(): Cleared requests queue for client 0
Jan 26 18:47:05.172046: server.c:448 server_shutdown(): Server exiting...
Jan 26 18:47:05.173250: out_buf.c:132 read_thread(): exit
Jan 26 18:47:05.174817: out_buf.c:179 read_thread(): exiting
Jan 26 18:47:05.176274: out_buf.c:242 out_buf_destroy(): buffer destroyed
Jan 26 18:47:05.177590: player.c:335 precache_wait(): Precache thread is not running
Jan 26 18:47:05.188999: tags_cache.c:485 tags_cache_save(): Saving tags cache to /home/bernd/.moc/tags_cache...
Jan 26 18:47:05.190464: tags_cache.c:340 reader_thread(): exiting tags reader thread
Jan 26 18:47:05.192231: server.c:456 server_shutdown(): Server exited
```


----------



## trh411 (Jan 26, 2014)

The only thing that looks even remotely suspect to me are the following lines from the server log:

```
an 26 18:47:03.403214: server.c:848 gen_serial(): Generated serial 0 for client with fd 3
Jan 26 18:47:03.434346: server.c:639 get_client_plist(): Client with fd 3 requests the playlist.
Jan 26 18:47:03.436945: server.c:649 get_client_plist(): No clients with the playlist.
Jan 26 18:47:03.440975: server.c:1067 handle_command(): Request for events
Jan 26 18:47:05.161911: server.c:978 handle_command(): Exit request from the client
```
but they still do not give me a clue as to what's happening here since you are trying to play a single file, not a playlist. Quite frankly, I'm stumped.


----------



## Beastie (Jan 26, 2014)

And look what has just been committed...


> 26 Jan 2014 18:42:44
> Add explicit dependency on pkgconf so that some options are properly handled



http://www.freshports.org/audio/moc/
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/185880

Tada!


----------



## BSDBernd (Jan 26, 2014)

Wow! Thank you very much for the info Beastie.


----------

